summaryrefslogtreecommitdiffstats
path: root/Doc/tools
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-09-20 05:49:09 (GMT)
committerFred Drake <fdrake@acm.org>2000-09-20 05:49:09 (GMT)
commitdf84facf0d3c3ab199fdfbeb678ea316d9e574c9 (patch)
treeb0dcee7632234fb195df0901deecc8d738410837 /Doc/tools
parent51f53df4c85e08e16263b0be5e2888043e850178 (diff)
downloadcpython-df84facf0d3c3ab199fdfbeb678ea316d9e574c9.zip
cpython-df84facf0d3c3ab199fdfbeb678ea316d9e574c9.tar.gz
cpython-df84facf0d3c3ab199fdfbeb678ea316d9e574c9.tar.bz2
.use_latex(): Make this a little smarter so that it only runs pdflatex
once if all the temporary files are available from building a DVI file. This can avoid two runs of pdflatex.
Diffstat (limited to 'Doc/tools')
-rwxr-xr-xDoc/tools/mkhowto55
1 files changed, 24 insertions, 31 deletions
diff --git a/Doc/tools/mkhowto b/Doc/tools/mkhowto
index 7edf5ff..1537bd0 100755
--- a/Doc/tools/mkhowto
+++ b/Doc/tools/mkhowto
@@ -276,25 +276,29 @@ class Job:
def use_latex(self, binary):
self.require_temps(binary=binary)
- if os.path.isfile("mod%s.idx" % self.doc):
- self.run("%s mod%s.idx" % (MAKEINDEX_BINARY, self.doc))
- if os.path.isfile(self.doc + ".idx"):
- # call to Doc/tools/fix_hack omitted; doesn't appear necessary
- self.run("%s %s.idx" % (MAKEINDEX_BINARY, self.doc))
- import indfix
- indfix.process(self.doc + ".ind")
- if self.use_bibtex:
- self.run("%s %s" % (BIBTEX_BINARY, self.doc))
- self.process_synopsis_files()
- #
- # let the doctype-specific handler do some intermediate work:
- #
- if self.doctype == "manual":
- self.use_latex_manual(binary=binary)
- elif self.doctype == "howto":
- self.use_latex_howto(binary=binary)
- else:
- raise RuntimeError, "unsupported document type: " + self.doctype
+ if self.latex_runs < 2:
+ if os.path.isfile("mod%s.idx" % self.doc):
+ self.run("%s mod%s.idx" % (MAKEINDEX_BINARY, self.doc))
+ if os.path.isfile(self.doc + ".idx"):
+ # call to Doc/tools/fix_hack omitted; doesn't appear necessary
+ self.run("%s %s.idx" % (MAKEINDEX_BINARY, self.doc))
+ import indfix
+ indfix.process(self.doc + ".ind")
+ if self.use_bibtex:
+ self.run("%s %s" % (BIBTEX_BINARY, self.doc))
+ self.process_synopsis_files()
+ #
+ # let the doctype-specific handler do some intermediate work:
+ #
+ self.run("%s %s" % (binary, self.doc))
+ self.latex_runs += 1
+ if os.path.isfile("mod%s.idx" % self.doc):
+ self.run("%s -s %s mod%s.idx"
+ % (MAKEINDEX_BINARY, ISTFILE, self.doc))
+ if os.path.isfile(self.doc + ".idx"):
+ self.run("%s -s %s %s.idx"
+ % (MAKEINDEX_BINARY, ISTFILE, self.doc))
+ self.process_synopsis_files()
#
# and now finish it off:
#
@@ -308,18 +312,7 @@ class Job:
if self.use_bibtex:
self.run("%s %s" % (BIBTEX_BINARY, self.doc))
self.run("%s %s" % (binary, self.doc))
-
- def use_latex_howto(self, binary):
- self.run("%s %s" % (binary, self.doc))
- if os.path.isfile("mod%s.idx" % self.doc):
- self.run("%s -s %s mod%s.idx"
- % (MAKEINDEX_BINARY, ISTFILE, self.doc))
- if os.path.isfile(self.doc + ".idx"):
- self.run("%s -s %s %s.idx" % (MAKEINDEX_BINARY, ISTFILE, self.doc))
- self.process_synopsis_files()
-
- def use_latex_manual(self, binary):
- self.use_latex_howto(binary)
+ self.latex_runs += 1
def process_synopsis_files(self):
synopsis_files = glob.glob(self.doc + "*.syn")