mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Job.__init__(): Only create the builddir directory if it will be used (by
building the HTML or text documentation). There is no need to create it for other formats. Job.build_html(): The builddir parameter is always passed in, so it need not be optional.
This commit is contained in:
parent
1b776a2745
commit
aebbca3b61
1 changed files with 7 additions and 6 deletions
|
@ -227,9 +227,12 @@ class Job:
|
||||||
self.doctype = get_doctype(path)
|
self.doctype = get_doctype(path)
|
||||||
self.filedir, self.doc = split_pathname(path)
|
self.filedir, self.doc = split_pathname(path)
|
||||||
self.builddir = os.path.abspath(options.builddir or self.doc)
|
self.builddir = os.path.abspath(options.builddir or self.doc)
|
||||||
if not os.path.exists(self.builddir):
|
if ("html" in options.formats or "text" in options.formats):
|
||||||
os.mkdir(self.builddir)
|
if not os.path.exists(self.builddir):
|
||||||
self.log_filename = os.path.join(self.builddir, self.doc + ".how")
|
os.mkdir(self.builddir)
|
||||||
|
self.log_filename = os.path.join(self.builddir, self.doc + ".how")
|
||||||
|
else:
|
||||||
|
self.log_filename = os.path.abspath(self.doc + ".how")
|
||||||
if os.path.exists(self.log_filename):
|
if os.path.exists(self.log_filename):
|
||||||
os.unlink(self.log_filename)
|
os.unlink(self.log_filename)
|
||||||
if os.path.exists(self.doc + ".l2h"):
|
if os.path.exists(self.doc + ".l2h"):
|
||||||
|
@ -350,9 +353,7 @@ class Job:
|
||||||
def build_ps(self):
|
def build_ps(self):
|
||||||
self.run("%s -N0 -o %s.ps %s" % (DVIPS_BINARY, self.doc, self.doc))
|
self.run("%s -N0 -o %s.ps %s" % (DVIPS_BINARY, self.doc, self.doc))
|
||||||
|
|
||||||
def build_html(self, builddir=None, max_split_depth=None):
|
def build_html(self, builddir, max_split_depth=None):
|
||||||
if builddir is None:
|
|
||||||
builddir = self.builddir
|
|
||||||
if max_split_depth is None:
|
if max_split_depth is None:
|
||||||
max_split_depth = self.options.max_split_depth
|
max_split_depth = self.options.max_split_depth
|
||||||
texfile = None
|
texfile = None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue