diff options
author | Fred Drake <fdrake@acm.org> | 2001-02-12 19:12:55 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-02-12 19:12:55 (GMT) |
commit | 498cb1530615af3b989e7c1c420346a07911b43a (patch) | |
tree | a04d6ed6e3c207c7e4e3356bbf81b09f0bb1ddef /Doc | |
parent | a05460c148ef88e3a9430427adb660d8c253140d (diff) | |
download | cpython-498cb1530615af3b989e7c1c420346a07911b43a.zip cpython-498cb1530615af3b989e7c1c420346a07911b43a.tar.gz cpython-498cb1530615af3b989e7c1c420346a07911b43a.tar.bz2 |
Jon Nelson <jnelson@users.sourceforge.net>:
Make the documentation tools work with Python 1.5.2.
[Slightly modified from submitted patch. --FLD]
This closes SF bug #132005.
Diffstat (limited to 'Doc')
-rwxr-xr-x | Doc/tools/mkackshtml | 27 | ||||
-rwxr-xr-x | Doc/tools/mkmodindex | 4 |
2 files changed, 17 insertions, 14 deletions
diff --git a/Doc/tools/mkackshtml b/Doc/tools/mkackshtml index 36f4d2a..917b303 100755 --- a/Doc/tools/mkackshtml +++ b/Doc/tools/mkackshtml @@ -1,6 +1,7 @@ #! /usr/bin/env python # -*- Python -*- +import string import support import sys @@ -11,7 +12,7 @@ def collect(fp): line = fp.readline() if not line: break - line = line.strip() + line = string.strip(line) if line: names.append(line) else: @@ -26,22 +27,24 @@ def main(): options.parse(sys.argv[1:]) names = collect(sys.stdin) percol = (len(names) + options.columns - 1) / options.columns - colnums = [percol*i for i in range(options.columns)] + colnums = [] + for i in range(options.columns): + colnums.append(percol*i) fp = options.get_output_file() - print >>fp, options.get_header().rstrip() - print >>fp, THANKS - print >>fp, '<table width="100%" align="center">' + fp.write(string.rstrip(options.get_header()) + "\n") + fp.write(THANKS + "\n") + fp.write('<table width="100%" align="center">\n') for i in range(percol): - print >>fp, " <tr>" + fp.write(" <tr>\n") for j in colnums: try: - print >>fp, " <td>%s</td>" % names[i + j] + fp.write(" <td>%s</td>\n" % names[i + j]) except IndexError: - print >>fp, " <td> </td>" - print >>fp, " </tr>" - print >>fp, "</table>" - print >>fp, options.get_footer().rstrip() - + pass + fp.write(" </tr>\n") + fp.write("</table>\n") + fp.write(string.rstrip(options.get_footer()) + "\n") + fp.close() THANKS = '''\ diff --git a/Doc/tools/mkmodindex b/Doc/tools/mkmodindex index b0211a7..5f2da0e 100755 --- a/Doc/tools/mkmodindex +++ b/Doc/tools/mkmodindex @@ -52,8 +52,8 @@ class Node(buildindex.Node): annotation = "" def __init__(self, link, str, seqno): - parts = str.split(None, 1) - if parts[0].endswith("</tt>"): + parts = string.split(str, None, 1) + if parts[0][-5:] == "</tt>": self.modname = parts[0][:-5] else: self.modname = parts[0] |