From 547cb303f6491d3c67cbef196d8a72c36726e609 Mon Sep 17 00:00:00 2001 From: "Martin A. Brown" Date: Tue, 16 Feb 2016 00:03:58 -0800 Subject: [PATCH] pep8 and pyflakes fixes (and variable renaming) --- tldp/doctypes/common.py | 5 +++-- tldp/doctypes/linuxdoc.py | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tldp/doctypes/common.py b/tldp/doctypes/common.py index 449a9de..6a30f3a 100644 --- a/tldp/doctypes/common.py +++ b/tldp/doctypes/common.py @@ -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) # diff --git a/tldp/doctypes/linuxdoc.py b/tldp/doctypes/linuxdoc.py index 690294b..9a97577 100644 --- a/tldp/doctypes/linuxdoc.py +++ b/tldp/doctypes/linuxdoc.py @@ -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) #