-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"]
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):
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):