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