fix additional flake8 problems

This commit is contained in:
Tomas Kopecek 2020-05-13 09:44:13 +02:00
parent 1ac3ae1fd1
commit 64a0033150
6 changed files with 18 additions and 18 deletions

View file

@ -2612,7 +2612,7 @@ def anon_handle_list_untagged(goptions, session, args):
if refs.get('rpms'):
r.append("rpms: %s" % refs['rpms'])
if refs.get('component_of'):
r.append("images/archives: %" % refs['component_of'])
r.append("images/archives: %s" % refs['component_of'])
if refs.get('archives'):
r.append("archives buildroots: %s" % refs['archives'])
build['refs'] = ', '.join(r)

View file

@ -123,18 +123,18 @@ def duration(start):
return '%s:%02i' % (mins, secs)
def printList(l):
def printList(lst):
"""Print the contents of the list comma-separated"""
if len(l) == 0:
if len(lst) == 0:
return ''
elif len(l) == 1:
return l[0]
elif len(l) == 2:
return ' and '.join(l)
elif len(lst) == 1:
return lst[0]
elif len(lst) == 2:
return ' and '.join(lst)
else:
ret = ', '.join(l[:-1])
ret = ', '.join(lst[:-1])
ret += ', and '
ret += l[-1]
ret += lst[-1]
return ret
@ -838,7 +838,7 @@ def parse_maven_chain(confs, scratch=False):
return builds
def to_list(l):
def to_list(lst):
"""
Helper function for py2/py3 compatibility used e.g. in
list(dict.keys())
@ -847,7 +847,7 @@ def to_list(l):
used, so it is always an iterator.
"""
if isinstance(l, list):
return l
if isinstance(lst, list):
return lst
else:
return list(l)
return list(lst)

View file

@ -13,7 +13,7 @@ from koji.context import context
from koji.plugin import export
# XXX - have to import kojihub for make_task
sys.path.insert(0, '/usr/share/koji-hub/')
import kojihub # noqa: F402
import kojihub # noqa: E402
__all__ = ('runroot',)

View file

@ -6,7 +6,7 @@ import koji
from koji.context import context
from koji.plugin import export
sys.path.insert(0, '/usr/share/koji-hub/')
import kojihub # noqa: F402
import kojihub # noqa: E402
__all__ = ('saveFailedTree',)

View file

@ -8,7 +8,7 @@ import koji.policy
from koji.context import context
from koji.plugin import callback, export
sys.path.insert(0, "/usr/share/koji-hub/")
from kojihub import ( # noqa: F402
from kojihub import ( # noqa: E402
QueryProcessor,
_create_build_target,
_create_tag,

View file

@ -336,8 +336,8 @@ class WindowsBuild(object):
checksum = hashlib.md5()
else:
raise BuildError('Unknown checksum type %s for %s' % ( # noqa: F821
checksum_type,
os.path.basename(fileinfo['localpath'])))
checksum_type,
os.path.basename(fileinfo['localpath'])))
with open(destpath, 'w') as destfile:
offset = 0
while True: