diff --git a/.staticsite.py b/.staticsite.py index cced95dcb..176149f54 100644 --- a/.staticsite.py +++ b/.staticsite.py @@ -5,12 +5,15 @@ SITE_NAME = "dosage" SITE_SUB = "a comic downloader and archiver" SITE_AUTHOR = "Tobias Gruetzmacher" SITE_LINKS = ( - {'name': 'Downloads', 'icon': 'download', 'url': 'https://github.com/webcomics/dosage/releases/latest'}, - {'name': 'Report Issue', 'icon': 'bug', 'url': 'https://github.com/webcomics/dosage/issues/new'}, + {'name': 'Downloads', 'icon': 'download', + 'url': 'https://github.com/webcomics/dosage/releases/latest'}, + {'name': 'Report Issue', 'icon': 'bug', + 'url': 'https://github.com/webcomics/dosage/issues/new'}, {'name': 'ChangeLog', 'icon': 'bug', 'url': '/CHANGELOG'}, ) SITE_ICONS = ( - {'name': 'GitHub', 'icon': 'github', 'url': 'https://github.com/webcomics/dosage'}, + {'name': 'GitHub', 'icon': 'github', + 'url': 'https://github.com/webcomics/dosage'}, ) THEME = "doc/.theme" diff --git a/dosagelib/cmd.py b/dosagelib/cmd.py index 28c06f168..0822f0863 100644 --- a/dosagelib/cmd.py +++ b/dosagelib/cmd.py @@ -52,7 +52,8 @@ def setup_options(): parser.add_argument('-v', '--verbose', action='count', default=0, help='provides verbose output, use multiple times for more verbosity') parser.add_argument('-n', '--numstrips', action='store', type=int, default=0, - help='traverse and retrieve the given number of comic strips; use --all to retrieve all comic strips') + help='traverse and retrieve the given number of comic strips;' + ' use --all to retrieve all comic strips') parser.add_argument('-a', '--all', action='store_true', help='traverse and retrieve all comic strips') parser.add_argument('-c', '--continue', action='store_true', dest='cont', @@ -61,7 +62,8 @@ def setup_options(): metavar='PATH', help='set the path to create invidivual comic directories in, default is Comics') parser.add_argument('--baseurl', action='store', metavar='PATH', - help='the base URL of your comics directory (for RSS, HTML, etc.); this should correspond to --base-path') + help='the base URL of your comics directory (for RSS, HTML, etc.);' + ' this should correspond to --base-path') parser.add_argument('-l', '--list', action='store_true', help='list available comic modules') parser.add_argument('--singlelist', action='store_true', @@ -85,11 +87,13 @@ def setup_options(): parser.add_argument('--adult', action='store_true', help='confirms that you are old enough to view adult content') parser.add_argument('--allow-multiple', action='store_true', - help='allows multiple instances to run at the same time. Use if you know what you are doing.') + help='allows multiple instances to run at the same time.' + ' Use if you know what you are doing.') # used for development testing prev/next matching parser.add_argument('--dry-run', action='store_true', help=argparse.SUPPRESS) - # multimatch is only used for development, eg. testing if all comics of a scripted plugin are working + # multimatch is only used for development, eg. testing if all comics of + # a scripted plugin are working parser.add_argument('--multimatch', action='store_true', help=argparse.SUPPRESS) # List all comic modules, even those normally suppressed, because they diff --git a/dosagelib/director.py b/dosagelib/director.py index 230a3fa4e..ad23c509b 100644 --- a/dosagelib/director.py +++ b/dosagelib/director.py @@ -138,7 +138,8 @@ class ComicGetter(threading.Thread): if self.stopped: break except Exception as msg: - out.exception('Could not save image at %s to %s: %r' % (image.referrer, image.filename, msg)) + out.exception('Could not save image at {} to {}: {!r}'.format( + image.referrer, image.filename, msg)) self.errors += 1 return allskipped @@ -243,9 +244,11 @@ def shouldRunScraper(scraperobj, adult=True, listing=False): def warn_adult(scraperobj): """Print warning about adult content.""" - out.warn(u"skipping adult comic %s; use the --adult option to confirm your age" % scraperobj.name) + out.warn(u"skipping adult comic {};" + " use the --adult option to confirm your age".format(scraperobj.name)) def warn_disabled(scraperobj, reasons): """Print warning about disabled comic modules.""" - out.warn(u"Skipping comic %s: %s" % (scraperobj.name, ' '.join(reasons.values()))) + out.warn(u"Skipping comic {}: {}".format( + scraperobj.name, ' '.join(reasons.values()))) diff --git a/dosagelib/events.py b/dosagelib/events.py index 9ce4402e9..b2fe97c7a 100644 --- a/dosagelib/events.py +++ b/dosagelib/events.py @@ -99,7 +99,8 @@ class RSSEventHandler(EventHandler): self.rss = rss.parseFeed(self.rssfn, yesterday) else: self.newfile = True - self.rss = rss.Feed('Daily Dosage', link, 'Comics for %s' % time.strftime('%Y/%m/%d', today)) + self.rss = rss.Feed('Daily Dosage', link, + 'Comics for %s' % time.strftime('%Y/%m/%d', today)) def comicDownloaded(self, comic, filename): """Write RSS entry for downloaded comic.""" @@ -365,7 +366,8 @@ class MultiHandler(object): handler.comicDownloaded(comic, filename) def comicPageLink(self, scraper, url, prevUrl): - """Emit an event to inform the handler about links between comic pages. Should be overridden in subclass.""" + """Emit an event to inform the handler about links between comic pages. + Should be overridden in subclass.""" for handler in _handlers: handler.comicPageLink(scraper, url, prevUrl) diff --git a/tox.ini b/tox.ini index eaef96120..9ec04d0fe 100644 --- a/tox.ini +++ b/tox.ini @@ -33,14 +33,14 @@ deps = [flake8] # we aim for 79, but this suppresses warnings for now... -max-line-length = 120 +max-line-length = 100 ignore = E127,E128,E241,FI12,FI14,FI15,FI50,FI51,FI53,FI54,FI55,W504 require-code = True min-version = 2.7 # Duplicated for CodeClimate... [pep8] -max-line-length = 120 +max-line-length = 100 ignore = E127,E128,E241,FI12,FI14,FI15,FI50,FI51,FI53,FI54,FI55,W504 [pytest]