From ba3d9a19a9fdc6c316f2558ab6f2c2b68b67a7b9 Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Sun, 4 May 2008 02:15:07 +0200 Subject: [PATCH] Use "import daklib.foo as foo" style --- ChangeLog | 1 + dak/make_maintainers.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) mode change 100644 => 100755 dak/make_maintainers.py diff --git a/ChangeLog b/ChangeLog index 07064355..4b4d5221 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,7 @@ * dak/init_db.py: likewise * dak/init_dirs.py: likewise * dak/ls.py: likewise + * dak/make_maintainers.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/make_maintainers.py b/dak/make_maintainers.py old mode 100644 new mode 100755 index 077386a0..c3905af9 --- a/dak/make_maintainers.py +++ b/dak/make_maintainers.py @@ -27,8 +27,8 @@ import pg, sys import apt_pkg -import daklib.database -import daklib.utils +import daklib.database as database +import daklib.utils as utils ################################################################################ @@ -54,12 +54,12 @@ def fix_maintainer (maintainer): global fixed_maintainer_cache if not fixed_maintainer_cache.has_key(maintainer): - fixed_maintainer_cache[maintainer] = daklib.utils.fix_maintainer(maintainer)[0] + fixed_maintainer_cache[maintainer] = utils.fix_maintainer(maintainer)[0] return fixed_maintainer_cache[maintainer] def get_maintainer (maintainer): - return fix_maintainer(daklib.database.get_maintainer(maintainer)) + return fix_maintainer(database.get_maintainer(maintainer)) def get_maintainer_from_source (source_id): global maintainer_from_source_cache @@ -76,7 +76,7 @@ def get_maintainer_from_source (source_id): def main(): global Cnf, projectB - Cnf = daklib.utils.get_conf() + Cnf = utils.get_conf() Arguments = [('h',"help","Make-Maintainers::Options::Help")] if not Cnf.has_key("Make-Maintainers::Options::Help"): @@ -89,7 +89,7 @@ def main(): usage() projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])) - daklib.database.init(Cnf, projectB) + database.init(Cnf, projectB) for suite in Cnf.SubTree("Suite").List(): suite = suite.lower() @@ -130,9 +130,9 @@ def main(): # Process any additional Maintainer files (e.g. from pseudo packages) for filename in extra_files: - file = daklib.utils.open_file(filename) + file = utils.open_file(filename) for line in file.readlines(): - line = daklib.utils.re_comments.sub('', line).strip() + line = utils.re_comments.sub('', line).strip() if line == "": continue split = line.split() -- 2.39.5