]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blobdiff - wwwbin/dump-packagenames.py
Make ftp tools python3 ready
[projects/pld-ftp-admin.git] / wwwbin / dump-packagenames.py
index 59f9e89e5d52258af0534530a876ec11d9880930..963026f71686dbc62bdf0a72142a1e0b3702ebc1 100755 (executable)
@@ -1,5 +1,7 @@
 #!/usr/bin/python
 
+from __future__ import print_function
+
 import os
 import re
 
@@ -36,7 +38,7 @@ for dir in dirs:
                try:
                        hdr = ts.hdrFromFdno(fdno)
                except Exception, e:
-                       print "hdrFromFdno: %s: %s" % (rpm_file, e)
+                       print("hdrFromFdno: %s: %s" % (rpm_file, e))
                        os.close(fdno)
                        continue
                os.close(fdno)
@@ -45,13 +47,13 @@ for dir in dirs:
                sourcerpm = hdr[rpm.RPMTAG_SOURCERPM]
                m = re_nvr.match(sourcerpm)
                if not m:
-                       print "%s: doesn't match src.rpm file name" % (sourcerpm)
+                       print("%s: doesn't match src.rpm file name" % (sourcerpm))
                        continue
                srcname = m.group(1)
                pkgs[name] = srcname
 
 f = open(outname + ".tmp", "w")
-for (pkg, spkg) in pkgs.iteritems():
+for (pkg, spkg) in iter(pkgs.items()):
        f.write("%s:%s\n" % (pkg, spkg))
 f.close()
 os.chmod(outname + ".tmp", 0644)
This page took 0.043518 seconds and 4 git commands to generate.