summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-04-20 02:37:07 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-04-20 02:37:07 (GMT)
commit460643b8c500bf3edad5d4287884bbb66e2423f3 (patch)
treead6f866a88407dde3aa9388e2609fe421eb3e6b3 /Doc
parent5d5e1930ddd7506739d5ebec1b23c8a53f23369d (diff)
downloadcpython-460643b8c500bf3edad5d4287884bbb66e2423f3.zip
cpython-460643b8c500bf3edad5d4287884bbb66e2423f3.tar.gz
cpython-460643b8c500bf3edad5d4287884bbb66e2423f3.tar.bz2
do_project(): Modernized the code.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/tools/prechm.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/Doc/tools/prechm.py b/Doc/tools/prechm.py
index 0651549..b2f5d8c 100644
--- a/Doc/tools/prechm.py
+++ b/Doc/tools/prechm.py
@@ -301,14 +301,17 @@ def do_content(library, version, output) :
content(book[0], book[3], output)
output.write(contents_footer)
-
-def do_project( library, output, arch, version) :
+# Fill in the [FILES] section of the project (.hhp) file.
+# 'library' is the list of directory description tuples from
+# supported_libraries for the version of the docs getting generated.
+def do_project(library, output, arch, version):
output.write(project_template % locals())
- for book in library :
- for page in os.listdir(book[0]) :
- if page[string.rfind(page, '.'):] == '.html' or \
- page[string.rfind(page, '.'):] == '.css':
- output.write(book[0]+ '\\' + page + '\n')
+ for book in library:
+ directory = book[0]
+ path = directory + '\\%s\n'
+ for page in os.listdir(directory):
+ if page.endswith('.html') or page.endswith('.css'):
+ output.write(path % page)
def openfile(file) :
@@ -385,5 +388,3 @@ def do_it(args = None) :
if __name__ == '__main__' :
do_it()
-
-