X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=inline;f=dak%2Fexamine_package.py;h=c7ab7ad5865c8d9619cd9951acc8086e2610bbad;hb=d9cd7737b5c0c8af304a54c6c744d1e83e3b6ff9;hp=ae3ec6c9c4e4b4f7f22d1468b4e859e9b6abe4f9;hpb=c9e12bb14c839b31d48db95406b4497bb4cdffde;p=dak.git
diff --git a/dak/examine_package.py b/dak/examine_package.py
index ae3ec6c9..c7ab7ad5 100755
--- a/dak/examine_package.py
+++ b/dak/examine_package.py
@@ -55,9 +55,6 @@ re_version = re.compile('^(.*)\((.*)\)')
re_newlinespace = re.compile('\n')
re_spacestrip = re.compile('(\s)')
-html_escaping = {'"':'"', '&':'&', '<':'<', '>':'>'}
-re_html_escaping = re.compile('|'.join(map(re.escape, html_escaping.keys())))
-
################################################################################
Cnf = None
@@ -89,12 +86,9 @@ PACKAGE can be a .changes, .dsc, .deb or .udeb filename."""
################################################################################
# probably xml.sax.saxutils would work as well
-def html_escape(s):
- return re_html_escaping.sub(lambda x: html_escaping.get(x.group(0)), s)
-
def escape_if_needed(s):
if use_html:
- return re_html_escaping.sub(lambda x: html_escaping.get(x.group(0)), s)
+ return utils.re_html_escaping.sub(lambda x: utils.html_escaping.get(x.group(0)), s)
else:
return s
@@ -103,9 +97,9 @@ def headline(s, level=2, bodyelement=None):
if bodyelement:
print """
- """%{"bodyelement":bodyelement,"title":html_escape(s)}
+ """%{"bodyelement":bodyelement,"title":utils.html_escape(s)}
else:
- print "%(title)s (click to toggle)
%s" % (html_escape(s)) + return "
%s" % (utils.html_escape(s)) else: return s