1 # -*- coding: utf-8 -*-
3 Map LaTeX filenames to ReST filenames
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 :copyright: 2007 by Georg Brandl.
7 :license: Python license.
10 # '' means: use same name, strip prefix if applicable.
11 # None means: don't translate at all.
15 '__newname__' : 'modules',
21 'emailcharsets': 'email.charset',
22 'emailencoders': 'email.encoders',
23 'emailexc': 'email.errors',
24 'emailgenerator': 'email.generator',
25 'emailheaders': 'email.header',
26 'emailiter': 'email.iterators',
27 'emailmessage': 'email.message',
28 'emailmimebase': 'email.mime',
29 'emailparser': 'email.parser',
30 'emailutil': 'email.util',
34 'libascii': 'curses.ascii',
41 'libbasehttp': 'basehttpserver',
46 'libbltin': '__builtin__',
50 'libcfgparser': 'configparser',
51 'libcgihttp': 'cgihttpserver',
67 'libcopyreg': 'copy_reg',
72 'libcursespanel': 'curses.panel',
83 'libdocxmlrpc': 'docxmlrpcserver',
85 'libdummythreading': 'dummy_threading',
86 'libdummythread': 'dummy_thread',
88 'libetree': 'xml.etree.elementtree',
98 'libfuture': '__future__',
128 'libmain': '__main__',
138 'libmodulefinder': '',
150 'libossaudiodev': '',
154 'libpickletools': '',
160 'libposixpath': 'os.path',
167 'libpycompile': 'py_compile',
179 'librlcompleter': '',
180 'librobotparser': '',
191 'libsimplehttp': 'simplehttpserver',
192 'libsimplexmlrpc': 'simplexmlrpcserver',
198 'libsocksvr': 'socketserver',
231 'libunicodedata': '',
245 'libwinreg': '_winreg',
255 'xmldomminidom': 'xml.dom.minidom',
256 'xmldompulldom': 'xml.dom.pulldom',
258 'xmletree': 'xml.etree',
259 'xmlsaxhandler': 'xml.sax.handler',
260 'xmlsaxreader': 'xml.sax.reader',
262 'xmlsaxutils': 'xml.sax.utils',
275 'libconsts': 'reference/consts',
276 'libexcs': 'reference/exceptions',
277 'libfuncs': 'reference/functions',
278 'libobjs': 'reference/objects',
279 'libstdtypes': 'reference/stdtypes',
322 '__newname__': 'reference',
324 'ref1': 'introduction',
325 'ref2': 'lexical_analysis',
327 'ref4': 'executionmodel',
328 'ref5': 'expressions',
329 'ref6': 'simple_stmts',
330 'ref7': 'compound_stmts',
331 'ref8': 'toplevel_components',
335 '__newname__': 'tutorial',
336 '__labelprefix__': 'tut-',
337 'tut': 'tutorial:split',
338 'glossary': 'glossary',
342 '__newname__': 'c-api',
343 '__defaulthighlightlang__': 'c',
359 '__newname__': 'extending',
360 '__defaulthighlightlang__': 'c',
365 'extending': 'extending',
371 '__newname__': 'distutils',
372 'dist': 'distutils:split',
377 '__newname__': 'macmodules',
380 'libaepack': 'aepack',
381 'libaetools': 'aetools',
382 'libaetypes': 'aetypes',
383 'libautogil': 'autogil',
384 'libcolorpicker': 'colorpicker',
385 'libframework': 'framework',
386 'libgensuitemodule': 'gensuitemodule',
389 'libmacostools': 'macostools',
392 'libminiae': 'miniae',
402 '__newname__': 'install',
403 '__defaulthighlightlang__': 'none',
408 '__newname__': 'whatsnew',
424 'reportingbugs': 'bugs',
430 for dir, files
in _mapping
.iteritems():
431 newmap
= fn_mapping
[dir] = {}
433 if not fn
.startswith('_') and files
[fn
] == '':
434 if fn
.startswith(dir):
435 newmap
[fn
] = fn
[len(dir):]
439 newmap
[fn
] = files
[fn
]
442 # new directories to create
459 # includefiles for \verbatiminput and \input
461 '../../Parser/Python.asdl': None, # XXX
462 '../../Lib/test/exception_hierarchy.txt': None,
463 'emailmessage': 'email.message.rst',
464 'emailparser': 'email.parser.rst',
465 'emailgenerator': 'email.generator.rst',
466 'emailmimebase': 'email.mime.rst',
467 'emailheaders': 'email.header.rst',
468 'emailcharsets': 'email.charset.rst',
469 'emailencoders': 'email.encoders.rst',
470 'emailexc': 'email.errors.rst',
471 'emailutil': 'email.util.rst',
472 'emailiter': 'email.iterators.rst',
475 # new files to copy from converter/newfiles
477 'conf.py': 'conf.py',
480 'ref_index.rst': 'reference/index.rst',
481 'tutorial_index.rst': 'tutorial/index.rst',
482 'modules_index.rst': 'modules/index.rst',
483 'mac_index.rst': 'macmodules/index.rst',
484 'ext_index.rst': 'extending/index.rst',
485 'api_index.rst': 'c-api/index.rst',
486 'dist_index.rst': 'distutils/index.rst',
487 'contents.rst': 'contents.rst',
488 'about.rst': 'about.rst',
490 'doc.rst': 'documenting/index.rst',
491 'doc_intro.rst': 'documenting/intro.rst',
492 'doc_style.rst': 'documenting/style.rst',
493 'doc_sphinx.rst': 'documenting/sphinx.rst',
494 'doc_rest.rst': 'documenting/rest.rst',
495 'doc_markup.rst': 'documenting/markup.rst',
498 # copy files from the old doc tree
499 copyfiles_mapping
= {
500 'api/refcounts.dat': 'data',
501 'lib/email-*.py': 'includes',
502 'lib/minidom-example.py': 'includes',
503 'lib/tzinfo-examples.py': 'includes',
504 'lib/sqlite3/*.py': 'includes/sqlite3',
505 'ext/*.c': 'includes',
506 'ext/*.py': 'includes',
507 'commontex/typestruct.h': 'includes',
512 'tutorial/1_tutorial.rst': None, # delete
513 'tutorial/2_tutorial.rst': 'tutorial/appetite.rst',
514 'tutorial/3_tutorial.rst': 'tutorial/interpreter.rst',
515 'tutorial/4_tutorial.rst': 'tutorial/introduction.rst',
516 'tutorial/5_tutorial.rst': 'tutorial/controlflow.rst',
517 'tutorial/6_tutorial.rst': 'tutorial/datastructures.rst',
518 'tutorial/7_tutorial.rst': 'tutorial/modules.rst',
519 'tutorial/8_tutorial.rst': 'tutorial/inputoutput.rst',
520 'tutorial/9_tutorial.rst': 'tutorial/errors.rst',
521 'tutorial/10_tutorial.rst': 'tutorial/classes.rst',
522 'tutorial/11_tutorial.rst': 'tutorial/stdlib.rst',
523 'tutorial/12_tutorial.rst': 'tutorial/stdlib2.rst',
524 'tutorial/13_tutorial.rst': 'tutorial/whatnow.rst',
525 'tutorial/14_tutorial.rst': 'tutorial/interactive.rst',
526 'tutorial/15_tutorial.rst': 'tutorial/floatingpoint.rst',
527 'tutorial/16_tutorial.rst': None, # delete
529 'distutils/1_distutils.rst': 'distutils/introduction.rst',
530 'distutils/2_distutils.rst': 'distutils/setupscript.rst',
531 'distutils/3_distutils.rst': 'distutils/configfile.rst',
532 'distutils/4_distutils.rst': 'distutils/sourcedist.rst',
533 'distutils/5_distutils.rst': 'distutils/builtdist.rst',
534 'distutils/6_distutils.rst': 'distutils/packageindex.rst',
535 'distutils/7_distutils.rst': 'distutils/uploading.rst',
536 'distutils/8_distutils.rst': 'distutils/examples.rst',
537 'distutils/9_distutils.rst': 'distutils/extending.rst',
538 'distutils/10_distutils.rst': 'distutils/commandref.rst',
539 'distutils/11_distutils.rst': 'distutils/apiref.rst',
544 'mac/scripting': ['gensuitemodule', 'aetools', 'aepack', 'aetypes', 'miniae'],
545 'mac/toolbox': ['colorpicker'],
546 'lib/libstrings': ['string', 're', 'struct', 'difflib', 'stringio', 'textwrap',
547 'codecs', 'unicodedata', 'stringprep', 'fpformat'],
548 'lib/datatypes': ['datetime', 'calendar', 'collections', 'heapq', 'bisect',
549 'array', 'sets', 'sched', 'mutex', 'queue', 'weakref',
550 'userdict', 'types', 'new', 'copy', 'pprint', 'repr'],
551 'lib/numeric': ['math', 'cmath', 'decimal', 'random', 'itertools', 'functools',
553 'lib/netdata': ['email', 'mailcap', 'mailbox', 'mhlib', 'mimetools', 'mimetypes',
554 'mimewriter', 'mimify', 'multifile', 'rfc822',
555 'base64', 'binhex', 'binascii', 'quopri', 'uu'],
556 'lib/markup': ['htmlparser', 'sgmllib', 'htmllib', 'pyexpat', 'xml.dom',
557 'xml.dom.minidom', 'xml.dom.pulldom', 'xml.sax', 'xml.sax.handler',
558 'xml.sax.utils', 'xml.sax.reader', 'xml.etree.elementtree'],
559 'lib/fileformats': ['csv', 'configparser', 'robotparser', 'netrc', 'xdrlib'],
560 'lib/libcrypto': ['hashlib', 'hmac', 'md5', 'sha'],
561 'lib/filesys': ['os.path', 'fileinput', 'stat', 'statvfs', 'filecmp',
562 'tempfile', 'glob', 'fnmatch', 'linecache', 'shutil', 'dircache'],
563 'lib/archiving': ['zlib', 'gzip', 'bz2', 'zipfile', 'tarfile'],
564 'lib/persistence': ['pickle', 'copy_reg', 'shelve', 'marshal', 'anydbm',
565 'whichdb', 'dbm', 'gdbm', 'dbhash', 'bsddb', 'dumbdbm',
567 'lib/liballos': ['os', 'time', 'optparse', 'getopt', 'logging', 'getpass',
568 'curses', 'curses.ascii', 'curses.panel', 'platform',
570 'lib/libsomeos': ['select', 'thread', 'threading', 'dummy_thread', 'dummy_threading',
571 'mmap', 'readline', 'rlcompleter'],
572 'lib/libunix': ['posix', 'pwd', 'spwd', 'grp', 'crypt', 'dl', 'termios', 'tty',
573 'pty', 'fcntl', 'pipes', 'posixfile', 'resource', 'nis',
574 'syslog', 'commands'],
575 'lib/ipc': ['subprocess', 'socket', 'signal', 'popen2', 'asyncore', 'asynchat'],
576 'lib/internet': ['webbrowser', 'cgi', 'cgitb', 'wsgiref', 'urllib', 'urllib2',
577 'httplib', 'ftplib', 'poplib', 'imaplib',
578 'nntplib', 'smtplib', 'smtpd', 'telnetlib', 'uuid', 'urlparse',
579 'socketserver', 'basehttpserver', 'simplehttpserver',
580 'cgihttpserver', 'cookielib', 'cookie', 'xmlrpclib',
581 'simplexmlrpcserver', 'docxmlrpcserver'],
582 'lib/libmm': ['audioop', 'imageop', 'aifc', 'sunau', 'wave', 'chunk',
583 'colorsys', 'imghdr', 'sndhdr', 'ossaudiodev'],
584 'lib/i18n': ['gettext', 'locale'],
585 'lib/frameworks': ['cmd', 'shlex'],
586 'lib/development': ['pydoc', 'doctest', 'unittest', 'test'],
587 'lib/libpython': ['sys', '__builtin__', '__main__', 'warnings', 'contextlib',
588 'atexit', 'traceback', '__future__', 'gc', 'inspect',
589 'site', 'user', 'fpectl'],
590 'lib/custominterp': ['code', 'codeop'],
591 'lib/librestricted': ['rexec', 'bastion'],
592 'lib/modules': ['imp', 'zipimport', 'pkgutil', 'modulefinder', 'runpy'],
593 'lib/language': ['parser', 'symbol', 'token', 'keyword', 'tokenize',
594 'tabnanny', 'pyclbr', 'py_compile', 'compileall', 'dis',
595 'pickletools', 'distutils'],
596 'lib/compiler': ['ast'],
597 'lib/libmisc': ['formatter'],
598 'lib/libsgi': ['al', 'cd', 'fl', 'fm', 'gl', 'imgfile', 'jpeg'],
599 'lib/libsun': ['sunaudio'],
600 'lib/windows': ['msilib', 'msvcrt', '_winreg', 'winsound'],
603 # map sourcefilename to [pre, post]
604 amendments_mapping
= {
606 .. highlightlang:: none
621 'copyright.rst': ['''\
628 'install/index.rst': ['''\