mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Jon Nelson <jnelson@users.sourceforge.net>:
Make the documentation tools compatibile with Python 2.0.
This commit is contained in:
parent
90f22fee6b
commit
b258bedb13
3 changed files with 9 additions and 8 deletions
|
|
@ -297,7 +297,7 @@ class Job:
|
||||||
# let the doctype-specific handler do some intermediate work:
|
# let the doctype-specific handler do some intermediate work:
|
||||||
#
|
#
|
||||||
self.run("%s %s" % (binary, self.doc))
|
self.run("%s %s" % (binary, self.doc))
|
||||||
self.latex_runs += 1
|
self.latex_runs = self.latex_runs + 1
|
||||||
if os.path.isfile("mod%s.idx" % self.doc):
|
if os.path.isfile("mod%s.idx" % self.doc):
|
||||||
self.run("%s -s %s mod%s.idx"
|
self.run("%s -s %s mod%s.idx"
|
||||||
% (MAKEINDEX_BINARY, ISTFILE, self.doc))
|
% (MAKEINDEX_BINARY, ISTFILE, self.doc))
|
||||||
|
|
@ -319,7 +319,7 @@ class Job:
|
||||||
if self.use_bibtex:
|
if self.use_bibtex:
|
||||||
self.run("%s %s" % (BIBTEX_BINARY, self.doc))
|
self.run("%s %s" % (BIBTEX_BINARY, self.doc))
|
||||||
self.run("%s %s" % (binary, self.doc))
|
self.run("%s %s" % (binary, self.doc))
|
||||||
self.latex_runs += 1
|
self.latex_runs = self.latex_runs + 1
|
||||||
|
|
||||||
def process_synopsis_files(self):
|
def process_synopsis_files(self):
|
||||||
synopsis_files = glob.glob(self.doc + "*.syn")
|
synopsis_files = glob.glob(self.doc + "*.syn")
|
||||||
|
|
|
||||||
|
|
@ -117,9 +117,9 @@ def main():
|
||||||
html = string.join(parts, '')
|
html = string.join(parts, '')
|
||||||
program = os.path.basename(sys.argv[0])
|
program = os.path.basename(sys.argv[0])
|
||||||
fp = options.get_output_file()
|
fp = options.get_output_file()
|
||||||
print >>fp, html.rstrip()
|
fp.write(string.rstrip(html) + "\n")
|
||||||
if options.outputfile == "-":
|
if options.outputfile == "-":
|
||||||
print >>sys.stderr, "%s: %d index nodes" % (program, num_nodes)
|
sys.stderr.write("%s: %d index nodes\n" % (program, num_nodes))
|
||||||
else:
|
else:
|
||||||
print
|
print
|
||||||
print "%s: %d index nodes" % (program, num_nodes)
|
print "%s: %d index nodes" % (program, num_nodes)
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ __version__ = '$Revision$'
|
||||||
|
|
||||||
|
|
||||||
import getopt
|
import getopt
|
||||||
|
import string
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -37,9 +38,9 @@ class Options:
|
||||||
|
|
||||||
def add_args(self, short=None, long=None):
|
def add_args(self, short=None, long=None):
|
||||||
if short:
|
if short:
|
||||||
self.__short_args += short
|
self.__short_args = self.__short_args + short
|
||||||
if long:
|
if long:
|
||||||
self.__long_args += long
|
self.__long_args = self.__long_args + long
|
||||||
|
|
||||||
def parse(self, args):
|
def parse(self, args):
|
||||||
try:
|
try:
|
||||||
|
|
@ -49,10 +50,10 @@ class Options:
|
||||||
sys.stdout = sys.stderr
|
sys.stdout = sys.stderr
|
||||||
self.usage()
|
self.usage()
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
self.args += args
|
self.args = self.args + args
|
||||||
for opt, val in opts:
|
for opt, val in opts:
|
||||||
if opt in ("-a", "--address"):
|
if opt in ("-a", "--address"):
|
||||||
val = val.strip()
|
val = string.strip(val)
|
||||||
if val:
|
if val:
|
||||||
val = "<address>\n%s\n</address>\n" % val
|
val = "<address>\n%s\n</address>\n" % val
|
||||||
self.variables["address"] = val
|
self.variables["address"] = val
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue