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