X-Git-Url: http://dolda2000.com/gitweb/?p=wrw.git;a=blobdiff_plain;f=wrw%2Fresp.py;h=bc8f2dbcc3adeead3a7bef308db9cbb3b65bd929;hp=9ad22d1126e2fb4af2852fb50b985c0533d07f4a;hb=7bcaef26c590cd10955848fbf313f41c78b8d1ce;hpb=ef04ec8791734c918a5b8940976bf3fde3618710 diff --git a/wrw/resp.py b/wrw/resp.py index 9ad22d1..bc8f2db 100644 --- a/wrw/resp.py +++ b/wrw/resp.py @@ -1,5 +1,5 @@ -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"] @@ -28,7 +28,7 @@ def setskel(req, skel): class usererror(dispatch.restart): def __init__(self, message, *detail): - super(usererror, self).__init__() + super().__init__() self.message = message self.detail = detail @@ -36,9 +36,9 @@ class usererror(dispatch.restart): return xhtml.forreq(req, skelfor(req).error(self.message, *self.detail)) class message(dispatch.restart): - 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): @@ -50,20 +50,20 @@ class httperror(usererror): message = proto.statusinfo[status][0] if detail is None: detail = (proto.statusinfo[status][1],) - super(httperror, self).__init__(message, *detail) + super().__init__(message, *detail) self.status = status def handle(self, req): req.status(self.status, self.message) - return super(httperror, self).handle(req) + return super().handle(req) class notfound(httperror): def __init__(self): - return super(notfound, self).__init__(404) + return super().__init__(404) class redirect(dispatch.restart): def __init__(self, url, status = 303): - super(redirect, self).__init__() + super().__init__() self.url = url self.status = status