This fixes incorrect whitespacing inside dictionaries.
This commit is contained in:
2019-12-10 08:54:32 +01:00
parent ec88760187
commit ea3b07568c
12 changed files with 36 additions and 36 deletions

View File

@@ -1,4 +1,4 @@
[flake8]
exclude = .open-build-service/, abichecker, openqa, openqa-maintenance.py
max-line-length = 100
ignore = E501,F401,E302,E128,E251,E201,E202,E203,E305,F841,E265,E261,E266,E712,E401,E126,E502,E711,E125,E123,W293,W391,E101,E713,E124,E127,E701,E714,W503,W504,E129,E741,E722,E731
ignore = E501,F401,E302,E128,E251,E201,E202,E305,F841,E261,E265,E266,E712,E401,E126,E502,E711,E125,E123,W293,W391,E101,E713,E124,E127,E701,E714,W503,W504,E129,E741,E722,E731

View File

@@ -81,7 +81,7 @@ class ReviewBot(object):
return (None|True|False)
"""
DEFAULT_REVIEW_MESSAGES = { 'accepted' : 'ok', 'declined': 'review failed' }
DEFAULT_REVIEW_MESSAGES = { 'accepted': 'ok', 'declined': 'review failed' }
REVIEW_CHOICES = ('normal', 'no', 'accept', 'accept-onpass', 'fallback-onfail', 'fallback-always')
COMMENT_MARKER_REGEX = re.compile(r'<!-- (?P<bot>[^ ]+) state=(?P<state>[^ ]+)(?: result=(?P<result>[^ ]+))? -->')
@@ -91,7 +91,7 @@ class ReviewBot(object):
# list of tuples (prefix, apiurl, submitrequestprefix)
# set this if the obs instance maps another instance into it's
# namespace
'project_namespace_api_map' : [
'project_namespace_api_map': [
('openSUSE.org:', 'https://api.opensuse.org', 'obsrq'),
],
}
@@ -158,7 +158,7 @@ class ReviewBot(object):
def set_request_ids(self, ids):
for rqid in ids:
u = osc.core.makeurl(self.apiurl, [ 'request', rqid ], { 'withfullhistory' : '1' })
u = osc.core.makeurl(self.apiurl, [ 'request', rqid ], { 'withfullhistory': '1' })
r = osc.core.http_GET(u)
root = ET.parse(r).getroot()
req = osc.core.Request()

View File

@@ -232,7 +232,7 @@ class BiArchTool(ToolBase.ToolBase):
bn = pkgmeta.find('build')
if bn is None:
bn = ET.SubElement(pkgmeta, 'build')
ET.SubElement(bn, 'disable', { 'arch' : self.arch })
ET.SubElement(bn, 'disable', { 'arch': self.arch })
changed = True
if changed:
@@ -243,9 +243,9 @@ class BiArchTool(ToolBase.ToolBase):
self._invalidate__cached_GET(pkgmetaurl)
if wipebinaries:
self.http_POST(self.makeurl(['build', self.project], {
'cmd' : 'wipe',
'cmd': 'wipe',
'arch': self.arch,
'package' : pkg }))
'package': pkg }))
except HTTPError as e:
logger.error('failed to update %s: %s', pkg, e)
@@ -296,7 +296,7 @@ class BiArchTool(ToolBase.ToolBase):
bn = pkgmeta.find('build')
if bn is None:
bn = ET.SubElement(pkgmeta, 'build')
ET.SubElement(bn, 'disable', { 'arch' : self.arch })
ET.SubElement(bn, 'disable', { 'arch': self.arch })
changed = True
else:
logger.debug('%s already disabled for %s', pkg, self.arch)
@@ -326,9 +326,9 @@ class BiArchTool(ToolBase.ToolBase):
if wipebinaries and pkgmeta.find("./build/disable[@arch='{}']".format(self.arch)) is not None:
logger.debug("wiping %s", pkg)
self.http_POST(self.makeurl(['build', self.project], {
'cmd' : 'wipe',
'cmd': 'wipe',
'arch': self.arch,
'package' : pkg }))
'package': pkg }))
except HTTPError as e:
logger.error('failed to update %s: %s', pkg, e)

View File

@@ -176,8 +176,8 @@ def main(args):
text = MAIL_TEMPLATES[Reminded[package].remindCount - 1] % {
'recipient': fullname,
'sender': sender,
'project' : project,
'package' : package,
'project': project,
'package': package,
'date': time.ctime(Reminded[package].firstfail),
}
SendMail(logger, project, sender, to, fullname, subject, text)

View File

@@ -243,7 +243,7 @@ class CheckSource(ReviewBot.ReviewBot):
for f in xml.findall('entry'):
# we check all repos in the source project for errors that exist in the target project
repo = f.attrib['name']
query = { 'last' : 1, }
query = { 'last': 1, }
for arch in target_archs(self.apiurl, source_project, repo):
url = osc.core.makeurl(self.apiurl, ['build', source_project, repo, arch, source_package, '_log'], query = query)
try:

View File

@@ -28,7 +28,7 @@ class FactorySourceChecker(ReviewBot.ReviewBot):
def __init__(self, *args, **kwargs):
ReviewBot.ReviewBot.__init__(self, *args, **kwargs)
self.factory = [ "openSUSE:Factory" ]
self.review_messages = { 'accepted' : 'ok', 'declined': 'the package needs to be accepted in Factory first' }
self.review_messages = { 'accepted': 'ok', 'declined': 'the package needs to be accepted in Factory first' }
self.history_limit = 5
def check_source_submission(self, src_project, src_package, src_rev, target_project, target_package):

View File

@@ -21,7 +21,7 @@ config_defaults = {
'sender': 'noreply@opensuse.org',
'to': 'opensuse-factory@opensuse.org',
'relay': 'relay.suse.de',
'changesfile' : "Changes.{version}.txt",
'changesfile': "Changes.{version}.txt",
}
def _load_config(handle = None):

View File

@@ -33,17 +33,17 @@ http_POST = osc.core.http_POST
class Manager42(object):
config_defaults = {
'ignored_packages' : [
'ignored_packages': [
'00Meta',
'00aggregates',
'000product',
'000package-groups',
'000release-packages',
],
'project_preference_order' : [],
'drop_if_vanished_from' : [],
'from_prj' : 'openSUSE:Leap:42.3',
'factory' : 'openSUSE:Factory',
'project_preference_order': [],
'drop_if_vanished_from': [],
'from_prj': 'openSUSE:Leap:42.3',
'factory': 'openSUSE:Factory',
}
def __init__(self, caching = True, configfh = None):

View File

@@ -115,7 +115,7 @@ def osrt_origin_config(apiurl, opts, *args):
if opts.origins_only:
print('\n'.join(config_origin_list(config)))
else:
yaml.Dumper.ignore_aliases = lambda *args : True
yaml.Dumper.ignore_aliases = lambda *args: True
print(yaml.dump(config))
def osrt_origin_cron(apiurl, opts, *args):
@@ -331,7 +331,7 @@ def osrt_origin_report(apiurl, opts, *args):
report = [line_format.format(*columns)]
total = len(lookup)
for origin, count in sorted(origin_count.items(), key=lambda x : x[1], reverse=True):
for origin, count in sorted(origin_count.items(), key=lambda x: x[1], reverse=True):
values = [origin, count, round(float(count) / total * 100, 2)]
if opts.diff:
values.insert(2, origin_count_change.get(origin, 0))

View File

@@ -52,11 +52,11 @@ class ScanBaselibs(object):
return False
def package_has_32bit_binaries(self, project, repo, package):
query = { 'package' : package,
'repository' : repo,
'arch' : 'x86_64',
'multibuild' : 1,
'view' : 'binarylist' }
query = { 'package': package,
'repository': repo,
'arch': 'x86_64',
'multibuild': 1,
'view': 'binarylist' }
root = ET.parse(http_GET(makeurl(self.apiurl, ['build', project, '_result'], query = query))).getroot()
# assume 32bit importing RPMs can be appeared in multibuild-ed package
for binarylist in root.findall('./result/binarylist'):
@@ -81,10 +81,10 @@ class ScanBaselibs(object):
print('%s has baselibs.conf but 32bit RPMs does not exist on 64bit\'s build result.' % pkg)
if wipebinaries:
http_POST(makeurl(self.apiurl, ['build', project], {
'cmd' : 'wipe',
'repository' : repo,
'package' : pkg,
'arch' : 'i586' }))
'cmd': 'wipe',
'repository': repo,
'package': pkg,
'arch': 'i586' }))
f.close()
def scan(self):

View File

@@ -142,7 +142,7 @@ class TestFactorySourceAccept(unittest.TestCase):
""")
])
result = { 'status' : None }
result = { 'status': None }
def change_request(result, method, uri, headers):
query = parse_qs(urlparse(uri).query)
@@ -265,7 +265,7 @@ class TestFactorySourceAccept(unittest.TestCase):
</collection>
""")
result = { 'factory_source_declined' : None }
result = { 'factory_source_declined': None }
def change_request(result, method, uri, headers):
query = parse_qs(urlparse(uri).query)

View File

@@ -119,7 +119,7 @@ class TestMaintenance(unittest.TestCase):
</directory>
""")
result = { 'devel_review_added' : None }
result = { 'devel_review_added': None }
def change_request(result, method, uri, headers):
query = parse_qs(urlparse(uri).query)
@@ -237,7 +237,7 @@ class TestMaintenance(unittest.TestCase):
</directory>
""")
result = { 'devel_review_added' : None }
result = { 'devel_review_added': None }
def change_request(result, method, uri, headers):
u = urlparse(uri)
@@ -335,7 +335,7 @@ class TestMaintenance(unittest.TestCase):
<collection/>
""")
result = { 'factory_review_added' : None }
result = { 'factory_review_added': None }
def change_request(result, method, uri, headers):
query = parse_qs(urlparse(uri).query)