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;hp=babf3e21cb06bf867e3ec98003d4a077090b8839 Merge branch 'master' into python3 Conflicts: wrw/sp/cons.py wrw/sp/xhtml.py --- diff --git a/wrw/sp/cons.py b/wrw/sp/cons.py index c4d9999..205de03 100644 --- a/wrw/sp/cons.py +++ b/wrw/sp/cons.py @@ -59,7 +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[str(k)] = str(v) class constructor(object): def __init__(self, ns, elcls=element, ctx=None): diff --git a/wrw/sp/xhtml.py b/wrw/sp/xhtml.py index 5f1ca45..50c70b6 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 = 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()