]> git.decadent.org.uk Git - dak.git/blobdiff - dak/show_deferred.py
Implement check_reverse_depends function
[dak.git] / dak / show_deferred.py
index dce80987bd3d72238c466bb877fbf3e2a7241659..e7dded0f92393f846e88fad9f8aeebac4eabe84b 100755 (executable)
@@ -24,12 +24,7 @@ import sys, os, re, time
 import apt_pkg
 import rrdtool
 
-try:
-    # starting with squeeze
-    from debian import deb822
-except:
-    # up to lenny
-    from debian_bundle import deb822
+from debian import deb822
 
 from daklib.dbconn import *
 from daklib import utils
@@ -98,7 +93,7 @@ def footer():
      height="31" width="88"></a>
     """
     res += "</body></html>"
-    return res
+    return res.encode('utf-8')
 
 def table_header():
     return """<h1>Deferred uploads</h1>
@@ -173,7 +168,7 @@ RRA:MAX:0.5:288:795
         try:
             rc = rrdtool.create(*create)
             ru = rrdtool.update(*update)
-        except rrdtool.error, e:
+        except rrdtool.error as e:
             print('warning: queue_report: rrdtool error, skipping %s.rrd: %s' % (type, e))
     except NameError:
         pass
@@ -214,7 +209,7 @@ def get_upload_data(changesfn):
                     os.unlink(lfn)
                 if os.path.exists(qfn):
                     os.symlink(qfn,lfn)
-                    os.chmod(qfn, 0644)
+                    os.chmod(qfn, 0o644)
     return (max(delaydays-1,0)*24*60*60+remainingtime, changesname, delay, uploader, achanges.get('closes','').split(),achanges, delaydays)
 
 def list_uploads(filelist, rrd_dir):
@@ -224,7 +219,7 @@ def list_uploads(filelist, rrd_dir):
     print header()
     if uploads:
         print table_header()
-        print ''.join(map(lambda x: table_row(*x[1:5]), uploads))
+        print ''.join(map(lambda x: table_row(*x[1:5]), uploads)).encode('utf-8')
         print table_footer()
     else:
         print '<h1>Currently no deferred uploads to Debian</h1>'
@@ -274,7 +269,7 @@ def init():
                  ("p","link-path","Show-Deferred::LinkPath","HasArg"),
                  ("d","deferred-queue","Show-Deferred::DeferredQueue","HasArg"),
                  ('r',"rrd","Show-Deferred::Options::Rrd", "HasArg")]
-    args = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv)
+    args = apt_pkg.parse_commandline(Cnf,Arguments,sys.argv)
     for i in ["help"]:
         if not Cnf.has_key("Show-Deferred::Options::%s" % (i)):
             Cnf["Show-Deferred::Options::%s" % (i)] = ""
@@ -283,7 +278,7 @@ def init():
             print >> sys.stderr, """Show-Deferred::%s is mandatory.
   set via config file or command-line option %s"""%(i,j)
 
-    Options = Cnf.SubTree("Show-Deferred::Options")
+    Options = Cnf.subtree("Show-Deferred::Options")
     if Options["help"]:
         usage()