~allenap/maas/ipmi-power-confusion--bug-1560830

« back to all changes in this revision

Viewing changes to utilities/python_standard_libs.py

  • Committer: Gavin Panella
  • Date: 2012-01-19 10:37:57 UTC
  • mfrom: (16.3.22 test-bling)
  • Revision ID: gavin.panella@canonical.com-20120119103757-surtgos6dn4krulo
[r=rvba] Adds testtools and testresources, templates for new source files, import formatting utility from Launchpad, and fixes some lint.

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
    'argparse',
 
46
    'array',
 
47
    'ast',
 
48
    'asynchat',
 
49
    'asyncore',
 
50
    'atexit',
 
51
    'audioop',
 
52
    'autoGIL',
 
53
    'base64',
 
54
    'BaseHTTPServer',
 
55
    'Bastion',
 
56
    'bdb',
 
57
    'binascii',
 
58
    'binhex',
 
59
    'bisect',
 
60
    'bsddb',
 
61
    'buildtools',
 
62
    'bz2',
 
63
    'calendar',
 
64
    'Carbon',
 
65
    'cd',
 
66
    'cfmfile',
 
67
    'cgi',
 
68
    'CGIHTTPServer',
 
69
    'cgitb',
 
70
    'chunk',
 
71
    'cmath',
 
72
    'cmd',
 
73
    'code',
 
74
    'codecs',
 
75
    'codeop',
 
76
    'collections',
 
77
    'ColorPicker',
 
78
    'colorsys',
 
79
    'commands',
 
80
    'compileall',
 
81
    'compiler',
 
82
    'ConfigParser',
 
83
    'contextlib',
 
84
    'Cookie',
 
85
    'cookielib',
 
86
    'copy',
 
87
    'copy_reg',
 
88
    'cPickle',
 
89
    'cProfile',
 
90
    'crypt',
 
91
    'cStringIO',
 
92
    'csv',
 
93
    'ctypes',
 
94
    'curses',
 
95
    'datetime',
 
96
    'dbhash',
 
97
    'dbm',
 
98
    'decimal',
 
99
    'DEVICE',
 
100
    'difflib',
 
101
    'dircache',
 
102
    'dis',
 
103
    'distutils',
 
104
    'dl',
 
105
    'doctest',
 
106
    'DocXMLRPCServer',
 
107
    'dumbdbm',
 
108
    'dummy_thread',
 
109
    'dummy_threading',
 
110
    'EasyDialogs',
 
111
    'email',
 
112
    'encodings',
 
113
    'errno',
 
114
    'exceptions',
 
115
    'fcntl',
 
116
    'filecmp',
 
117
    'fileinput',
 
118
    'findertools',
 
119
    'FL',
 
120
    'fl',
 
121
    'flp',
 
122
    'fm',
 
123
    'fnmatch',
 
124
    'formatter',
 
125
    'fpectl',
 
126
    'fpformat',
 
127
    'fractions',
 
128
    'FrameWork',
 
129
    'ftplib',
 
130
    'functools',
 
131
    'future_builtins',
 
132
    'gc',
 
133
    'gdbm',
 
134
    'gensuitemodule',
 
135
    'getopt',
 
136
    'getpass',
 
137
    'gettext',
 
138
    'gl',
 
139
    'GL',
 
140
    'glob',
 
141
    'grp',
 
142
    'gzip',
 
143
    'hashlib',
 
144
    'heapq',
 
145
    'hmac',
 
146
    'hotshot',
 
147
    'htmlentitydefs',
 
148
    'htmllib',
 
149
    'HTMLParser',
 
150
    'httplib',
 
151
    'ic',
 
152
    'icopen',
 
153
    'imageop',
 
154
    'imaplib',
 
155
    'imgfile',
 
156
    'imghdr',
 
157
    'imp',
 
158
    'importlib',
 
159
    'imputil',
 
160
    'inspect',
 
161
    'io',
 
162
    'itertools',
 
163
    'jpeg',
 
164
    'json',
 
165
    'keyword',
 
166
    'lib2to3',
 
167
    'linecache',
 
168
    'locale',
 
169
    'logging',
 
170
    'macerrors',
 
171
    'MacOS',
 
172
    'macostools',
 
