pep8 and pyflakes fixes (and variable renaming)

This commit is contained in:
Martin A. Brown 2016-02-16 00:03:58 -08:00
parent 5e05b0f30d
commit 547cb303f6
2 changed files with 8 additions and 6 deletions

View File

@ -30,7 +30,7 @@ class BaseDoctype(object):
self.source = kwargs.get('source', None)
self.output = kwargs.get('output', None)
self.platform = kwargs.get('platform', None)
assert None is not in (self.source, self.output, self.platform)
assert None not in (self.source, self.output, self.platform)
self.logdir = os.path.join(self.output.dirname, 'logs')
if os.path.exists(self.logdir):
logger.warning("Found existing logs directory: %s", self.logdir)
@ -47,7 +47,8 @@ class BaseDoctype(object):
self.create_html(),
]
result = all(vector)
logger.info("%s generation of all documents %s", self.source.stem, result)
logger.info("%s generation of all documents %s",
self.source.stem, result)
return all(vector)
#

View File

@ -47,7 +47,7 @@ class Linuxdoc(BaseDoctype, SignatureChecker):
outf = self.output.name_pdf
stem = self.source.stem
logger.info("%s creating PDF %s.", stem, outf)
cmd = [exe, '--size', 'universal', '-t', 'pdf', '--firstpage', 'p1',
cmd = [exe, '--size', 'universal', '-t', 'pdf', '--firstpage', 'p1',
'--outfile', outf, inf]
result = execute(cmd, logdir=self.logdir)
if result == 0:
@ -62,10 +62,10 @@ class Linuxdoc(BaseDoctype, SignatureChecker):
outf = self.output.name_html
stem = self.source.stem
logger.info("%s creating chunked HTML %s, etc.", stem, outf)
cmd = [self.platform.sgml2html, self.source.filename]
cmd = [exe, inf]
result = execute(cmd, logdir=self.logdir)
if result == 0: # -- only symlink, if HTML generated successfully
target = os.path.basename(self.output.name_html)
target = os.path.basename(outf)
logger.debug("%s creating index.html symlink to %s.", stem, target)
try:
os.symlink(target, 'index.html')
@ -89,7 +89,8 @@ class Linuxdoc(BaseDoctype, SignatureChecker):
try:
os.rename(source, target)
except OSError:
logger.debug("%s failed renaming HTML single file to %s.", stem, target)
logger.debug("%s failed renaming HTML single file to %s.",
stem, target)
return os.path.isfile(outf)
#