mkackshtml 1.7 KB
Newer Older
1 2 3
#! /usr/bin/env python
#  -*- Python -*-

4
import string
5 6 7 8 9 10 11 12 13 14
import support
import sys


def collect(fp):
    names = []
    while 1:
        line = fp.readline()
        if not line:
            break
15
        line = string.strip(line)
16 17 18 19 20 21 22 23 24 25 26 27 28 29
        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
30 31 32
    colnums = []
    for i in range(options.columns):
        colnums.append(percol*i)
33
    options.aesop_type = "information"
34
    fp = options.get_output_file()
35 36 37
    fp.write(string.rstrip(options.get_header()) + "\n")
    fp.write(THANKS + "\n")
    fp.write('<table width="100%" align="center">\n')
38
    for i in range(percol):
39
        fp.write("  <tr>\n")
40 41
        for j in colnums:
            try:
42
                fp.write("    <td>%s</td>\n" % names[i + j])
43
            except IndexError:
44 45 46 47 48
                pass
        fp.write("  </tr>\n")
    fp.write("</table>\n")
    fp.write(string.rstrip(options.get_footer()) + "\n")
    fp.close()
49 50 51 52 53 54 55

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
56
href="mailto:docs@python.org">docs@python.org</a>), and
57 58 59 60 61 62 63 64 65 66
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()