X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fstats.py;h=105bf6c9f64aec6347a728f8acb5bf8c9ecf49b0;hb=1483a68353fe374254379f4560cc245fbf2523d4;hp=0f1629e6947760c26d7953a42c71af6bf20c1a99;hpb=fb950358e821c33028c02b872396cd1d1bd7402a;p=dak.git diff --git a/dak/stats.py b/dak/stats.py old mode 100644 new mode 100755 index 0f1629e6..105bf6c9 --- a/dak/stats.py +++ b/dak/stats.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Various statistical pr0nography fun and games +""" Various statistical pr0nography fun and games """ # Copyright (C) 2000, 2001, 2002, 2003, 2006 James Troup # This program is free software; you can redistribute it and/or modify @@ -32,7 +32,7 @@ import pg, sys import apt_pkg -import daklib.utils +from daklib import utils ################################################################################ @@ -71,7 +71,7 @@ SELECT a.arch_string as Architecture, sum(f.size) def daily_install_stats(): stats = {} - f = daklib.utils.open_file("2001-11") + f = utils.open_file("2001-11") for line in f.readlines(): split = line.strip().split('|') program = split[1] @@ -213,7 +213,7 @@ SELECT suite, count(suite) FROM src_associations GROUP BY suite;""") def main (): global Cnf, projectB - Cnf = daklib.utils.get_conf() + Cnf = 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: - daklib.utils.warn("dak stats requires a MODE argument") + utils.warn("dak stats requires a MODE argument") usage(1) elif len(args) > 1: - daklib.utils.warn("dak stats accepts only one MODE argument") + 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: - daklib.utils.warn("unknown mode '%s'" % (mode)) + utils.warn("unknown mode '%s'" % (mode)) usage(1) ################################################################################