Fix codestyle issues is britney.py

Signed-off-by: Ivo De Decker <ivodd@debian.org>
ubuntu/rebased
Ivo De Decker 5 years ago
parent 7fdbfcbeb2
commit 5890cb914e

@ -441,7 +441,10 @@ class Britney(object):
MINDAYS[k.split("_")[1].lower()] = int(v)
elif k.startswith("HINTS_"):
self.HINTS[k.split("_")[1].lower()] = \
reduce(lambda x,y: x+y, [hasattr(self, "HINTS_" + i) and getattr(self, "HINTS_" + i) or (i,) for i in v.split()])
reduce(lambda x, y: x+y, [
hasattr(self, "HINTS_" + i) and
getattr(self, "HINTS_" + i) or
(i,) for i in v.split()])
elif not hasattr(self.options, k.lower()) or \
not getattr(self.options, k.lower()):
setattr(self.options, k.lower(), v)
@ -614,7 +617,8 @@ class Britney(object):
self.logger.info(" - constraint %s", pkg_name)
pkg_list = [x.strip() for x in mandatory_field('Package-List').split("\n") if x.strip() != '' and not x.strip().startswith("#")]
pkg_list = [x.strip() for x in mandatory_field('Package-List').split("\n")
if x.strip() != '' and not x.strip().startswith("#")]
src_data = SourcePackage(faux_version,
faux_section,
set(),
@ -717,12 +721,14 @@ class Britney(object):
if apt_pkg.version_compare(hint2.version, hint.version) < 0:
# This hint is for a newer version, so discard the old one
self.logger.warning("Overriding %s[%s] = ('%s', '%s', '%s') with ('%s', '%s', '%s')",
x, package, hint2.version, hint2.architecture, hint2.user, hint.version, hint.architecture, hint.user)
x, package, hint2.version, hint2.architecture,
hint2.user, hint.version, hint.architecture, hint.user)
hint2.set_active(False)
else:
# This hint is for an older version, so ignore it in favour of the new one
self.logger.warning("Ignoring %s[%s] = ('%s', '%s', '%s'), ('%s', '%s', '%s') is higher or equal",
x, package, hint.version, hint.architecture, hint.user, hint2.version, hint2.architecture, hint2.user)
x, package, hint.version, hint.architecture, hint.user,
hint2.version, hint2.architecture, hint2.user)
hint.set_active(False)
else:
self.logger.warning("Overriding %s[%s] = ('%s', '%s') with ('%s', '%s')",
@ -797,7 +803,8 @@ class Britney(object):
n = len(nuninst[arch])
elif original and arch in original:
n = len(original[arch])
else: continue
else:
continue
if arch in self.options.break_arches:
totalbreak = totalbreak + n
else:
@ -865,7 +872,8 @@ class Britney(object):
output_logger.info(" pre: %s", self.eval_nuninst(nuninst_last_accepted))
output_logger.info(" now: %s", self.eval_nuninst(nuninst_after))
if new_cruft:
output_logger.info(" added new cruft items to list: %s",
output_logger.info(
" added new cruft items to list: %s",
" ".join(x.uvname for x in new_cruft))
if len(selected) <= 20:
@ -918,7 +926,8 @@ class Britney(object):
)
output_logger.info(" got exception: %s" % (repr(e)))
if self.options.check_consistency_level >= 3:
target_suite.check_suite_source_pkg_consistency('iter_package after rollback (MigrationConstraintException)')
target_suite.check_suite_source_pkg_consistency(
'iter_package after rollback (MigrationConstraintException)')
if not accepted:
if len(comp) > 1:
@ -1006,7 +1015,8 @@ class Britney(object):
# On non-recursive hints check for cruft and purge it proactively in case it "fixes" the hint.
cruft = [x for x in upgrade_me if x.is_cruft_removal]
if new_cruft:
output_logger.info("Change added new cruft items to list: %s",
output_logger.info(
"Change added new cruft items to list: %s",
" ".join(x.uvname for x in new_cruft))
cruft.extend(new_cruft)
if cruft:
@ -1241,7 +1251,6 @@ class Britney(object):
write_heidi_delta(self.options.heidi_delta_output,
self.all_selected)
self.logger.info("Test completed!")
def printuninstchange(self):

@ -10,7 +10,7 @@ def should_skip_codestyle():
EXCEPTIONS_BY_FILE = {
'britney.py': 24,
'britney.py': 0,
'britney2/excuse.py': 5,
'britney2/excusefinder.py': 1,
'britney2/hints.py': 8,

Loading…
Cancel
Save