mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 23:51:08 +00:00
fix new flake8 issues
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
This commit is contained in:
parent
db13c754a5
commit
6c404a3557
@ -24,13 +24,14 @@ from ubuntutools.misc import (system_distribution, vendor_to_distroinfo,
|
||||
codename_to_distribution)
|
||||
from ubuntutools.rdepends import query_rdepends, RDependsException
|
||||
|
||||
DEFAULT_MAX_DEPTH = 10 # We want avoid any infinite loop...
|
||||
DEFAULT_MAX_DEPTH = 10 # We want avoid any infinite loop...
|
||||
|
||||
|
||||
def main():
|
||||
system_distro_info = vendor_to_distroinfo(system_distribution())()
|
||||
try:
|
||||
default_release = system_distro_info.devel()
|
||||
except DistroDataOutdated, e:
|
||||
except DistroDataOutdated as e:
|
||||
Logger.warn(e)
|
||||
default_release = 'unstable'
|
||||
|
||||
@ -100,7 +101,7 @@ def main():
|
||||
def query(package):
|
||||
try:
|
||||
return query_rdepends(package, options.release, options.arch, **opts)
|
||||
except RDependsException, e:
|
||||
except RDependsException as e:
|
||||
Logger.error(str(e))
|
||||
sys.exit(1)
|
||||
|
||||
@ -156,15 +157,14 @@ def main():
|
||||
display_verbose(package, result)
|
||||
|
||||
|
||||
|
||||
def display_verbose(package, values):
|
||||
if not values:
|
||||
print "No reverse dependencies found"
|
||||
print("No reverse dependencies found")
|
||||
return
|
||||
|
||||
def print_field(field):
|
||||
print field
|
||||
print '=' * len(field)
|
||||
print(field)
|
||||
print('=' * len(field))
|
||||
|
||||
def print_package(values, package, arch, dependency, offset=0):
|
||||
line = ' ' * offset + '* %s' % package
|
||||
@ -174,7 +174,7 @@ def display_verbose(package, values):
|
||||
if len(line) < 30:
|
||||
line += ' ' * (30 - len(line))
|
||||
line += ' (for %s)' % dependency
|
||||
print line
|
||||
print(line)
|
||||
data = values.get(package)
|
||||
if data:
|
||||
offset = offset + 1
|
||||
@ -205,9 +205,9 @@ def display_verbose(package, values):
|
||||
print
|
||||
|
||||
if all_archs:
|
||||
print ("Packages without architectures listed are "
|
||||
"reverse-dependencies in: %s"
|
||||
% ', '.join(sorted(list(all_archs))))
|
||||
print("Packages without architectures listed are "
|
||||
"reverse-dependencies in: %s"
|
||||
% ', '.join(sorted(list(all_archs))))
|
||||
|
||||
|
||||
def display_consise(values):
|
||||
@ -217,7 +217,7 @@ def display_consise(values):
|
||||
for rdep in rdeps:
|
||||
result.add(rdep['Package'])
|
||||
|
||||
print u'\n'.join(sorted(list(result)))
|
||||
print(u'\n'.join(sorted(list(result))))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
x
Reference in New Issue
Block a user