1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00

Resolve PEP8 issue E231

* E231 missing whitespace after ':'
This commit is contained in:
Christian Berendt 2014-08-13 11:21:55 +02:00
parent 902adde28b
commit b4d23f8526
5 changed files with 41 additions and 41 deletions

View File

@ -53,20 +53,20 @@ qemu_can_build = [ 'armv4l', 'armv5el', 'armv5l', 'armv6l', 'armv7l', 'armv6el',
]
can_also_build = {
'aarch64':['aarch64'], # only needed due to used heuristics in build parameter evaluation
'armv6l' :[ 'armv4l', 'armv5l', 'armv6l', 'armv5el', 'armv6el' ],
'armv7l' :[ 'armv4l', 'armv5l', 'armv6l', 'armv7l', 'armv5el', 'armv6el', 'armv7el' ],
'armv5el':[ 'armv4l', 'armv5l', 'armv5el' ], # not existing arch, just for compatibility
'armv6el':[ 'armv4l', 'armv5l', 'armv6l', 'armv5el', 'armv6el' ], # not existing arch, just for compatibility
'armv6hl':[ 'armv4l', 'armv5l', 'armv6l', 'armv5el', 'armv6el' ],
'armv7el':[ 'armv4l', 'armv5l', 'armv6l', 'armv7l', 'armv5el', 'armv6el', 'armv7el' ], # not existing arch, just for compatibility
'armv7hl':[ 'armv7hl' ], # not existing arch, just for compatibility
'armv8el':[ 'armv4l', 'armv5el', 'armv6el', 'armv7el', 'armv8el' ], # not existing arch, just for compatibility
'armv8l' :[ 'armv4l', 'armv5el', 'armv6el', 'armv7el', 'armv8el' ], # not existing arch, just for compatibility
'armv5tel':[ 'armv4l', 'armv5el', 'armv5tel' ],
'aarch64': ['aarch64'], # only needed due to used heuristics in build parameter evaluation
'armv6l': [ 'armv4l', 'armv5l', 'armv6l', 'armv5el', 'armv6el' ],
'armv7l': [ 'armv4l', 'armv5l', 'armv6l', 'armv7l', 'armv5el', 'armv6el', 'armv7el' ],
'armv5el': [ 'armv4l', 'armv5l', 'armv5el' ], # not existing arch, just for compatibility
'armv6el': [ 'armv4l', 'armv5l', 'armv6l', 'armv5el', 'armv6el' ], # not existing arch, just for compatibility
'armv6hl': [ 'armv4l', 'armv5l', 'armv6l', 'armv5el', 'armv6el' ],
'armv7el': [ 'armv4l', 'armv5l', 'armv6l', 'armv7l', 'armv5el', 'armv6el', 'armv7el' ], # not existing arch, just for compatibility
'armv7hl': [ 'armv7hl' ], # not existing arch, just for compatibility
'armv8el': [ 'armv4l', 'armv5el', 'armv6el', 'armv7el', 'armv8el' ], # not existing arch, just for compatibility
'armv8l': [ 'armv4l', 'armv5el', 'armv6el', 'armv7el', 'armv8el' ], # not existing arch, just for compatibility
'armv5tel': [ 'armv4l', 'armv5el', 'armv5tel' ],
's390x': ['s390' ],
'ppc64': [ 'ppc', 'ppc64', 'ppc64p7', 'ppc64le' ],
'ppc64le':[ 'ppc64le' ],
'ppc64le': [ 'ppc64le' ],
'i586': [ 'i386' ],
'i686': [ 'i586', 'i386' ],
'x86_64': ['i686', 'i586', 'i386' ],
@ -386,7 +386,7 @@ def check_trusted_projects(apiurl, projects):
if not prj in trusted:
print("\nThe build root needs packages from project '%s'." % prj)
print("Note that malicious packages can compromise the build result or even your system.")
r = raw_input(trustprompt % { 'project':prj })
r = raw_input(trustprompt % { 'project': prj })
if r == '1':
print("adding '%s' to ~/.oscrc: ['%s']['trusted_prj']" % (prj, apiurl))
trusted.append(prj)
@ -879,7 +879,7 @@ def main(apiurl, opts, argv):
if not m:
# short path without obs instance name
m = re.match(r"obs://([^/]+)/(.+)", xml.find('source').get('path'))
project=m.group(1).replace(":",":/")
project=m.group(1).replace(":", ":/")
repo=m.group(2)
buildargs.append('--kiwi-parameter')
buildargs.append('--add-repo')

View File

@ -1263,7 +1263,7 @@ def _format_linedata(linedata, indent, indent_width):
SPACING = 3
MAX_NAME_WIDTH = 15
NAME_WIDTH = min(max([len(s) for s,d in linedata]), MAX_NAME_WIDTH)
NAME_WIDTH = min(max([len(s) for s, d in linedata]), MAX_NAME_WIDTH)
DOC_WIDTH = WIDTH - NAME_WIDTH - SPACING
for namestr, doc in linedata:
line = indent + namestr

View File

@ -1414,7 +1414,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if opts.diff:
run_pager(rdiff)
else:
reqs = get_request_list(apiurl, dst_project, dst_package, req_type='submit', req_state=['new','review'])
reqs = get_request_list(apiurl, dst_project, dst_package, req_type='submit', req_state=['new', 'review'])
user = conf.get_apiurl_usr(apiurl)
myreqs = [ i for i in reqs if i.state.who == user ]
repl = 'y'
@ -1563,7 +1563,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
package = """package="%s" """ % (args[2])
if user.startswith('group:'):
group = user.replace('group:','')
group = user.replace('group:', '')
actionxml = """ <action type="set_bugowner"> <target project="%s" %s /> <group name="%s" /> </action> """ % \
(project, package, group)
if get_group(apiurl, group) == None:
@ -1577,7 +1577,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
return actionxml
@cmdln.option('-a', '--action', action='callback', callback = _actionparser,dest = 'actions',
@cmdln.option('-a', '--action', action='callback', callback = _actionparser, dest = 'actions',
help='specify action type of a request, can be : submit/delete/change_devel/add_role/set_bugowner')
@cmdln.option('-m', '--message', metavar='TEXT',
help='specify message TEXT')
@ -1806,7 +1806,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if package is not None:
footer = textwrap.TextWrapper(width = 66).fill(
'please explain why you like to delete package %s of project %s'
% (package,project))
% (package, project))
else:
footer = textwrap.TextWrapper(width = 66).fill(
'please explain why you like to delete project %s' % project)
@ -1858,7 +1858,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
import textwrap
footer = textwrap.TextWrapper(width = 66).fill(
'please explain why you like to change the devel project of %s/%s to %s/%s'
% (project,package,devel_project,devel_package))
% (project, package, devel_project, devel_package))
opts.message = edit_message(footer)
r = Request()
@ -2017,11 +2017,11 @@ Please submit there instead, or use --nodevelproject to force direct submission.
cmds = ['list', 'log', 'show', 'decline', 'reopen', 'clone', 'accept', 'approvenew', 'wipe', 'setincident', 'supersede', 'revoke', 'checkout', 'co']
if subcmd != 'review' and args[0] not in cmds:
raise oscerr.WrongArgs('Unknown request action %s. Choose one of %s.' \
% (args[0],', '.join(cmds)))
% (args[0], ', '.join(cmds)))
cmds = ['show', 'list', 'add', 'decline', 'accept', 'reopen', 'supersede']
if subcmd == 'review' and args[0] not in cmds:
raise oscerr.WrongArgs('Unknown review action %s. Choose one of %s.' \
% (args[0],', '.join(cmds)))
% (args[0], ', '.join(cmds)))
cmd = args[0]
del args[0]
@ -5686,7 +5686,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
hostprefer = os.path.join(
hostpath,
basename,
"%s__" % (long_name.replace('-','_')),
"%s__" % (long_name.replace('-', '_')),
os.path.basename(os.path.abspath(pdir)))
hostargs.append(long_name)
hostargs.append(hostprefer)
@ -6514,11 +6514,11 @@ Please submit there instead, or use --nodevelproject to force direct submission.
requests = []
# open reviews
u = makeurl(apiurl, ['request'], {
'view' : 'collection',
'view': 'collection',
'states': 'review',
'reviewstates': 'new',
'roles': 'reviewer',
'user' : user,
'user': user,
})
f = http_GET(u)
root = ET.parse(f).getroot()
@ -6531,10 +6531,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
print("")
# open requests
u = makeurl(apiurl, ['request'], {
'view' : 'collection',
'view': 'collection',
'states': 'new',
'roles': 'maintainer',
'user' : user,
'user': user,
})
f = http_GET(u)
root = ET.parse(f).getroot()
@ -6547,10 +6547,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
print("")
# declined requests submitted by me
u = makeurl(apiurl, ['request'], {
'view' : 'collection',
'view': 'collection',
'states': 'declined',
'roles': 'creator',
'user' : user,
'user': user,
})
f = http_GET(u)
root = ET.parse(f).getroot()

