X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fstats.py;h=f7414eddc85ca4cfbd6b932af5ff74dda24283c3;hb=ea17738cea735d71766bfc2bd082f59b3adf2dbb;hp=cf810b9a08f660b0b2f91bead44d4b1047ba8de2;hpb=06ce98c8111a8b09e5603dbbd34324a216412d69;p=dak.git diff --git a/dak/stats.py b/dak/stats.py index cf810b9a..f7414edd 100755 --- a/dak/stats.py +++ b/dak/stats.py @@ -31,8 +31,8 @@ ################################################################################ import pg, sys -import dak.lib.utils import apt_pkg +import daklib.utils ################################################################################ @@ -71,9 +71,9 @@ SELECT a.arch_string as Architecture, sum(f.size) def daily_install_stats(): stats = {} - file = dak.lib.utils.open_file("2001-11") + file = daklib.utils.open_file("2001-11") for line in file.readlines(): - split = line.strip().split('~') + split = line.strip().split('|') program = split[1] if program != "katie" and program != "process-accepted": continue @@ -182,7 +182,7 @@ SELECT suite, count(suite) FROM src_associations GROUP BY suite;""") for arch in Cnf.ValueList("Suite::%s::Architectures" % (suite)): suite_arches[suite_id][arch] = "" suite_id_list.append(suite_id) - output_list = map(lambda x: output_format(x), suite_list) + output_list = [ output_format(i) for i in suite_list ] longest_suite = longest(output_list) arch_list = arches.values() arch_list.sort() @@ -213,7 +213,7 @@ SELECT suite, count(suite) FROM src_associations GROUP BY suite;""") def main (): global Cnf, projectB - Cnf = dak.lib.utils.get_conf() + Cnf = daklib.utils.get_conf() Arguments = [('h',"help","Stats::Options::Help")] for i in [ "help" ]: if not Cnf.has_key("Stats::Options::%s" % (i)): @@ -226,10 +226,10 @@ def main (): usage() if len(args) < 1: - dak.lib.utils.warn("dak stats requires a MODE argument") + daklib.utils.warn("dak stats requires a MODE argument") usage(1) elif len(args) > 1: - dak.lib.utils.warn("dak stats accepts only one MODE argument") + daklib.utils.warn("dak stats accepts only one MODE argument") usage(1) mode = args[0].lower() @@ -242,7 +242,7 @@ def main (): elif mode == "daily-install": daily_install_stats() else: - dak.lib.utils.warn("unknown mode '%s'" % (mode)) + daklib.utils.warn("unknown mode '%s'" % (mode)) usage(1) ################################################################################