4 """Generate a page count report of the PostScript version of the manuals."""
6 __version__
= '$Revision$'
15 def add_document(self
, prefix
, title
):
16 count
= count_pages(prefix
+ ".ps")
17 self
.doclist
.append((title
, prefix
, count
))
18 self
.title_width
= max(self
.title_width
, len(title
))
19 self
.total
= self
.total
+ count
22 fmt
= "%%-%ds (%%s.ps, %%d pages)" % self
.title_width
23 for item
in self
.doclist
:
26 print " Total page count: %d" % self
.total
29 for prefix
, title
in [
30 ("api", "Python/C API"),
31 ("ext", "Extending and Embedding the Python Interpreter"),
32 ("lib", "Python Library Reference"),
33 ("mac", "Macintosh Module Reference"),
34 ("ref", "Python Reference Manual"),
35 ("tut", "Python Tutorial"),
36 ("doc", "Documenting Python"),
38 self
.add_document(prefix
, title
)
44 This is the PostScript version of the standard Python documentation.
45 If you plan to print this, be aware that some of the documents are
46 long. The following manuals are included:
51 If you have any questions, comments, or suggestions regarding these
52 documents, please send them via email to python-docs@python.org.
55 def count_pages(filename
):
59 lines
= fp
.readlines(1024*40)
63 if line
[:7] == "%%Page:":
72 if __name__
== "__main__":