[Blends-commit] [SCM] website branch, master, updated. ef20a015a3c2b310cc94288217f8305720bb8a6c

Ole Streicher ole at aip.de
Wed Mar 9 15:40:33 UTC 2016


The following commit has been merged in the master branch:
commit ef20a015a3c2b310cc94288217f8305720bb8a6c
Author: Ole Streicher <ole at aip.de>
Date:   Wed Mar 9 16:39:36 2016 +0100

    Remove the special handling for %26/& in URLs
    This seems to be not needed anymore; ampersands are
    handled transparently.

diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index 0674f53..00d06dd 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -69,7 +69,7 @@ HOMEPAGENONEFIELDS = (
     'vcs-browser',  # Browser-URL to packaging stuff in Vcs
 )
 
-PKGURLMASK = 'http://packages.debian.org/search?keywords=%s%%26searchon=names%%26exact=1%%26suite=all%%26section=all'
+PKGURLMASK = 'http://packages.debian.org/search?keywords=%s&searchon=names&exact=1&suite=all&section=all'
 
 DEPENDENT  = 0
 SUGGESTED  = 1
@@ -1396,8 +1396,7 @@ class TaskDependencies:
                 elif key.lower() == 'pkg-url':
                     if dep is not None:
                         if dep.properties['pkg-url'] == HOMEPAGENONE:  # only if no official package is just available
-                            # Escape '&' in URLs with %26 (Trick stolen by pasting the URL into a search engine ;-))
-                            dep.properties['pkg-url'] = stanza['pkg-url'].replace("&", "%26")
+                            dep.properties['pkg-url'] = stanza['pkg-url']
                     else:
                         logger.error("Dep not initiated before Pkg-URL %s -> something is wrong."
                                      % stanza['pkg-url'])
diff --git a/webtools/tasks.py b/webtools/tasks.py
index c9c8d5c..8b1e2bd 100755
--- a/webtools/tasks.py
+++ b/webtools/tasks.py
@@ -239,12 +239,7 @@ for lang in languages:
         outputfile = os.path.join(
             outputdir, '{0}.{1}.html'.format(task, language_dict[lang]['short']))
         with codecs.open(outputfile, "w", "utf-8") as f:
-# We had to mask ampersand ('&') from Genshi but even if the browser shows
-# the correct character packages.debian.org gets confused - so turn it back here
-            for line in template.generate(**data).render('xhtml').splitlines():
-                if detect_ampersand_code_re.search(line):
-                    line = line.replace('%26', '&')
-                f.write(line + '\n')
+            f.write(template.generate(**data).render('xhtml'))
         SetFilePermissions(outputfile)
 
     template = loader.load('packagelist.xhtml')
diff --git a/webtools_py3/blendstasktools_udd.py b/webtools_py3/blendstasktools_udd.py
index f524f0d..a3afe48 100644
--- a/webtools_py3/blendstasktools_udd.py
+++ b/webtools_py3/blendstasktools_udd.py
@@ -69,7 +69,7 @@ HOMEPAGENONEFIELDS = (
     'vcs-browser',  # Browser-URL to packaging stuff in Vcs
 )
 
-PKGURLMASK = 'http://packages.debian.org/search?keywords=%s%%26searchon=names%%26exact=1%%26suite=all%%26section=all'
+PKGURLMASK = 'http://packages.debian.org/search?keywords=%s&searchon=names&exact=1&suite=all&section=all'
 
 DEPENDENT  = 0
 SUGGESTED  = 1
diff --git a/webtools_py3/tasks_udd.py b/webtools_py3/tasks_udd.py
index cb234c3..2339cf0 100755
--- a/webtools_py3/tasks_udd.py
+++ b/webtools_py3/tasks_udd.py
@@ -187,16 +187,7 @@ for lang in languages:
         outputfile = os.path.join(outputdir, '{0}.{1}.html'.format(task, lang))
         with codecs.open(outputfile, "w", "utf-8") as f:
             try:
-# We had to mask ampersand ('&') from Genshi but even if the browser shows
-# the correct character packages.debian.org gets confused - so turn it back here
-                for line in template.generate(**data).render('xhtml').splitlines():
-                    if detect_ampersand_code_re.search(line):
-                        line = re.sub('%26', '&', line)
-                    f.write(line + '\n')
-            except UnicodeDecodeError as err:
-                stderr.write("Some critical encoding problem occured when trying"
-                             + " to render task {0} for lang {1}.\n{2}\n"
-		             .format(task, lang, str(err)))
+                f.write(template.generate(**data).render('xhtml'))
             except UndefinedError as err:
                 stderr.write("UndefinedError while rendering"
                              + " task {0} for lang {1}.\n{2}\n"

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list