File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /usr/bin/env python
22# -*- Python -*-
33
4+ import string
45import support
56import 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> </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
4649THANKS = '''\
4750
Original file line number Diff line number Diff 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 ]
You can’t perform that action at this time.
0 commit comments