1
# Copyright 2010 Canonical Ltd. This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
4
""" A list of top-level standard python library names.
6
This list is used by format-imports to determine if a module is in this group
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.
14
# Run this to generate a new module list.
15
if __name__ == '__main__':
17
from sys import version_info, stdout
19
"http://docs.python.org/release/"
20
"{0}.{1}.{2}/modindex.html").format(*version_info)
21
root = html.parse(modindex_url).getroot()
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)
31
python_standard_libs = [
247
'SimpleXMLRPCServer',