Merge branch 'master' into python3
authorFredrik Tolf <fredrik@dolda2000.com>
Sun, 15 Sep 2013 22:41:53 +0000 (00:41 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Sun, 15 Sep 2013 22:41:53 +0000 (00:41 +0200)
Conflicts:
wrw/sp/cons.py
wrw/sp/xhtml.py

1  2 
wrw/sp/cons.py
wrw/sp/xhtml.py

diff --cc 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
@@@ -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()