]> err.no Git - dak/commitdiff
Use "import daklib.foo as foo" style
authorJoerg Jaspert <joerg@debian.org>
Sat, 3 May 2008 23:50:13 +0000 (01:50 +0200)
committerJoerg Jaspert <joerg@debian.org>
Sat, 3 May 2008 23:50:13 +0000 (01:50 +0200)
ChangeLog
dak/examine_package.py
dak/find_null_maintainers.py [changed mode: 0644->0755]

index cb42ab4ce8351b57df26982f17ed7efe6e3572d7..a45a7ebcc3183b90be34f2791e98bbed8ea0b099 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2008-05-04  Joerg Jaspert  <joerg@debian.org>
 
+       * dak/examine_package.py: remove daklib.queue import, never used
+
        * dak/check_proposed_updates.py: Import stuff from daklib as
        "import daklib.foo as foo"
        * dak/clean_proposed_updates.py: likewise
@@ -7,6 +9,8 @@
        * dak/clean_suites.py: likewise
        * dak/compare_suites.py: likewise
        * dak/cruft_report.py: likewise
+       * dak/examine_package.py: likewise
+       * dak/find_null_maintainers.py: likewise
 
        * dak/check_archive.py (check_files_not_symlinks): Remove
        long-time unused and commented code. Import stuff from daklib as
index 3161428de9919f9563a86752a1cb108cb858831b..81191d257616963e492512d62aa94f2e44520f3c 100755 (executable)
@@ -34,7 +34,8 @@
 
 import errno, os, pg, re, sys, md5
 import apt_pkg, apt_inst
-import daklib.database, daklib.utils, daklib.queue
+import daklib.database as database
+import daklib.utils as utils
 
 ################################################################################
 
@@ -62,9 +63,9 @@ re_html_escaping = re.compile('|'.join(map(re.escape, html_escaping.keys())))
 Cnf = None
 projectB = None
 
-Cnf = daklib.utils.get_conf()
+Cnf = utils.get_conf()
 projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]))
-daklib.database.init(Cnf, projectB)
+database.init(Cnf, projectB)
 
 printed_copyrights = {}
 
@@ -225,7 +226,7 @@ def read_control (filename):
     maintainer = ''
     arch = ''
 
-    deb_file = daklib.utils.open_file(filename)
+    deb_file = utils.open_file(filename)
     try:
         extracts = apt_inst.debExtractControl(deb_file)
         control = apt_pkg.ParseSection(extracts)
@@ -279,9 +280,9 @@ def read_control (filename):
 def read_changes_or_dsc (filename):
     dsc = {}
 
-    dsc_file = daklib.utils.open_file(filename)
+    dsc_file = utils.open_file(filename)
     try:
-        dsc = daklib.utils.parse_changes(filename)
+        dsc = utils.parse_changes(filename)
     except:
         return formatted_text("can't parse .dsc control info")
     dsc_file.close()
@@ -457,7 +458,7 @@ def check_deb (deb_filename):
 # Read a file, strip the signature and return the modified contents as
 # a string.
 def strip_pgp_signature (filename):
-    file = daklib.utils.open_file (filename)
+    file = utils.open_file (filename)
     contents = ""
     inside_signature = 0
     skip_next = 0
@@ -489,8 +490,8 @@ def display_changes(changes_filename):
 def check_changes (changes_filename):
     display_changes(changes_filename)
 
-    changes = daklib.utils.parse_changes (changes_filename)
-    files = daklib.utils.build_file_list(changes)
+    changes = utils.parse_changes (changes_filename)
+    files = utils.build_file_list(changes)
     for f in files.keys():
         if f.endswith(".deb") or f.endswith(".udeb"):
             check_deb(f)
@@ -501,7 +502,7 @@ def check_changes (changes_filename):
 def main ():
     global Cnf, projectB, db_files, waste, excluded
 
-#    Cnf = daklib.utils.get_conf()
+#    Cnf = utils.get_conf()
 
     Arguments = [('h',"help","Examine-Package::Options::Help"),
                  ('H',"html-output","Examine-Package::Options::Html-Output"),
@@ -533,7 +534,7 @@ def main ():
                 elif f.endswith(".dsc"):
                     check_dsc(f)
                 else:
-                    daklib.utils.fubar("Unrecognised file type: '%s'." % (f))
+                    utils.fubar("Unrecognised file type: '%s'." % (f))
             finally:
                 if not Options["Html-Output"]:
                     # Reset stdout here so future less invocations aren't FUBAR
@@ -541,12 +542,12 @@ def main ():
                     sys.stdout = stdout_fd
         except IOError, e:
             if errno.errorcode[e.errno] == 'EPIPE':
-                daklib.utils.warn("[examine-package] Caught EPIPE; skipping.")
+                utils.warn("[examine-package] Caught EPIPE; skipping.")
                 pass
             else:
                 raise
         except KeyboardInterrupt:
-            daklib.utils.warn("[examine-package] Caught C-c; skipping.")
+            utils.warn("[examine-package] Caught C-c; skipping.")
             pass
 
 #######################################################################################
old mode 100644 (file)
new mode 100755 (executable)
index 727ed31..c4e457f
@@ -21,7 +21,7 @@
 
 import ldap, pg, sys, time
 import apt_pkg
-import daklib.utils
+import daklib.utils as utils
 
 ################################################################################
 
@@ -50,7 +50,7 @@ def get_ldap_value(entry, value):
 def main():
     global Cnf, projectB
 
-    Cnf = daklib.utils.get_conf()
+    Cnf = utils.get_conf()
     Arguments = [('h',"help","Find-Null-Maintainers::Options::Help")]
     for i in [ "help" ]:
         if not Cnf.has_key("Find-Null-Maintainers::Options::%s" % (i)):