[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/security] Use "import daklib.foo as foo" style



---
 ChangeLog             |    1 +
 dak/compare_suites.py |   18 +++++++++---------
 2 files changed, 10 insertions(+), 9 deletions(-)
 mode change 100644 => 100755 dak/compare_suites.py

diff --git a/ChangeLog b/ChangeLog
index 55da667..ff8cecb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
 	* dak/clean_proposed_updates.py: likewise
 	* dak/clean_queues.py: likewise
 	* dak/clean_suites.py: likewise
+	* dak/compare_suites.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/compare_suites.py b/dak/compare_suites.py
old mode 100644
new mode 100755
index e94d9f5..a3df829
--- a/dak/compare_suites.py
+++ b/dak/compare_suites.py
@@ -22,8 +22,8 @@
 
 import pg, sys
 import apt_pkg
-import daklib.database
-import daklib.utils
+import daklib.database as database
+import daklib.utils as utils
 
 ################################################################################
 
@@ -44,7 +44,7 @@ Looks for fixable descrepancies between stable and unstable.
 def main ():
     global Cnf, projectB
 
-    Cnf = daklib.utils.get_conf()
+    Cnf = utils.get_conf()
     Arguments = [('h',"help","Compare-Suites::Options::Help")]
     for i in [ "help" ]:
         if not Cnf.has_key("Compare-Suites::Options::%s" % (i)):
@@ -57,15 +57,15 @@ 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)
 
     src_suite = "stable"
     dst_suite = "unstable"
 
-    src_suite_id = daklib.database.get_suite_id(src_suite)
-    dst_suite_id = daklib.database.get_suite_id(dst_suite)
-    arch_all_id = daklib.database.get_architecture_id("all")
-    dsc_type_id = daklib.database.get_override_type_id("dsc")
+    src_suite_id = database.get_suite_id(src_suite)
+    dst_suite_id = database.get_suite_id(dst_suite)
+    arch_all_id = database.get_architecture_id("all")
+    dsc_type_id = database.get_override_type_id("dsc")
 
     for arch in Cnf.ValueList("Suite::%s::Architectures" % (src_suite)):
         if arch == "source":
@@ -77,7 +77,7 @@ def main ():
 
         if arch == "all":
             continue
-        arch_id = daklib.database.get_architecture_id(arch)
+        arch_id = database.get_architecture_id(arch)
         q = projectB.query("""
 SELECT b_src.package, b_src.version, a.arch_string
   FROM binaries b_src, bin_associations ba, override o, architecture a
-- 
1.5.6.5



Reply to: