X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=wrw%2Fsp%2Fxhtml.py;h=f10d3158fe53fdc2eb8e5c6140b8e9feb53fef72;hb=4c4dcf7a020ed52ea9d8d9048dbd62ffa3a7d54d;hp=3c6c0f6898333ae89a28bc01b5a106fa17325b05;hpb=af9ecd26fa64bc8f9890952f2d9e6b6147650416;p=wrw.git diff --git a/wrw/sp/xhtml.py b/wrw/sp/xhtml.py index 3c6c0f6..f10d315 100644 --- a/wrw/sp/xhtml.py +++ b/wrw/sp/xhtml.py @@ -19,7 +19,7 @@ class xhtmlcontext(_cons.context): def addattr(self, node, k, v): k = unicode(k) - node.attrs[self.attrmap.get(k, k)] = unicode(v) + super(xhtmlcontext, self).addattr(node, self.attrmap.get(k, k), v) def cons(ctx=None): if ctx is None: ctx = xhtmlcontext() @@ -53,9 +53,12 @@ def forreq(req, tree): req.ohead["Content-Type"] = "text/html; charset=utf-8" buf = StringIO.StringIO() htmlindenter.output(buf, tree, doctype=(doctype, dtd), charset="utf-8") - return [buf.getvalue()] + ret = buf.getvalue() + req.ohead["Content-Length"] = len(ret) + return [ret] def xhtmlresp(callable): def wrapper(req): return forreq(req, callable(req)) + wrapper.__wrapped__ = callable return wrapper