From: Joerg Jaspert Date: Sun, 4 May 2008 00:33:21 +0000 (+0200) Subject: Use "import daklib.foo as foo" style X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=d58bd373a88f299448c12e67f4676e7644e257dc;p=dak.git Use "import daklib.foo as foo" style --- diff --git a/ChangeLog b/ChangeLog index 92f21645..4ff8516e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -33,6 +33,7 @@ * dak/rm.py: likewise * dak/show_new.py: likewise * dak/split_done.py: likewise + * dak/stats.py: likewise * dak/check_archive.py (check_files_not_symlinks): Remove long-time unused and commented code. Import stuff from daklib as diff --git a/dak/stats.py b/dak/stats.py old mode 100644 new mode 100755 index 0f1629e6..e1786c4a --- a/dak/stats.py +++ b/dak/stats.py @@ -32,7 +32,7 @@ import pg, sys import apt_pkg -import daklib.utils +import daklib.utils as 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) ################################################################################