~julian-edwards/maas/mipf-celery-job

« back to all changes in this revision

Viewing changes to utilities/python_standard_libs.py

  • Committer: Gavin Panella
  • Date: 2012-01-18 21:15:50 UTC
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: gavin.panella@canonical.com-20120118211550-surn0g3wes9ktw6f
Borrow format-imports from Launchpad.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2010 Canonical Ltd.  This software is licensed under the
 
2
# GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
""" A list of top-level standard python library names.
 
5
 
 
6
This list is used by format-imports to determine if a module is in this group
 
7
or not.
 
8
The list is taken from http://docs.python.org/release/2.5.4/lib/modindex.html
 
9
but modules specific to other OSs have been taken out. It may need to be
 
10
updated from time to time.
 
11
"""
 
12
 
 
13
 
 
14
# Run this to generate a new module list.
 
15
if __name__ == '__main__':
 
16
    from lxml import html
 
17
    from sys import version_info, stdout
 
18
    modindex_url = (
 
19
        "http://docs.python.org/release/"
 
20
        "{0}.{1}.{2}/modindex.html").format(*version_info)
 
21
    root = html.parse(modindex_url).getroot()
 
22
    modules = set(
 
23
        node.text.split(".", 1)[0] # the "base" module name.
 
24
        for node in root.cssselect("table tt"))
 
25
    stdout.write("python_standard_libs = [\n")
 
26
    for module in sorted(modules, key=str.lower):
 
27
        stdout.write("    %r,\n" % module)
 
28
    stdout.write("    ]\n")
 
