Remove Emacs turd; not needed with modern Emacs versions.

Add a -r option; if given with a release number, the "What's New" document
is included with the relevant version number.

Update the text of the README distributed with the PostScript files to
reflect the changes in the user organizations in the Python community.
This commit is contained in:
Fred Drake 2002-04-17 03:29:40 +00:00
parent 1f6794622b
commit bab5aa0039

View file

@ -1,16 +1,19 @@
#! /usr/bin/env python #! /usr/bin/env python
# -*- Python -*-
"""Generate a page count report of the PostScript version of the manuals.""" """Generate a page count report of the PostScript version of the manuals."""
__version__ = '$Revision$' __version__ = '$Revision$'
import getopt
import sys
class PageCounter: class PageCounter:
def __init__(self): def __init__(self):
self.doclist = [] self.doclist = []
self.total = 0 self.total = 0
self.title_width = 0 self.title_width = 0
self.version = ""
def add_document(self, prefix, title): def add_document(self, prefix, title):
count = count_pages(prefix + ".ps") count = count_pages(prefix + ".ps")
@ -25,7 +28,19 @@ class PageCounter:
print print
print " Total page count: %d" % self.total print " Total page count: %d" % self.total
def parse_options(self):
opts, args = getopt.getopt(sys.argv[1:], "r:", ["release="])
assert not args
for opt, arg in opts:
if opt in ("-r", "--release"):
self.version = arg
def run(self): def run(self):
self.parse_options()
if self.version:
version = self.version[:3]
self.add_document("whatsnew" + version.replace(".", ""),
"What's New in Python " + version)
for prefix, title in [ for prefix, title in [
("api", "Python/C API"), ("api", "Python/C API"),
("ext", "Extending and Embedding the Python Interpreter"), ("ext", "Extending and Embedding the Python Interpreter"),
@ -48,23 +63,17 @@ If you plan to print this, be aware that some of the documents are
long. It is formatted for printing on two-sided paper; if you do plan long. It is formatted for printing on two-sided paper; if you do plan
to print this, *please* print two-sided if you have a printer capable to print this, *please* print two-sided if you have a printer capable
of it! To locate published copies of the larger manuals, or other of it! To locate published copies of the larger manuals, or other
Python reference material, consult the PSA Online Bookstore at: Python reference material, consult the Python Bookstore at:
http://www.python.org/psa/bookstore/ http://www.amk.ca/bookstore/
The following manuals are included: The following manuals are included in this package:
""" """
SUFFIX = """\ SUFFIX = """\
If you have any questions, comments, or suggestions regarding these If you have any questions, comments, or suggestions regarding these
documents, please send them via email to python-docs@python.org. documents, please send them via email to python-docs@python.org.
If you would like to support the development and maintenance of
documentation for Python, please consider joining the Python Software
Activity (PSA; see http://www.python.org/psa/), or urging your
organization to join the PSA or the Python Consortium (see
http://www.python.org/consortium/).
""" """
def count_pages(filename): def count_pages(filename):