~launchpad-pqm/launchpad/devel

11461.2.1 by Henning Eggers
Added format-imports script and documented it.
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
12855.1.1 by Gavin Panella
Make it easy to update utilities/python_standard_libs.py.
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)
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
28
    stdout.write("    ]\n")
12855.1.1 by Gavin Panella
Make it easy to update utilities/python_standard_libs.py.
29
30
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
31
python_standard_libs = [
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
32
    '__builtin__',
33
    '__future__',
34
    '__main__',
35
    '_winreg',
36
    'abc',
37
    'aepack',
38
    'aetools',
39
    'aetypes',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
40
    'aifc',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
41
    'al',
42
    'AL',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
43
    'anydbm',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
44
    'applesingle',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
45
    'array',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
46
    'ast',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
47
    'asynchat',
48
    'asyncore',
49
    'atexit',
50
    'audioop',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
51
    'autoGIL',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
52
    'base64',
53
    'BaseHTTPServer',
54
    'Bastion',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
55
    'bdb',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
56
    'binascii',
57
    'binhex',
58
    'bisect',
59
    'bsddb',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
60
    'buildtools',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
61
    'bz2',
62
    'calendar',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
63
    'Carbon',
64
    'cd',
65
    'cfmfile',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
66
    'cgi',
67
    'CGIHTTPServer',
68
    'cgitb',
69
    'chunk',
70
    'cmath',
71
    'cmd',
72
    'code',
73
    'codecs',
74
    'codeop',
75
    'collections',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
76
    'ColorPicker',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
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',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
98
    'DEVICE',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
99
    'difflib',
100
    'dircache',
101
    'dis',
102
    'distutils',
103
    'dl',
104
    'doctest',
105
    'DocXMLRPCServer',
106
    'dumbdbm',
107
    'dummy_thread',
108
    'dummy_threading',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
109
    'EasyDialogs',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
110
    'email',
111
    'encodings',
112
    'errno',
113
    'exceptions',
114
    'fcntl',
115
    'filecmp',
116
    'fileinput',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
117
    'findertools',
118
    'FL',
119
    'fl',
120
    'flp',
121
    'fm',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
122
    'fnmatch',
123
    'formatter',
124
    'fpectl',
125
    'fpformat',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
126
    'fractions',
127
    'FrameWork',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
128
    'ftplib',
129
    'functools',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
130
    'future_builtins',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
131
    'gc',
132
    'gdbm',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
133
    'gensuitemodule',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
134
    'getopt',
135
    'getpass',
136
    'gettext',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
137
    'gl',
138
    'GL',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
139
    'glob',
140
    'grp',
141
    'gzip',
142
    'hashlib',
143
    'heapq',
144
    'hmac',
145
    'hotshot',
146
    'htmlentitydefs',
147
    'htmllib',
148
    'HTMLParser',
149
    'httplib',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
150
    'ic',
151
    'icopen',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
152
    'imageop',
153
    'imaplib',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
154
    'imgfile',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
155
    'imghdr',
156
    'imp',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
157
    'imputil',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
158
    'inspect',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
159
    'io',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
160
    'itertools',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
161
    'jpeg',
162
    'json',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
163
    'keyword',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
164
    'lib2to3',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
165
    'linecache',
166
    'locale',
167
    'logging',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
168
    'macerrors',
169
    'MacOS',
170
    'macostools',
171
    'macpath',
172
    'macresource',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
173
    'mailbox',
174
    'mailcap',
175
    'marshal',
176
    'math',
177
    'md5',
178
    'mhlib',
179
    'mimetools',
180
    'mimetypes',
181
    'MimeWriter',
182
    'mimify',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
183
    'MiniAEFrame',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
184
    'mmap',
185
    'modulefinder',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
186
    'msilib',
187
    'msvcrt',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
188
    'multifile',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
189
    'multiprocessing',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
190
    'mutex',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
191
    'Nav',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
192
    'netrc',
193
    'new',
194
    'nis',
195
    'nntplib',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
196
    'numbers',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
197
    'operator',
198
    'optparse',
199
    'os',
200
    'ossaudiodev',
201
    'parser',
202
    'pdb',
203
    'pickle',
204
    'pickletools',
205
    'pipes',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
206
    'PixMapWrapper',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
207
    'pkgutil',
208
    'platform',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
209
    'plistlib',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
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',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
254
    'ssl',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
255
    'stat',
256
    'statvfs',
257
    'string',
258
    'StringIO',
259
    'stringprep',
260
    'struct',
261
    'subprocess',
262
    'sunau',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
263
    'sunaudiodev',
264
    'SUNAUDIODEV',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
265
    'symbol',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
266
    'symtable',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
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',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
291
    'urllib',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
292
    'urllib2',
293
    'urlparse',
294
    'user',
295
    'UserDict',
296
    'UserList',
297
    'UserString',
298
    'uu',
299
    'uuid',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
300
    'videoreader',
301
    'W',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
302
    'warnings',
303
    'wave',
304
    'weakref',
305
    'webbrowser',
306
    'whichdb',
12855.1.2 by Gavin Panella
Update python_standard_libs.py.
307
    'winsound',
11461.2.1 by Henning Eggers
Added format-imports script and documented it.
308
    'wsgiref',
309
    'xdrlib',
310
    'xml',
311
    'xmlrpclib',
312
    'zipfile',
313
    'zipimport',
314
    'zlib',
315
    ]