| 
									
										
										
										
											2000-10-05 05:15:29 +00:00
										 |  |  | #! /usr/bin/env python | 
					
						
							|  |  |  | #  -*- Python -*- | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-02-12 19:12:55 +00:00
										 |  |  | import string | 
					
						
							| 
									
										
										
										
											2000-10-05 05:15:29 +00:00
										 |  |  | import support | 
					
						
							|  |  |  | import sys | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def collect(fp): | 
					
						
							|  |  |  |     names = [] | 
					
						
							|  |  |  |     while 1: | 
					
						
							|  |  |  |         line = fp.readline() | 
					
						
							|  |  |  |         if not line: | 
					
						
							|  |  |  |             break | 
					
						
							| 
									
										
										
										
											2001-02-12 19:12:55 +00:00
										 |  |  |         line = string.strip(line) | 
					
						
							| 
									
										
										
										
											2000-10-05 05:15:29 +00:00
										 |  |  |         if line: | 
					
						
							|  |  |  |             names.append(line) | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             names = [] | 
					
						
							|  |  |  |     return names | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def main(): | 
					
						
							|  |  |  |     options = support.Options() | 
					
						
							|  |  |  |     options.columns = 4 | 
					
						
							|  |  |  |     options.variables["title"] = "Acknowledgements" | 
					
						
							|  |  |  |     options.parse(sys.argv[1:]) | 
					
						
							|  |  |  |     names = collect(sys.stdin) | 
					
						
							|  |  |  |     percol = (len(names) + options.columns - 1) / options.columns | 
					
						
							| 
									
										
										
										
											2001-02-12 19:12:55 +00:00
										 |  |  |     colnums = [] | 
					
						
							|  |  |  |     for i in range(options.columns): | 
					
						
							|  |  |  |         colnums.append(percol*i) | 
					
						
							| 
									
										
										
										
											2002-04-05 17:34:50 +00:00
										 |  |  |     options.aesop_type = "information" | 
					
						
							| 
									
										
										
										
											2000-10-05 05:15:29 +00:00
										 |  |  |     fp = options.get_output_file() | 
					
						
							| 
									
										
										
										
											2001-02-12 19:12:55 +00:00
										 |  |  |     fp.write(string.rstrip(options.get_header()) + "\n") | 
					
						
							|  |  |  |     fp.write(THANKS + "\n") | 
					
						
							|  |  |  |     fp.write('<table width="100%" align="center">\n') | 
					
						
							| 
									
										
										
										
											2000-10-05 05:15:29 +00:00
										 |  |  |     for i in range(percol): | 
					
						
							| 
									
										
										
										
											2001-02-12 19:12:55 +00:00
										 |  |  |         fp.write("  <tr>\n") | 
					
						
							| 
									
										
										
										
											2000-10-05 05:15:29 +00:00
										 |  |  |         for j in colnums: | 
					
						
							|  |  |  |             try: | 
					
						
							| 
									
										
										
										
											2001-02-12 19:12:55 +00:00
										 |  |  |                 fp.write("    <td>%s</td>\n" % names[i + j]) | 
					
						
							| 
									
										
										
										
											2000-10-05 05:15:29 +00:00
										 |  |  |             except IndexError: | 
					
						
							| 
									
										
										
										
											2001-02-12 19:12:55 +00:00
										 |  |  |                 pass | 
					
						
							|  |  |  |         fp.write("  </tr>\n") | 
					
						
							|  |  |  |     fp.write("</table>\n") | 
					
						
							|  |  |  |     fp.write(string.rstrip(options.get_footer()) + "\n") | 
					
						
							|  |  |  |     fp.close() | 
					
						
							| 
									
										
										
										
											2000-10-05 05:15:29 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | THANKS = '''\ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <p>These people have contributed in some way to the Python | 
					
						
							|  |  |  | documentation.  This list is probably not complete -- if you feel that | 
					
						
							|  |  |  | you or anyone else should be on this list, please let us know (send | 
					
						
							|  |  |  | email to <a | 
					
						
							|  |  |  | href="mailto:python-docs@python.org">python-docs@python.org</a>), and | 
					
						
							|  |  |  | we will be glad to correct the problem.</p> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <p>It is only with the input and contributions of the Python community | 
					
						
							|  |  |  | that Python has such wonderful documentation -- <b>Thank You!</b></p> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ''' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if __name__ == "__main__": | 
					
						
							|  |  |  |     main() |