mirror of https://github.com/python/cpython.git
project_template: use dict interpolation instead of giant tuples.
This commit is contained in:
parent
a905363ce5
commit
e6b63e685b
|
@ -22,10 +22,6 @@
|
||||||
import string
|
import string
|
||||||
import getopt
|
import getopt
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# moved all the triple_quote up here because my syntax-coloring editor
|
|
||||||
# sucks a little bit.
|
|
||||||
usage_mode = '''
|
usage_mode = '''
|
||||||
Usage: make_chm.py [-c] [-k] [-p] [-v 1.5[.x]] filename
|
Usage: make_chm.py [-c] [-k] [-p] [-v 1.5[.x]] filename
|
||||||
-c: does not build filename.hhc (Table of Contents)
|
-c: does not build filename.hhc (Table of Contents)
|
||||||
|
@ -35,23 +31,27 @@
|
||||||
(default is python 1.5.2 docs)
|
(default is python 1.5.2 docs)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
# project file (*.hhp) template. there are seven %s
|
# Project file (*.hhp) template. 'arch' is the file basename (like
|
||||||
|
# the pythlp in pythlp.hhp); 'version' is the doc version number (like
|
||||||
|
# the 2.2 in Python 2.2).
|
||||||
|
# The magical numbers in the long line under [WINDOWS] set most of the
|
||||||
|
# user-visible features (visible buttons, tabs, etc).
|
||||||
project_template = '''
|
project_template = '''
|
||||||
[OPTIONS]
|
[OPTIONS]
|
||||||
Compatibility=1.1
|
Compatibility=1.1
|
||||||
Compiled file=%s.chm
|
Compiled file=%(arch)s.chm
|
||||||
Contents file=%s.hhc
|
Contents file=%(arch)s.hhc
|
||||||
Default Window=%s
|
Default Window=%(arch)s
|
||||||
Default topic=index.html
|
Default topic=index.html
|
||||||
Display compile progress=No
|
Display compile progress=No
|
||||||
Full-text search=Yes
|
Full-text search=Yes
|
||||||
Index file=%s.hhk
|
Index file=%(arch)s.hhk
|
||||||
Language=0x409
|
Language=0x409
|
||||||
Title=Python %s Documentation
|
Title=Python %(version)s Documentation
|
||||||
|
|
||||||
[WINDOWS]
|
[WINDOWS]
|
||||||
%s="Python %s Documentation","%s.hhc","%s.hhk","index.html","index.html",\
|
%(arch)s="Python %(version)s Documentation","%(arch)s.hhc","%(arch)s.hhk",\
|
||||||
,,,,0x63520,220,0x384e,[271,372,740,718],,,,,,,0
|
"index.html","index.html",,,,,0x63520,220,0x384e,[271,372,740,718],,,,,,,0
|
||||||
|
|
||||||
[FILES]
|
[FILES]
|
||||||
'''
|
'''
|
||||||
|
@ -285,8 +285,7 @@ def do_content(library, version, output) :
|
||||||
|
|
||||||
|
|
||||||
def do_project( library, output, arch, version) :
|
def do_project( library, output, arch, version) :
|
||||||
output.write( project_template % \
|
output.write(project_template % locals())
|
||||||
(arch, arch, arch, arch, version, arch, version, arch, arch) )
|
|
||||||
for book in library :
|
for book in library :
|
||||||
for page in os.listdir(book[0]) :
|
for page in os.listdir(book[0]) :
|
||||||
if page[string.rfind(page, '.'):] == '.html' or \
|
if page[string.rfind(page, '.'):] == '.html' or \
|
||||||
|
|
Loading…
Reference in New Issue