Reduce allowed line length

This commit is contained in:
Tobias Gruetzmacher 2020-01-13 00:36:46 +01:00
parent 063ce4e85f
commit 6e14e8709b
5 changed files with 26 additions and 14 deletions

View file

@ -5,12 +5,15 @@ SITE_NAME = "dosage"
SITE_SUB = "a comic downloader and archiver" SITE_SUB = "a comic downloader and archiver"
SITE_AUTHOR = "Tobias Gruetzmacher" SITE_AUTHOR = "Tobias Gruetzmacher"
SITE_LINKS = ( SITE_LINKS = (
{'name': 'Downloads', 'icon': 'download', 'url': 'https://github.com/webcomics/dosage/releases/latest'}, {'name': 'Downloads', 'icon': 'download',
{'name': 'Report Issue', 'icon': 'bug', 'url': 'https://github.com/webcomics/dosage/issues/new'}, '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'}, {'name': 'ChangeLog', 'icon': 'bug', 'url': '/CHANGELOG'},
) )
SITE_ICONS = ( 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" THEME = "doc/.theme"

View file

@ -52,7 +52,8 @@ def setup_options():
parser.add_argument('-v', '--verbose', action='count', default=0, parser.add_argument('-v', '--verbose', action='count', default=0,
help='provides verbose output, use multiple times for more verbosity') help='provides verbose output, use multiple times for more verbosity')
parser.add_argument('-n', '--numstrips', action='store', type=int, default=0, 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', parser.add_argument('-a', '--all', action='store_true',
help='traverse and retrieve all comic strips') help='traverse and retrieve all comic strips')
parser.add_argument('-c', '--continue', action='store_true', dest='cont', parser.add_argument('-c', '--continue', action='store_true', dest='cont',
@ -61,7 +62,8 @@ def setup_options():
metavar='PATH', metavar='PATH',
help='set the path to create invidivual comic directories in, default is Comics') help='set the path to create invidivual comic directories in, default is Comics')
parser.add_argument('--baseurl', action='store', metavar='PATH', 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', parser.add_argument('-l', '--list', action='store_true',
help='list available comic modules') help='list available comic modules')
parser.add_argument('--singlelist', action='store_true', parser.add_argument('--singlelist', action='store_true',
@ -85,11 +87,13 @@ def setup_options():
parser.add_argument('--adult', action='store_true', parser.add_argument('--adult', action='store_true',
help='confirms that you are old enough to view adult content') help='confirms that you are old enough to view adult content')
parser.add_argument('--allow-multiple', action='store_true', 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 # used for development testing prev/next matching
parser.add_argument('--dry-run', action='store_true', parser.add_argument('--dry-run', action='store_true',
help=argparse.SUPPRESS) 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', parser.add_argument('--multimatch', action='store_true',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
# List all comic modules, even those normally suppressed, because they # List all comic modules, even those normally suppressed, because they

View file

@ -138,7 +138,8 @@ class ComicGetter(threading.Thread):
if self.stopped: if self.stopped:
break break
except Exception as msg: 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 self.errors += 1
return allskipped return allskipped
@ -243,9 +244,11 @@ def shouldRunScraper(scraperobj, adult=True, listing=False):
def warn_adult(scraperobj): def warn_adult(scraperobj):
"""Print warning about adult content.""" """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): def warn_disabled(scraperobj, reasons):
"""Print warning about disabled comic modules.""" """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())))

View file

@ -99,7 +99,8 @@ class RSSEventHandler(EventHandler):
self.rss = rss.parseFeed(self.rssfn, yesterday) self.rss = rss.parseFeed(self.rssfn, yesterday)
else: else:
self.newfile = True 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): def comicDownloaded(self, comic, filename):
"""Write RSS entry for downloaded comic.""" """Write RSS entry for downloaded comic."""
@ -365,7 +366,8 @@ class MultiHandler(object):
handler.comicDownloaded(comic, filename) handler.comicDownloaded(comic, filename)
def comicPageLink(self, scraper, url, prevUrl): 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: for handler in _handlers:
handler.comicPageLink(scraper, url, prevUrl) handler.comicPageLink(scraper, url, prevUrl)

View file

@ -33,14 +33,14 @@ deps =
[flake8] [flake8]
# we aim for 79, but this suppresses warnings for now... # 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 ignore = E127,E128,E241,FI12,FI14,FI15,FI50,FI51,FI53,FI54,FI55,W504
require-code = True require-code = True
min-version = 2.7 min-version = 2.7
# Duplicated for CodeClimate... # Duplicated for CodeClimate...
[pep8] [pep8]
max-line-length = 120 max-line-length = 100
ignore = E127,E128,E241,FI12,FI14,FI15,FI50,FI51,FI53,FI54,FI55,W504 ignore = E127,E128,E241,FI12,FI14,FI15,FI50,FI51,FI53,FI54,FI55,W504
[pytest] [pytest]