pyflakes/pep8 fixes

This commit is contained in:
Martin A. Brown 2016-03-01 22:53:07 -08:00
parent 78e67c0e6c
commit ee88d451a8
3 changed files with 15 additions and 11 deletions

View File

@ -89,8 +89,9 @@ def build(config, docs, **kwargs):
return 1
# def script(config, docs, inv, **kwargs):
# return 0
def script(config, docs, inv, **kwargs):
raise NotImplementedError
return 0
def getDocumentNames(args):
@ -245,7 +246,7 @@ def run(argv):
if not config.sourcedir:
return " --sourcedir (and --pubdir) required for inventory."
inv = tldp.inventory.Inventory(config.pubdir, config.sourcedir)
logger.info("Collected inventory containing %s documents.",
logger.info("Collected inventory containing %s documents.",
len(inv.all.keys()))
else:
inv = None
@ -285,7 +286,7 @@ def run(argv):
if not workset:
logger.info("No work to do.")
return 0
# -- listify the set and sort it
#
docs = sorted(workset, key=lambda x: x.stem.lower())

View File

@ -8,11 +8,12 @@ import sys
import errno
import shutil
import logging
logger = logging.getLogger(__name__)
from tldp.ldpcollection import LDPDocumentCollection
from tldp.utils import logdir, statfiles
logger = logging.getLogger(__name__)
class OutputNamingConvention(object):
'''A base class inherited by OutputDirectory to ensure consistent
@ -166,8 +167,8 @@ class OutputCollection(LDPDocumentCollection):
'''construct an OutputCollection
If dirname is not supplied, OutputCollection is basically, a dict().
If dirname is supplied, then OutputCollection scans the filesystem
for subdirectories of dirname and creates an OutputDirectory for each
If dirname is supplied, then OutputCollection scans the filesystem for
subdirectories of dirname and creates an OutputDirectory for each
subdir. Each subdir name is used as the stem (or key) for holding the
OutputDirectory in the OutputCollection.

View File

@ -164,8 +164,9 @@ class SourceDocument(object):
self.filename = os.path.abspath(filename)
if not os.path.exists(self.filename):
logger.critical("Missing source document: %s", self.filename)
raise IOError(errno.ENOENT, os.strerror(errno.ENOENT), self.filename)
fn = self.filename
logger.critical("Missing source document: %s", fn)
raise IOError(errno.ENOENT, os.strerror(errno.ENOENT), fn)
if os.path.isdir(self.filename):
self.filename = sourcedoc_fromdir(self.filename)
@ -176,8 +177,9 @@ class SourceDocument(object):
self.filename = None
if self.filename is None:
logger.critical("Source document is not a plain file: %s", filename)
raise ValueError(filename + " not identifiable as a document")
fn = filename
logger.critical("Source document is not a plain file: %s", fn)
raise ValueError(fn + " not identifiable as a document")
self.doctype = guess(self.filename)
self.status = 'source'