29
 
 
30
 
 
31
python_standard_libs = [
 
32
    '__builtin__',
 
33
    '__future__',
 
34
    '__main__',
 
35
    '_winreg',
 
36
    'abc',
 
37
    'aepack',
 
38
    'aetools',
 
39
    'aetypes',
 
40
    'aifc',
 
41
    'al',
 
42
    'AL',
 
43
    'anydbm',
 
44
    'applesingle',
 
45
    'array',
 
46
    'ast',
 
47
    'asynchat',
 
48
    'asyncore',
 
49
    'atexit',
 
50
    'audioop',
 
51
    'autoGIL',
 
52
    'base64',
 
53
    'BaseHTTPServer',
 
54
    'Bastion',
 
55
    'bdb',
 
56
    'binascii',
 
57
    'binhex',
 
58
    'bisect',
 
59
    'bsddb',
 
60
    'buildtools',
 
61
    'bz2',
 
62
    'calendar',
 
63
    'Carbon',
 
64
    'cd',
 
65
    'cfmfile',
 
66
    'cgi',
 
67
    'CGIHTTPServer',
 
68
    'cgitb',
 
69
    'chunk',
 
70
    'cmath',
 
71
    'cmd',
 
72
    'code',
 
73
    'codecs',
 
74
    'codeop',
 
75
    'collections',
 
76
    'ColorPicker',
 
77
    'colorsys',
 
78
    'commands',
 
79
    'compileall',
 
80
    'compiler',
 
81
    'ConfigParser',
 
82
    'contextlib',
 
83
    'Cookie',
 
84
    'cookielib',
 
85
    'copy',
 
86
    'copy_reg',
 
87
    'cPickle',
 
88
    'cProfile',
 
89
    'crypt',
 
90
    'cStringIO',
 
91
    'csv',
 
92
    'ctypes',
 
93
    'curses',
 
94
    'datetime',
 
95
    'dbhash',
 
96
    'dbm',
 
97
    'decimal',
 
98
    'DEVICE',
 
99
    'difflib',
 
100
    'dircache',
 
101
    'dis',
 
102
    'distutils',
 
103
    'dl',
 
104
    'doctest',
 
105
    'DocXMLRPCServer',
 
106
    'dumbdbm',
 
107
    'dummy_thread',
 
108
    'dummy_threading',
 
109
    'EasyDialogs',
 
110
    'email',
 
111
    'encodings',
 
112
    'errno',
 
113
    'exceptions',
 
114
    'fcntl',
 
115
    'filecmp',
 
116
    'fileinput',
 
117
    'findertools',
 
118
    'FL',
 
119
    'fl',
 
120
    'flp',
 
121
    'fm',
 
122
    'fnmatch',
 
123
    'formatter',
 
124
    'fpectl',
 
125
    'fpformat',
 
126
    'fractions',
 
127
    'FrameWork',
 
128
    'ftplib',
 
129
    'functools',
 
130
    'future_builtins',
 
131
    'gc',
 
132
    'gdbm',
 
133
    'gensuitemodule',
 
134
    'getopt',
 
135
    'getpass',
 
136
    'gettext',
 
137
    'gl',
 
138
    'GL',
 
139
    'glob',
 
140
    'grp',
 
141
    'gzip',
 
142
    'hashlib',
 
143
    'heapq',
 
144
    'hmac',
 
145
    'hotshot',
 
146
    'htmlentitydefs',
 
147
    'htmllib',
 
148
    'HTMLParser',
 
149
    'httplib',
 
150
    'ic',
 
151
    'icopen',
 
152
    'imageop',
 
153
    'imaplib',
 
154
    'imgfile',
 
155
    'imghdr',
 
156
    'imp',
 
157
    'imputil',
 
158
    'inspect',
 
159
    'io',
 
160
    'itertools',
 
161
    'jpeg',
 
162
    'json',
 
163
    'keyword',
 
164
    'lib2to3',
 
165
    'linecache',
 
166
    'locale',
 
167
    'logging',
 
168
    'macerrors',
 
169
    'MacOS',
 
170
    'macostools',
 
171
    'macpath',
 
172
    'macresource',
 
173
    'mailbox',
 
174
    'mailcap',
 
175
    'marshal',
 
176
    'math',
 
177
    'md5',
 
178
    'mhlib',
 
179
    'mimetools',
 
180
    'mimetypes',
 
181
    'MimeWriter',
 
182
    'mimify',
 
183
    'MiniAEFrame',
 
184
    'mmap',
 
185
    'modulefinder',
 
186
    'msilib',
 
187
    'msvcrt',
 
188
    'multifile',
 
189
    'multiprocessing',
 
190
    'mutex',
 
191
    'Nav',
 
192
    'netrc',
 
193
    'new',
 
194
    'nis',
 
195
    'nntplib',
 
196
    'numbers',
 
197
    'operator',
 
198
    'optparse',
 
199
    'os',
 
200
    'ossaudiodev',
 
201
    'parser',
 
202
    'pdb',
 
203
    'pickle',
 
204
    'pickletools',
 
205
    'pipes',
 
206
    'PixMapWrapper',
 
207
    'pkgutil',
 
208
    'platform',
 
209
    'plistlib',
 
210
    'popen2',
 
211
    'poplib',
 
212
    'posix',
 
213
    'posixfile',
 
214
    'pprint',
 
215
    'profile',
 
216
    'pstats',
 
217
    'pty',
 
218
    'pwd',
 
219
    'py_compile',
 
220
    'pyclbr',
 
221
    'pydoc',
 
222
    'Queue',
 
223
    'quopri',
 
224
    'random',
 
225
    're',
 
226
    'readline',
 
227
    'repr',
 
228
    'resource',
 
229
    'rexec',
 
230
    'rfc822',
 
231
    'rlcompleter',
 
232
    'robotparser',
 
233
    'runpy',
 
234
    'sched',
 
235
    'ScrolledText',
 
236
    'select',
 
237
    'sets',
 
238
    'sgmllib',
 
239
    'sha',
 
240
    'shelve',
 
241
    'shlex',
 
242
    'shutil',
 
243
    'signal',
 
244
    'SimpleHTTPServer',
 
245
    'SimpleXMLRPCServer',
 
246
    'site',
 
247
    'smtpd',
 
248
    'smtplib',
 
249
    'sndhdr',
 
250
    'socket',
 
251
    'SocketServer',
 
252
    'spwd',
 
253
    'sqlite3',
 
254
    'ssl',
 
255
    'stat',
 
256
    'statvfs',
 
257
    'string',
 
258
    'StringIO',
 
259
    'stringprep',
 
260
    'struct',
 
261
    'subprocess',
 
262
    'sunau',
 
263
    'sunaudiodev',
 
264
    'SUNAUDIODEV',
 
265
    'symbol',
 
266
    'symtable',
 
267
    'sys',
 
268
    'syslog',
 
269
    'tabnanny',
 
270
    'tarfile',
 
271
    'telnetlib',
 
272
    'tempfile',
 
273
    'termios',
 
274
    'test',
 
275
    'textwrap',
 
276
    'thread',
 
277
    'threading',
 
278
    'time',
 
279
    'timeit',
 
280
    'Tix',
 
281
    'Tkinter',
 
282
    'token',
 
283
    'tokenize',
 
284
    'trace',
 
285
    'traceback',
 
286
    'tty',
 
287
    'turtle',
 
288
    'types',
 
289
    'unicodedata',
 
290
    'unittest',
 
291
    'urllib',
 
292
    'urllib2',
 
293
    'urlparse',
 
294
    'user',
 
295
    'UserDict',
 
296
    'UserList',
 
297
    'UserString',
 
298
    'uu',
 
299
    'uuid',
 
300
    'videoreader',
 
301
    'W',
 
302
    'warnings',
 
303
    'wave',
 
304
    'weakref',
 
305
    'webbrowser',
 
306
    'whichdb',
 
307
    'winsound',
 
308
    'wsgiref',
 
309
    'xdrlib',
 
310
    'xml',
 
311
    'xmlrpclib',
 
312
    'zipfile',
 
313
    'zipimport',
 
314
    'zlib',
 
315
    ]