18 def simpleerror(env, startreq, code, title, msg):
19 buf = """<?xml version="1.0" encoding="US-ASCII"?>
20 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
21 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
29 </html>""" % (title, title, htmlquote(msg))
30 startreq("%i %s" % (code, title), [("Content-Type", "text/html"), ("Content-Length", str(len(buf)))])
34 return time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime(ts))
39 if tz[0] != " " or (tz[1] != "+" and tz[1] != "-") or not tz[2:].isdigit():
42 tz = (((tz / 100) * 60) + (tz % 100)) * 60
43 return time.mktime(time.strptime(dstr, "%a, %d %b %Y %H:%M:%S")) - tz - time.altzone