From: Fredrik Tolf Date: Wed, 16 Jan 2013 00:16:25 +0000 (+0100) Subject: Added a simpleerror function. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=d740aa68a4d205076b2d132067ac2c31ceb3cd2e;p=wrw.git Added a simpleerror function. --- diff --git a/wrw/proto.py b/wrw/proto.py index 8474b3a..4cf1951 100644 --- a/wrw/proto.py +++ b/wrw/proto.py @@ -85,6 +85,22 @@ def htmlq(html): ret += c return ret +def simpleerror(env, startreq, code, title, msg): + buf = """ + + + +%s + + +

%s

+

%s

+ + +""" % (title, title, htmlq(msg)) + startreq("%i %s" % (code, title), [("Content-Type", "text/html"), ("Content-Length", str(len(buf)))]) + return [buf] + def urlq(url): ret = "" for c in url: