]> git.decadent.org.uk Git - dak.git/blobdiff - dak/show_deferred.py
Convert octal literals to Python 2.6 syntax.
[dak.git] / dak / show_deferred.py
index 6307bd384f59b1d1d8ee5bac66ff768733db6878..7352f71ea928d6bec94ee0b9654d339b174fa3f1 100755 (executable)
@@ -98,7 +98,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 +173,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 +214,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 +224,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>'
@@ -242,8 +242,9 @@ def list_uploads(filelist, rrd_dir):
 Delayed-Until: %s
 Delay-Remaining: %s"""%(time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(time.time()+u[0])),u[2])
                 print >> f, fields
-                print >> f, str(u[5]).rstrip()
-                open(os.path.join(Cnf["Show-Deferred::LinkPath"],u[1]),"w").write(str(u[5])+fields+'\n')
+                encoded = unicode(u[5]).encode('utf-8')
+                print >> f, encoded.rstrip()
+                open(os.path.join(Cnf["Show-Deferred::LinkPath"],u[1]),"w").write(encoded+fields+'\n')
                 print >> f
             f.close()
             os.rename(os.path.join(Cnf["Show-Deferred::LinkPath"],'.status.tmp'),