From: Fredrik Tolf Date: Sun, 15 Sep 2013 22:41:53 +0000 (+0200) Subject: Merge branch 'master' into python3 X-Git-Url: http://dolda2000.com/gitweb/?p=wrw.git;a=commitdiff_plain;h=d38b200493b3ed263dbf10581d6d204462ed68c4 Merge branch 'master' into python3 Conflicts: wrw/sp/cons.py wrw/sp/xhtml.py --- d38b200493b3ed263dbf10581d6d204462ed68c4 diff --cc wrw/sp/cons.py index c4d9999,4052dce..205de03 --- a/wrw/sp/cons.py +++ b/wrw/sp/cons.py @@@ -59,7 -60,8 +59,8 @@@ class context(object) node.children.append(self.nodefrom(child)) def addattr(self, node, k, v): - node.attrs[str(k)] = str(v) + if v is not None: - node.attrs[unicode(k)] = unicode(v) ++ node.attrs[str(k)] = str(v) class constructor(object): def __init__(self, ns, elcls=element, ctx=None): diff --cc wrw/sp/xhtml.py index 5f1ca45,f10d315..50c70b6 --- a/wrw/sp/xhtml.py +++ b/wrw/sp/xhtml.py @@@ -15,11 -15,11 +15,11 @@@ class htmlelement(_cons.element) return doc class xhtmlcontext(_cons.context): - attrmap = {u"klass": u"class"} + attrmap = {"klass": "class"} def addattr(self, node, k, v): - k = unicode(k) - super(xhtmlcontext, self).addattr(node, self.attrmap.get(k, k), v) + k = str(k) - node.attrs[self.attrmap.get(k, k)] = str(v) ++ super().addattr(node, self.attrmap.get(k, k), v) def cons(ctx=None): if ctx is None: ctx = xhtmlcontext()