]> TLD Linux GIT Repositories - tld-builder.git/blobdiff - TLD_Builder/request.py
- more python3 fixes, dropped python2 support
[tld-builder.git] / TLD_Builder / request.py
index 7638bf2f73b8701d87cf5a1682d9e1eb2e213d9e..25ca994b844a9d6a4a9528f8713d473863053f54 100644 (file)
@@ -8,7 +8,7 @@ import xml.sax.saxutils
 import fnmatch
 import os
 import urllib
-import cgi
+import html
 import pytz
 import tempfile
 import subprocess
@@ -333,15 +333,15 @@ class Batch:
             r = subprocess.call(cmd, shell=True)
             if r == 0:
                 package_url = "http://git.tld-linux.org/?p=packages/%(package)s.git;a=blob;f=%(spec)s;hb=%(branch)s" % {
-                    'spec': urllib.quote(self.spec),
-                    'branch': urllib.quote(self.branch),
-                    'package': urllib.quote(self.spec[:-5]),
+                    'spec': urllib.parse.quote(self.spec),
+                    'branch': urllib.parse.quote(self.branch),
+                    'package': urllib.parse.quote(self.spec[:-5]),
                 }
             else:
                 package_url = "http://git.pld-linux.org/gitweb.cgi?p=packages/%(package)s.git;f=%(spec)s;h=%(branch)s;a=shortlog" % {
-                    'spec': urllib.quote(self.spec),
-                    'branch': urllib.quote(self.branch),
-                    'package': urllib.quote(self.spec[:-5]),
+                    'spec': urllib.parse.quote(self.spec),
+                    'branch': urllib.parse.quote(self.branch),
+                    'package': urllib.parse.quote(self.spec[:-5]),
                 }
             desc = "%(src_rpm)s (<a href=\"%(package_url)s\">%(spec)s -r %(branch)s</a>%(rpmopts)s)" % {
                 'src_rpm': self.src_rpm,
@@ -380,7 +380,7 @@ class Batch:
                 tree_name = '-'.join(bld[:-1])
                 tree_arch = '-'.join(bld[-1:])
                 link_pre = "<a href=\"http://buildlogs.tld-linux.org/index.php?dist=%s&arch=%s&name=%s&id=%s&action=download\">" \
-                    % (urllib.quote(tree_name), urllib.quote(tree_arch), urllib.quote(bl_name), urllib.quote(rid))
+                    % (urllib.parse.quote(tree_name), urllib.parse.quote(tree_arch), urllib.parse.quote(bl_name), urllib.parse.quote(rid))
                 link_post = "</a>"
 
             def ftime(s):
@@ -399,7 +399,7 @@ class Batch:
                     'color' : c,
                     'builder' : b,
                     'status' : s,
-                    'tooltip' : cgi.escape(tooltip, True),
+                    'tooltip' : html.escape(tooltip, True),
             }
             + link_post)
         f.write("%s]</small></li>\n" % ' '.join(builders))