X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fstats.py;h=f33873475029ff701fdd2509ee57275fbf28b6f6;hb=772655d608069f12e400e0d6c7b7fac76eb98083;hp=e3e9077bcbe6ed991eaf0fb32a77b6b879709ba5;hpb=4eb2eff3c463697fd411f29443e1bd669e710bb5;p=dak.git diff --git a/dak/stats.py b/dak/stats.py index e3e9077b..f3387347 100755 --- a/dak/stats.py +++ b/dak/stats.py @@ -34,8 +34,7 @@ import sys import apt_pkg from daklib import utils -from daklib.dbconn import DBConn, get_suite_architectures, Suite, Architecture, \ - BinAssociation +from daklib.dbconn import DBConn, get_suite_architectures, Suite, Architecture ################################################################################ @@ -112,17 +111,6 @@ def longest(list): longest = l return longest -def suite_sort(a, b): - if Cnf.has_key("Suite::%s::Priority" % (a)): - a_priority = int(Cnf["Suite::%s::Priority" % (a)]) - else: - a_priority = 0 - if Cnf.has_key("Suite::%s::Priority" % (b)): - b_priority = int(Cnf["Suite::%s::Priority" % (b)]) - else: - b_priority = 0 - return cmp(a_priority, b_priority) - def output_format(suite): output_suite = [] for word in suite.split("-"): @@ -165,7 +153,6 @@ def number_of_packages(): ## Print the results # Setup suite_list = suites.values() - suite_list.sort(suite_sort) suite_id_list = [] suite_arches = {} for suite in suite_list: @@ -193,7 +180,7 @@ def number_of_packages(): output = output + arch.center(longest_arch)+" |" for suite_id in suite_id_list: if suite_arches[suite_id].has_key(arch): - count = repr(d[suite_id][arch_id]) + count = "%d" % d[suite_id][arch_id] else: count = "-" output = output + count.rjust(longest_suite)+" |" @@ -211,9 +198,9 @@ def main (): if not Cnf.has_key("Stats::Options::%s" % (i)): Cnf["Stats::Options::%s" % (i)] = "" - args = apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv) + args = apt_pkg.parse_commandline(Cnf, Arguments, sys.argv) - Options = Cnf.SubTree("Stats::Options") + Options = Cnf.subtree("Stats::Options") if Options["Help"]: usage()