From d740aa68a4d205076b2d132067ac2c31ceb3cd2e Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Wed, 16 Jan 2013 01:16:25 +0100 Subject: [PATCH] Added a simpleerror function. --- wrw/proto.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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: -- 2.11.0