diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2019-07-04 22:44:47 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2019-07-04 22:52:21 +0300 |
commit | cf2dba461216a3ef4c0b39e5d9829a505204434d (patch) | |
tree | eeb441dba0f40141cf72f132534a8a8822e647d6 | |
parent | 4a623bb4dd963b2945c36b8e3b5b7e57e982eb89 (diff) |
Fix flake8 issues
-rwxr-xr-x | calm/calm.py | 7 | ||||
-rwxr-xr-x | calm/hint.py | 2 | ||||
-rw-r--r-- | calm/movelist.py | 3 | ||||
-rwxr-xr-x | calm/package.py | 3 | ||||
-rwxr-xr-x | calm/pkg2html.py | 1 | ||||
-rw-r--r-- | calm/spelling.py | 2 | ||||
-rw-r--r-- | calm/uploads.py | 1 | ||||
-rwxr-xr-x | pep8 | 2 |
8 files changed, 10 insertions, 11 deletions
diff --git a/calm/calm.py b/calm/calm.py index 28e15e3..c68b12d 100755 --- a/calm/calm.py +++ b/calm/calm.py @@ -52,7 +52,6 @@ # write setup.ini file # -from collections import defaultdict from contextlib import ExitStack import argparse import logging @@ -142,7 +141,7 @@ def process_uploads(args, state): m = mlist[name] # also send a mail to each maintainer about their packages - with mail_logs(args.email, toaddrs=m.email, subject='%s for %s' % (state.subject, name), thresholdLevel=logging.INFO) as maint_email: + with mail_logs(args.email, toaddrs=m.email, subject='%s for %s' % (state.subject, name), thresholdLevel=logging.INFO) as maint_email: # noqa: F841 # for each arch and noarch scan_result = {} @@ -272,7 +271,7 @@ def process_uploads(args, state): def process(args, state): # send one email per run to leads, if any errors occurred - with mail_logs(args.email, toaddrs=args.email, subject='%s' % (state.subject), thresholdLevel=logging.ERROR) as leads_email: + with mail_logs(args.email, toaddrs=args.email, subject='%s' % (state.subject), thresholdLevel=logging.ERROR) as leads_email: # noqa: F841 if args.dryrun: logging.warning("--dry-run is in effect, nothing will really be done") @@ -593,7 +592,7 @@ def do_daemon(args, state): # cancel any pending alarm signal.alarm(0) except Exception as e: - with mail_logs(args.email, toaddrs=args.email, subject='calm stopping due to unhandled exception', thresholdLevel=logging.ERROR) as leads_email: + with mail_logs(args.email, toaddrs=args.email, subject='calm stopping due to unhandled exception', thresholdLevel=logging.ERROR) as leads_email: # noqa: F841 logging.error("exception %s" % (type(e).__name__), exc_info=True) irk.irk("calm daemon stopped due to unhandled exception") else: diff --git a/calm/hint.py b/calm/hint.py index 5b050a7..608cc96 100755 --- a/calm/hint.py +++ b/calm/hint.py @@ -363,7 +363,7 @@ def main(args): status = 0 for fn in args.files: - hints = hint_file_parse(fn, setup) + hints = hint_file_parse(fn, pvr) if args.verbose > 1: print(hints) diff --git a/calm/movelist.py b/calm/movelist.py index bf6268e..c7bdde8 100644 --- a/calm/movelist.py +++ b/calm/movelist.py @@ -23,6 +23,7 @@ import logging import os +import shutil from collections import defaultdict from . import utils @@ -92,7 +93,7 @@ class MoveList(object): return i # copy the files in a movelist - def copy(args, fromdir, todir): + def copy(self, args, fromdir, todir): for p in sorted(self.movelist): logging.debug("mkdir %s" % os.path.join(todir, p)) if not args.dryrun: diff --git a/calm/package.py b/calm/package.py index f73eb28..7d9594f 100755 --- a/calm/package.py +++ b/calm/package.py @@ -47,7 +47,8 @@ from . import maintainers from . import past_mistakes -# kinds of packages @unique +# kinds of packages +@unique class Kind(Enum): binary = 1 # aka 'install' source = 2 diff --git a/calm/pkg2html.py b/calm/pkg2html.py index d61d5db..2c14933 100755 --- a/calm/pkg2html.py +++ b/calm/pkg2html.py @@ -267,7 +267,6 @@ def update_package_listings(args, packages): def tar_line(pn, p, category, v, arch, f): if category not in p.vermap[v]: return - t = p.vermap[v][category] size = int(math.ceil(p.tar(v, category).size / 1024)) name = v if category == 'install' else v + ' (source)' target = "%s-%s" % (p.orig_name, v) + ('' if category == 'install' else '-src') diff --git a/calm/spelling.py b/calm/spelling.py index d3d53f4..505c1fb 100644 --- a/calm/spelling.py +++ b/calm/spelling.py @@ -102,7 +102,7 @@ def spellcheck_hints(args, packages): w = re.sub(r'[\d.]*$', '', w) # both with and without any lib prefix - for w1 in [w, re.sub(r'^lib', '', w)]: + for wl in [w, re.sub(r'^lib', '', w)]: # add the package name unless it exists in the list above, which # will give a canonical capitalization if wl.lower() not in wordlist: diff --git a/calm/uploads.py b/calm/uploads.py index 9914a16..747b0dc 100644 --- a/calm/uploads.py +++ b/calm/uploads.py @@ -30,7 +30,6 @@ import filecmp import os import logging import re -import shutil import tarfile import time @@ -1,3 +1,3 @@ #!/bin/sh set -e -grep -s -l '^#!/usr/bin/env python' * calm/* test/* | xargs python3 -m pycodestyle --count --show-source --max-line-length=240 --ignore=E129,E741,W504 +grep -s -l '^#!/usr/bin/env python' * calm/* test/* | xargs flake8 --count --show-source --max-line-length=240 --ignore=E129,E741,W504 |