summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-02-13 05:11:05 (GMT)
committerFred Drake <fdrake@acm.org>1998-02-13 05:11:05 (GMT)
commitcffaebb621da261009c58ff9e8aa478af5e04ec4 (patch)
treea45a210b40de1c8732f854b810c1ad6c3bcdb5cd /Doc
parentfe82acc3b1cac119ee00037ecaeddca3ac744432 (diff)
downloadcpython-cffaebb621da261009c58ff9e8aa478af5e04ec4.zip
cpython-cffaebb621da261009c58ff9e8aa478af5e04ec4.tar.gz
cpython-cffaebb621da261009c58ff9e8aa478af5e04ec4.tar.bz2
parse_line(): Strip whitespace from the module name.
main(): Include a comma between the module name and page number, to make the generated index more like the "standard" generated index.
Diffstat (limited to 'Doc')
-rwxr-xr-xDoc/modindex.py5
-rwxr-xr-xDoc/tools/modindex.py5
2 files changed, 4 insertions, 6 deletions
diff --git a/Doc/modindex.py b/Doc/modindex.py
index f85b909..84c1066 100755
--- a/Doc/modindex.py
+++ b/Doc/modindex.py
@@ -9,9 +9,8 @@ import sys
def parse_line(input):
lineno = string.split(input)[-1]
- module = input[:len(input)-(len(lineno)+1)]
+ module = string.strip(input[:len(input)-(len(lineno)+1)])
return module, lineno
- return
def cmp_items((s1, line1), (s2, line2)):
@@ -54,7 +53,7 @@ def main():
if string.lower(module[0]) != prev_letter:
ofp.write("\n \\indexspace\n\n")
prev_letter = string.lower(module[0])
- ofp.write(" \\item {\\tt %s} %s\n" % (module, lineno))
+ ofp.write(" \\item {\\tt %s}, %s\n" % (module, lineno))
ofp.write("\n\\end{theindex}\n")
diff --git a/Doc/tools/modindex.py b/Doc/tools/modindex.py
index f85b909..84c1066 100755
--- a/Doc/tools/modindex.py
+++ b/Doc/tools/modindex.py
@@ -9,9 +9,8 @@ import sys
def parse_line(input):
lineno = string.split(input)[-1]
- module = input[:len(input)-(len(lineno)+1)]
+ module = string.strip(input[:len(input)-(len(lineno)+1)])
return module, lineno
- return
def cmp_items((s1, line1), (s2, line2)):
@@ -54,7 +53,7 @@ def main():
if string.lower(module[0]) != prev_letter:
ofp.write("\n \\indexspace\n\n")
prev_letter = string.lower(module[0])
- ofp.write(" \\item {\\tt %s} %s\n" % (module, lineno))
+ ofp.write(" \\item {\\tt %s}, %s\n" % (module, lineno))
ofp.write("\n\\end{theindex}\n")