Commit c11bb33c authored by Julian Andres Klode's avatar Julian Andres Klode
Browse files

Make pycodestyle happy

parent 62b7d9dc
......@@ -479,7 +479,8 @@ def _lsb_release():
out = Popen(['lsb_release', '-idrc'], stdout=PIPE).communicate()[0]
# Convert to unicode string, needed for Python 3.1
out = out.decode("utf-8")
result.update(l.split(":\t") for l in out.split("\n") if ':\t' in l)
result.update(line.split(":\t") for line in out.split("\n")
if ':\t' in line)
except OSError as exc:
if exc.errno != errno.ENOENT:
logging.warning('lsb_release failed, using defaults:' % exc)
......@@ -499,9 +500,9 @@ def _system_image_channel():
out = Popen(
['system-image-cli', '-i'], stdout=PIPE, stderr=DEVNULL,
universal_newlines=True).communicate()[0]
for l in out.splitlines():
if l.startswith('channel: '):
return l.split(': ', 1)[1]
for line in out.splitlines():
if line.startswith('channel: '):
return line.split(': ', 1)[1]
except OSError as exc:
if exc.errno != errno.ENOENT:
logging.warning(
......
......@@ -32,5 +32,5 @@ for package in packages:
uninstalled[package.name] = version
for l in (uninstalled, updated, upgradable):
print(list(l.items())[0])
for line in (uninstalled, updated, upgradable):
print(list(line.items())[0])
......@@ -54,5 +54,5 @@ print("No help for you, try -h")
# Print the configuration space
print("The Configuration space looks like:")
for I in list(Cnf.keys()):
print("%s \"%s\";" % (I, Cnf[I]))
for item in list(Cnf.keys()):
print("%s \"%s\";" % (item, Cnf[item]))
......@@ -22,21 +22,21 @@ apt_pkg.read_config_file_isc(Cnf, ConfigFile[0])
# Print the configuration space
#print "The Configuration space looks like:"
#for I in Cnf.keys():
# print "%s \"%s\";" % (I, Cnf[I])
#for item in Cnf.keys():
# print "%s \"%s\";" % (item, Cnf[item])
# bind8 config file..
if "Zone" in Cnf:
print("Zones: ", Cnf.sub_tree("zone").list())
for I in Cnf.list("zone"):
SubCnf = Cnf.sub_tree(I)
for item in Cnf.list("zone"):
SubCnf = Cnf.sub_tree(item)
if SubCnf.find("type") == "slave":
print("Masters for %s: %s" % (
SubCnf.my_tag(), SubCnf.value_list("masters")))
else:
print("Tree definitions:")
for I in Cnf.list("tree"):
SubCnf = Cnf.sub_tree(I)
for item in Cnf.list("tree"):
SubCnf = Cnf.sub_tree(item)
# This could use Find which would eliminate the possibility of
# exceptions.
print("Subtree %s with sections '%s' and architectures '%s'" % (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment