~exarkun/pyopenssl/trunk

« back to all changes in this revision

Viewing changes to doc/tools/mkackshtml

  • Committer: Jean-Paul Calderone
  • Date: 2011-09-11 19:49:43 UTC
  • mfrom: (156.3.22 sphinx-doc)
  • Revision ID: exarkun@divmod.com-20110911194943-ucaan2tzidk7ek5l
Convert the documentation from LaTeX/epytext to Sphinx/ReST

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/env python
2
 
#  -*- Python -*-
3
 
 
4
 
import string
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
15
 
        line = string.strip(line)
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
30
 
    colnums = []
31
 
    for i in range(options.columns):
32
 
        colnums.append(percol*i)
33
 
    fp = options.get_output_file()
34
 
    fp.write(string.rstrip(options.get_header()) + "\n")
35
 
    fp.write(THANKS + "\n")
36
 
    fp.write('<table width="100%" align="center">\n')
37
 
    for i in range(percol):
38
 
        fp.write("  <tr>\n")
39
 
        for j in colnums:
40
 
            try:
41
 
                fp.write("    <td>%s</td>\n" % names[i + j])
42
 
            except IndexError:
43
 
                pass
44
 
        fp.write("  </tr>\n")
45
 
    fp.write("</table>\n")
46
 
    fp.write(string.rstrip(options.get_footer()) + "\n")
47
 
    fp.close()
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
55
 
href="mailto:python-docs@python.org">python-docs@python.org</a>), and
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()