From 53c476cebc23405a37a370c325af3cf98f3a2a0b Mon Sep 17 00:00:00 2001 From: "Martin A. Brown" Date: Thu, 28 Apr 2016 12:12:41 -0400 Subject: [PATCH] pyflakes/pep8 adjustments --- tldp/__init__.py | 2 +- tldp/driver.py | 8 ++++---- tldp/inventory.py | 3 +-- tldp/utils.py | 2 ++ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tldp/__init__.py b/tldp/__init__.py index 77ce65b..b00919e 100644 --- a/tldp/__init__.py +++ b/tldp/__init__.py @@ -7,4 +7,4 @@ import tldp.outputs import tldp.sources import tldp.inventory -VERSION="0.7.11" +VERSION = "0.7.11" diff --git a/tldp/driver.py b/tldp/driver.py index f81ce8d..b9449fb 100644 --- a/tldp/driver.py +++ b/tldp/driver.py @@ -31,7 +31,7 @@ signal.signal(signal.SIGPIPE, signal.SIG_DFL) signal.signal(signal.SIGINT, signal.SIG_DFL) logformat = '%(levelname)-9s %(name)s %(filename)s#%(lineno)s ' \ - + '%(funcName)s %(message)s' + + '%(funcName)s %(message)s' logging.basicConfig(stream=sys.stderr, format=logformat, level=logging.ERROR) logger = logging.getLogger(__name__) @@ -109,7 +109,7 @@ def summary(config, *args, **kwargs): width.doctype = max([len(x.__name__) for x in knowndoctypes]) width.status = max([len(x) for x in status_types]) width.count = len(str(len(inv.source.keys()))) - print('By Document Status (STATUS)', '---------------------------', + print('By Document Status (STATUS)', '---------------------------', sep='\n', file=file) for status in status_types: count = len(getattr(inv, status, 0)) @@ -129,7 +129,7 @@ def summary(config, *args, **kwargs): if abbrev: s = s + ', and %d more ...' % (len(abbrev)) print(s, file=file) - print('', 'By Document Type (DOCTYPE)', '--------------------------', + print('', 'By Document Type (DOCTYPE)', '--------------------------', sep='\n', file=file) summarybytype = collections.defaultdict(list) for doc in inv.source.values(): @@ -274,7 +274,7 @@ def docbuild(config, docs, **kwargs): for x, source in enumerate(docs, 1): working = source.working runner = source.doctype(source=source, output=working, config=config) - status = 'progress, %d failures, %d successes' + status = 'progress, %d failures, %d successes' status = status % (result.count(False), result.count(True),) logger.info("%s (%d of %d) initiating build [%s]", source.stem, x, len(docs), status) diff --git a/tldp/inventory.py b/tldp/inventory.py index 1d15b98..f338529 100644 --- a/tldp/inventory.py +++ b/tldp/inventory.py @@ -71,8 +71,7 @@ class Inventory(object): len(self.orphan), len(self.new), len(self.stale), - len(self.broken), - ) + len(self.broken),) def __init__(self, pubdir, sourcedirs): '''construct an Inventory diff --git a/tldp/utils.py b/tldp/utils.py index 7a60f90..0beb7fe 100644 --- a/tldp/utils.py +++ b/tldp/utils.py @@ -284,6 +284,7 @@ def md5files(name, relative=None): '''get all of the MD5s for files from here downtree''' return fileinfo(name, relative=relative, func=md5file) + def statfiles(name, relative=None): ''' >>> statfiles('./docs/x509').keys() @@ -295,6 +296,7 @@ def statfiles(name, relative=None): ''' return fileinfo(name, relative=relative, func=statfile) + def fileinfo(name, relative=None, func=statfile): '''return a dict() with keys being filenames and posix.stat_result values