source: vendor/python/2.5/Doc/tools/mkackshtml

Last change on this file was 3225, checked in by bird, 18 years ago

Python 2.5

File size: 1.7 KB
Line 
1#! /usr/bin/env python
2# -*- Python -*-
3
4import string
5import support
6import sys
7
8
9def collect(fp):
10 names = []
11 while 1:
12 line = fp.readline()
13 if not line:
14 break
15 line = string.strip(line)
16 if line:
17 names.append(line)
18 else:
19 names = []
20 return names
21
22
23def main():
24 options = support.Options()
25 options.columns = 4
26 options.variables["title"] = "Acknowledgements"
27 options.parse(sys.argv[1:])
28 names = collect(sys.stdin)
29 percol = (len(names) + options.columns - 1) / options.columns
30 colnums = []
31 for i in range(options.columns):
32 colnums.append(percol*i)
33 options.aesop_type = "information"
34 fp = options.get_output_file()
35 fp.write(string.rstrip(options.get_header()) + "\n")
36 fp.write(THANKS + "\n")
37 fp.write('<table width="100%" align="center">\n')
38 for i in range(percol):
39 fp.write(" <tr>\n")
40 for j in colnums:
41 try:
42 fp.write(" <td>%s</td>\n" % names[i + j])
43 except IndexError:
44 pass
45 fp.write(" </tr>\n")
46 fp.write("</table>\n")
47 fp.write(string.rstrip(options.get_footer()) + "\n")
48 fp.close()
49
50THANKS = '''\
51
52<p>These people have contributed in some way to the Python
53documentation. This list is probably not complete -- if you feel that
54you or anyone else should be on this list, please let us know (send
55email to <a
56href="mailto:docs@python.org">docs@python.org</a>), and
57we will be glad to correct the problem.</p>
58
59<p>It is only with the input and contributions of the Python community
60that Python has such wonderful documentation -- <b>Thank You!</b></p>
61
62'''
63
64
65if __name__ == "__main__":
66 main()
Note: See TracBrowser for help on using the repository browser.