View File

@ -4169,7 +4169,7 @@ def check_existing_requests(apiurl, src_project, src_package, dst_project,
reqs = get_exact_request_list(apiurl, src_project, dst_project,
src_package, dst_package,
req_type='submit',
req_state=['new','review', 'declined'])
req_state=['new', 'review', 'declined'])
repl = ''
if reqs:
print('There are already the following submit request: %s.' % \
@ -4236,7 +4236,7 @@ def download(url, filename, progress_obj = None, mtime = None):
try:
o = os.fdopen(fd, 'wb')
for buf in streamfile(url, http_GET, BUFSIZE, progress_obj=progress_obj):
o.write(bytes(buf,"utf-8"))
o.write(bytes(buf, "utf-8"))
o.close()
os.rename(tmpfile, filename)
except:
@ -5067,12 +5067,12 @@ def get_distibutions(apiurl, discon=False):
for node in root.findall('entry'):
if node.get('name').startswith('DISCONTINUED:'):
rmap = {}
rmap['name'] = node.get('name').replace('DISCONTINUED:','').replace(':', ' ')
rmap['name'] = node.get('name').replace('DISCONTINUED:', '').replace(':', ' ')
rmap['project'] = node.get('name')
r.append (result_line_templ % rmap)
r.insert(0,'distribution project')
r.insert(1,'------------ -------')
r.insert(0, 'distribution project')
r.insert(1, '------------ -------')
else:
result_line_templ = '%(name)-25s %(project)-25s %(repository)-25s %(reponame)s'
@ -5091,8 +5091,8 @@ def get_distibutions(apiurl, discon=False):
rmap['reponame'] = node5.text
r.append(result_line_templ % rmap)
r.insert(0,'distribution project repository reponame')
r.insert(1,'------------ ------- ---------- --------')
r.insert(0, 'distribution project repository reponame')
r.insert(1, '------------ ------- ---------- --------')
return r
@ -5604,7 +5604,7 @@ def get_source_rev(apiurl, project, package, revision=None):
# CAUTION: We have to loop through all rev and find the highest one, if none given.
if revision:
url = makeurl(apiurl, ['source', project, package, '_history'], {'rev':revision})
url = makeurl(apiurl, ['source', project, package, '_history'], {'rev': revision})
else:
url = makeurl(apiurl, ['source', project, package, '_history'])
f = http_GET(url)
@ -5617,7 +5617,7 @@ def get_source_rev(apiurl, project, package, revision=None):
elif ent.find('time').text < new.find('time').text:
ent = new
if not ent:
return { 'version': None, 'error':'empty revisionlist: no such package?' }
return { 'version': None, 'error': 'empty revisionlist: no such package?' }
e = {}
for k in ent.keys():
e[k] = ent.get(k)
@ -6310,7 +6310,7 @@ def setBugowner(apiurl, prj, pac, user=None, group=None):
template_args=None,
create_new=False)
if user.startswith('group:'):
group=user.replace('group:','')
group=user.replace('group:', '')
user=None
if data:
root = ET.fromstring(''.join(data))

View File

@ -64,7 +64,7 @@ class CpioHdr:
self.namesize = namesize
# != 0 indicates CRC format (which we do not support atm)
self.checksum = checksum
for k,v in self.__dict__.items():
for k, v in self.__dict__.items():
self.__dict__[k] = int(v, 16)
self.filename = filename
# data starts at dataoff and ends at dataoff+filesize
@ -82,7 +82,7 @@ class CpioRead:
# supported formats - use name -> mgc mapping to increase readabilty
sfmt = {
'newascii' : '070701',
'newascii': '070701',
}
# header format