173
    'macpath',
 
174
    'macresource',
 
175
    'mailbox',
 
176
    'mailcap',
 
177
    'marshal',
 
178
    'math',
 
179
    'md5',
 
180
    'mhlib',
 
181
    'mimetools',
 
182
    'mimetypes',
 
183
    'MimeWriter',
 
184
    'mimify',
 
185
    'MiniAEFrame',
 
186
    'mmap',
 
187
    'modulefinder',
 
188
    'msilib',
 
189
    'msvcrt',
 
190
    'multifile',
 
191
    'multiprocessing',
 
192
    'mutex',
 
193
    'Nav',
 
194
    'netrc',
 
195
    'new',
 
196
    'nis',
 
197
    'nntplib',
 
198
    'numbers',
 
199
    'operator',
 
200
    'optparse',
 
201
    'os',
 
202
    'ossaudiodev',
 
203
    'parser',
 
204
    'pdb',
 
205
    'pickle',
 
206
    'pickletools',
 
207
    'pipes',
 
208
    'PixMapWrapper',
 
209
    'pkgutil',
 
210
    'platform',
 
211
    'plistlib',
 
212
    'popen2',
 
213
    'poplib',
 
214
    'posix',
 
215
    'posixfile',
 
216
    'pprint',
 
217
    'profile',
 
218
    'pstats',
 
219
    'pty',
 
220
    'pwd',
 
221
    'py_compile',
 
222
    'pyclbr',
 
223
    'pydoc',
 
224
    'Queue',
 
225
    'quopri',
 
226
    'random',
 
227
    're',
 
228
    'readline',
 
229
    'repr',
 
230
    'resource',
 
231
    'rexec',
 
232
    'rfc822',
 
233
    'rlcompleter',
 
234
    'robotparser',
 
235
    'runpy',
 
236
    'sched',
 
237
    'ScrolledText',
 
238
    'select',
 
239
    'sets',
 
240
    'sgmllib',
 
241
    'sha',
 
242
    'shelve',
 
243
    'shlex',
 
244
    'shutil',
 
245
    'signal',
 
246
    'SimpleHTTPServer',
 
247
    'SimpleXMLRPCServer',
 
248
    'site',
 
249
    'smtpd',
 
250
    'smtplib',
 
251
    'sndhdr',
 
252
    'socket',
 
253
    'SocketServer',
 
254
    'spwd',
 
255
    'sqlite3',
 
256
    'ssl',
 
257
    'stat',
 
258
    'statvfs',
 
259
    'string',
 
260
    'StringIO',
 
261
    'stringprep',
 
262
    'struct',
 
263
    'subprocess',
 
264
    'sunau',
 
265
    'sunaudiodev',
 
266
    'SUNAUDIODEV',
 
267
    'symbol',
 
268
    'symtable',
 
269
    'sys',
 
270
    'sysconfig',
 
271
    'syslog',
 
272
    'tabnanny',
 
273
    'tarfile',
 
274
    'telnetlib',
 
275
    'tempfile',
 
276
    'termios',
 
277
    'test',
 
278
    'textwrap',
 
279
    'thread',
 
280
    'threading',
 
281
    'time',
 
282
    'timeit',
 
283
    'Tix',
 
284
    'Tkinter',
 
285
    'token',
 
286
    'tokenize',
 
287
    'trace',
 
288
    'traceback',
 
289
    'ttk',
 
290
    'tty',
 
291
    'turtle',
 
292
    'types',
 
293
    'unicodedata',
 
294
    'unittest',
 
295
    'urllib',
 
296
    'urllib2',
 
297
    'urlparse',
 
298
    'user',
 
299
    'UserDict',
 
300
    'UserList',
 
301
    'UserString',
 
302
    'uu',
 
303
    'uuid',
 
304
    'videoreader',
 
305
    'W',
 
306
    'warnings',
 
307
    'wave',
 
308
    'weakref',
 
309
    'webbrowser',
 
310
    'whichdb',
 
311
    'winsound',
 
312
    'wsgiref',
 
313
    'xdrlib',
 
314
    'xml',
 
315
    'xmlrpclib',
 
316
    'zipfile',
 
317
    'zipimport',
 
318
    'zlib',
 
319
    ]