From 84024407d70c5d69b6d4f500563804c887175c96 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Tue, 1 Sep 2009 10:56:54 +0200 Subject: [PATCH] Quote URLs in hrefs --- tests/genhtml.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/genhtml.py b/tests/genhtml.py index f6f55c5..1302ad8 100755 --- a/tests/genhtml.py +++ b/tests/genhtml.py @@ -3,6 +3,7 @@ import os; import dircache; import sys; +import urllib os.chdir(sys.argv[1]) @@ -25,7 +26,7 @@ class Axis: def getLabel(self, v): if self.type == "clck": return v+" MHz" - elif self.type == "test": return "%s"%(v, v) + elif self.type == "test": return "%s"%(urllib.quote(v), v) else: return v @@ -71,11 +72,11 @@ td { border: 1px solid lightgray; padding: 4px;} for ps in pagesets: print >>html, "View only %s: " % str(ps.values) for v in ps.values: - print >>html, "%s | "%(ps.values.type, v, v) + print >>html, "%s | "%(ps.values.type, urllib.quote(v), v) print >>html, "
" print >>html, "" for x in self.xvals.labels(): - print >>html, "" % x + print >>html, "" % x print >>html, "" for y in self.yvals: print >>html, "" % self.yvals.getLabel(y) @@ -86,7 +87,7 @@ td { border: 1px solid lightgray; padding: 4px;} dthumb = d+"thumb" try: for img in dircache.listdir(dthumb): - print >>html, "" % (d, img, d, img) + print >>html, "" % (urllib.quote(d), img, urllib.quote(d), img) except OSError: print "warning: no images in %s?"%dthumb print >>html, "" -- 2.39.2
%s%s
%s