Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 498cb15

Browse files
committed
Jon Nelson <[email protected]>:
Make the documentation tools work with Python 1.5.2. [Slightly modified from submitted patch. --FLD] This closes SF bug #132005.
1 parent a05460c commit 498cb15

2 files changed

Lines changed: 17 additions & 14 deletions

File tree

Doc/tools/mkackshtml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#! /usr/bin/env python
22
# -*- Python -*-
33

4+
import string
45
import support
56
import sys
67

@@ -11,7 +12,7 @@ def collect(fp):
1112
line = fp.readline()
1213
if not line:
1314
break
14-
line = line.strip()
15+
line = string.strip(line)
1516
if line:
1617
names.append(line)
1718
else:
@@ -26,22 +27,24 @@ def main():
2627
options.parse(sys.argv[1:])
2728
names = collect(sys.stdin)
2829
percol = (len(names) + options.columns - 1) / options.columns
29-
colnums = [percol*i for i in range(options.columns)]
30+
colnums = []
31+
for i in range(options.columns):
32+
colnums.append(percol*i)
3033
fp = options.get_output_file()
31-
print >>fp, options.get_header().rstrip()
32-
print >>fp, THANKS
33-
print >>fp, '<table width="100%" align="center">'
34+
fp.write(string.rstrip(options.get_header()) + "\n")
35+
fp.write(THANKS + "\n")
36+
fp.write('<table width="100%" align="center">\n')
3437
for i in range(percol):
35-
print >>fp, " <tr>"
38+
fp.write(" <tr>\n")
3639
for j in colnums:
3740
try:
38-
print >>fp, " <td>%s</td>" % names[i + j]
41+
fp.write(" <td>%s</td>\n" % names[i + j])
3942
except IndexError:
40-
print >>fp, " <td>&nbsp;</td>"
41-
print >>fp, " </tr>"
42-
print >>fp, "</table>"
43-
print >>fp, options.get_footer().rstrip()
44-
43+
pass
44+
fp.write(" </tr>\n")
45+
fp.write("</table>\n")
46+
fp.write(string.rstrip(options.get_footer()) + "\n")
47+
fp.close()
4548

4649
THANKS = '''\
4750

Doc/tools/mkmodindex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ class Node(buildindex.Node):
5252
annotation = ""
5353

5454
def __init__(self, link, str, seqno):
55-
parts = str.split(None, 1)
56-
if parts[0].endswith("</tt>"):
55+
parts = string.split(str, None, 1)
56+
if parts[0][-5:] == "</tt>":
5757
self.modname = parts[0][:-5]
5858
else:
5959
self.modname = parts[0]

0 commit comments

Comments
 (0)