mirror of https://github.com/tLDP/python-tldp
pep8 and pyflakes fixes (and variable renaming)
This commit is contained in:
parent
5e05b0f30d
commit
547cb303f6
|
@ -30,7 +30,7 @@ class BaseDoctype(object):
|
||||||
self.source = kwargs.get('source', None)
|
self.source = kwargs.get('source', None)
|
||||||
self.output = kwargs.get('output', None)
|
self.output = kwargs.get('output', None)
|
||||||
self.platform = kwargs.get('platform', 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')
|
self.logdir = os.path.join(self.output.dirname, 'logs')
|
||||||
if os.path.exists(self.logdir):
|
if os.path.exists(self.logdir):
|
||||||
logger.warning("Found existing logs directory: %s", self.logdir)
|
logger.warning("Found existing logs directory: %s", self.logdir)
|
||||||
|
@ -47,7 +47,8 @@ class BaseDoctype(object):
|
||||||
self.create_html(),
|
self.create_html(),
|
||||||
]
|
]
|
||||||
result = all(vector)
|
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)
|
return all(vector)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Linuxdoc(BaseDoctype, SignatureChecker):
|
||||||
outf = self.output.name_pdf
|
outf = self.output.name_pdf
|
||||||
stem = self.source.stem
|
stem = self.source.stem
|
||||||
logger.info("%s creating PDF %s.", stem, outf)
|
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]
|
'--outfile', outf, inf]
|
||||||
result = execute(cmd, logdir=self.logdir)
|
result = execute(cmd, logdir=self.logdir)
|
||||||
if result == 0:
|
if result == 0:
|
||||||
|
@ -62,10 +62,10 @@ class Linuxdoc(BaseDoctype, SignatureChecker):
|
||||||
outf = self.output.name_html
|
outf = self.output.name_html
|
||||||
stem = self.source.stem
|
stem = self.source.stem
|
||||||
logger.info("%s creating chunked HTML %s, etc.", stem, outf)
|
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)
|
result = execute(cmd, logdir=self.logdir)
|
||||||
if result == 0: # -- only symlink, if HTML generated successfully
|
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)
|
logger.debug("%s creating index.html symlink to %s.", stem, target)
|
||||||
try:
|
try:
|
||||||
os.symlink(target, 'index.html')
|
os.symlink(target, 'index.html')
|
||||||
|
@ -89,7 +89,8 @@ class Linuxdoc(BaseDoctype, SignatureChecker):
|
||||||
try:
|
try:
|
||||||
os.rename(source, target)
|
os.rename(source, target)
|
||||||
except OSError:
|
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)
|
return os.path.isfile(outf)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue