From: Fredrik Tolf Date: Sun, 13 May 2012 03:43:33 +0000 (+0200) Subject: Merge branch 'master' into python3 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=7bcaef26c590cd10955848fbf313f41c78b8d1ce;p=wrw.git Merge branch 'master' into python3 Conflicts: wrw/resp.py --- 7bcaef26c590cd10955848fbf313f41c78b8d1ce diff --cc wrw/resp.py index 4840799,9ad22d1..bc8f2db --- a/wrw/resp.py +++ b/wrw/resp.py @@@ -1,4 -1,6 +1,6 @@@ -import dispatch, proto, env -from sp import xhtml +from . import dispatch, proto, env ++from .sp import xhtml + h = xhtml.cons() __all__ = ["skeleton", "skelfor", "setskel", "usererror"] @@@ -37,18 -27,18 +27,18 @@@ def setskel(req, skel) req.item(getskel)[0] = skel class usererror(dispatch.restart): - def __init__(self, message, detail): + def __init__(self, message, *detail): - super(usererror, self).__init__() + super().__init__() self.message = message self.detail = detail def handle(self, req): - return [skelfor(req).error(self.message, self.detail).encode("utf-8")] + return xhtml.forreq(req, skelfor(req).error(self.message, *self.detail)) class message(dispatch.restart): - def __init__(self, message, detail): - def __init__(self, msg, *detail): - super(message, self).__init__() - self.message = msg ++ def __init__(self, message, *detail): + super().__init__() + self.message = message self.detail = detail def handle(self, req): @@@ -59,8 -49,8 +49,8 @@@ class httperror(usererror) if message is None: message = proto.statusinfo[status][0] if detail is None: - detail = proto.statusinfo[status][1] - super().__init__(message, detail) + detail = (proto.statusinfo[status][1],) - super(httperror, self).__init__(message, *detail) ++ super().__init__(message, *detail) self.status = status def handle(self, req):