josch

Make Python code comply with pycodestyle 2.2.0

......@@ -26,6 +26,7 @@ def add_arch(toarch, inSources, outSources, verbose=False):
file=sys.stderr)
return True
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -50,6 +50,7 @@ def apply_ma_diff(diff, inPackages, outPackages, verbose=False):
file=sys.stderr)
return True
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -52,6 +52,7 @@ host_arch = "x32"
def one(iterable):
return next(iter(iterable))
provides = {
"libz-dev": "zlib1g-dev",
"libpng-dev": "libpng12-dev",
......@@ -211,6 +212,7 @@ def main(packages_f, sources_f):
for pkg in srcneeded:
print(pkg)
if __name__ == "__main__":
import sys
if len(sys.argv) != 3:
......
......@@ -39,6 +39,7 @@ def buildgraph2packages(buildgraph, inPackages):
return True
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -49,6 +49,7 @@ def calcportsmetric(g, verbose=False):
srcmetrics[g.node[node]['name']].update(a)
return srcmetrics
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -42,6 +42,7 @@ def check_ma_same_versions(packages1, packages2):
return success
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -24,6 +24,7 @@ def checkfas(weak, droppable, fas, verbose=False):
print(modsrc, fassize, droppable, file=sys.stderr)
return result
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -27,6 +27,7 @@ def convert_arch(fromarch, toarch, inPackages, outPackages, verbose=False):
return True
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -504,6 +504,7 @@ class _ExtendAction(argparse.Action):
items.extend(values)
setattr(namespace, self.dest, items)
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='given a buildcheck result, create a html overview')
......
......@@ -21,6 +21,7 @@ def sob(binpkg):
def sobl(l):
return " ".join([sob(pkg) for pkg in l])
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -17,6 +17,7 @@ def filter_src_builds_for(inSources, arch, outSources, verbose=False):
outfile.write(b"\n")
return True
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -66,6 +66,7 @@ def fix_cross_problems(data, buildpkgs, hostpkgs, verbose=False):
f.write(b"\n")
return True
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -23,6 +23,7 @@ def vertex(string):
"key must be separated from value by a colon")
return key, value
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -23,6 +23,7 @@ def vertex(string):
"key must be separated from value by a colon")
return key, value
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -146,6 +146,7 @@ def graph_difference(g, h, verbose=False):
return True
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -36,6 +36,7 @@ def vertex(string):
"key must be separated from value by a colon")
return key, value
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -31,6 +31,7 @@ def vertex(string):
"key must be separated from value by a colon")
return key, value
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -21,6 +21,7 @@ def vertex(string):
"key must be separated from value by a colon")
return key, value
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -21,6 +21,7 @@ def vertex(string):
"key must be separated from value by a colon")
return key, value
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -17,6 +17,7 @@ def transitive_reduction(g):
g.remove_edge(n1, n4)
return g
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -38,6 +38,7 @@ def graphml2dot(g):
return h
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -23,6 +23,7 @@ def single_verson(inPackages, outPackages, verbose=False):
return True
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -60,6 +60,7 @@ def ma_diff(packages1, packages2, verbose=False):
return result
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(
......
......@@ -157,6 +157,7 @@ def multiarch_interpreter_problem(g, packages=None, html=False):
else:
print("%s\t%s" % (n, v))
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -72,6 +72,7 @@ def packages_diff(inPackages1, inPackages2, verbose=False):
return not(difference)
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -35,6 +35,7 @@ def packages_difference(inPackages1, inPackages2, outPackages, verbose=False):
return True
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -26,6 +26,7 @@ def packages_intersection(
return True
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -26,6 +26,7 @@ def packages_union(inPackages, outPackages, verbose=False):
return True
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -27,6 +27,7 @@ def profile_build_fvs(g, fvs, weak_deps, reduced_deps, verbose=False):
g.remove_edges_from(todrop)
return g
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -128,6 +128,7 @@ def remove_virtual_disjunctions(
outfile.write(b"\n")
return True
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -75,6 +75,7 @@ def soc(c):
res += sov(v)
return res
tables = {
'srcgraph': {
'type1cycles': {
......@@ -662,6 +663,7 @@ def stat_html(data, online=False, verbose=False):
</body>
</html>""")
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......
......@@ -324,6 +324,7 @@ def graph_remove_droppable(g, reduced_deps):
droppable_edges = [e for e in g.edges_iter() if is_droppable(e)]
g.remove_edges_from(droppable_edges)
apt_pkg.init()
......@@ -346,6 +347,7 @@ def sort_pkgs(pkg1, pkg2):
else:
return cmp(a1, a2)
sort_pkgs_key = cmp_to_key(sort_pkgs)
_arch_matches_cache = dict()
......
......@@ -54,6 +54,7 @@ def main(candidates, priorities, order, vols):
# popcon values go into the nine-digit range
print('%9s %s' % ((i[vols], pkg)))
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
......