re_srchasver = re.compile(r"^(\S+)\s+\((\S+)\)$")
+html_escaping = {'"':'"', '&':'&', '<':'<', '>':'>'}
+re_html_escaping = re.compile('|'.join(map(re.escape, html_escaping.keys())))
+
default_config = "/etc/dak/dak.conf"
default_apt_config = "/etc/dak/apt.conf"
################################################################################
+def html_escape(s):
+ return re_html_escaping.sub(lambda x: html_escaping.get(x.group(0)), s)
+
+################################################################################
+
def open_file(filename, mode='r'):
try:
f = open(filename, mode)
format = format[:2]
if is_a_dsc:
- if format != (1,0):
+ # format = (1,0) are the only formats we currently accept,
+ # format = (0,0) are missing format headers of which we still
+ # have some in the archive.
+ if format != (1,0) and format != (0,0):
raise UnknownFormatError, "%s" % (changes.get("format","0.0"))
else:
if (format < (1,5) or format > (1,8)):