Fix html module bugs
authorTero Marttila <terom@fixme.fi>
Wed, 22 Dec 2010 02:51:41 +0200
changeset 5 c72e0314b930
parent 4 b3a1ab44f517
child 6 72c73df76db2
Fix html module bugs
svv/html.py
--- a/svv/html.py	Mon Dec 20 23:15:08 2010 +0200
+++ b/svv/html.py	Wed Dec 22 02:51:41 2010 +0200
@@ -189,7 +189,7 @@
 
         return ((k.rstrip('_'), v) for k, v in attrs.iteritems() if v is not None)
 
-    def __init__ (self, name, *contents, **attrs) :
+    def __init__ (self, _name, *contents, **attrs) :
         """
             Construct tag with given name/attributes or contents.
 
@@ -203,13 +203,15 @@
             Tag('foo', 'quux', bar=5)
             >>> Tag('foo', class_='ten')
             Tag('foo', class='ten')
+            >>> Tag('bar', name='foo')
+            Tag('bar', name='foo')
         """
         
         # store contents as container
         super(Tag, self).__init__(*contents)
         
         # store postprocessed stuff
-        self.name = name
+        self.name = _name
         self.attrs = dict(self.process_attrs(attrs))
 
     def __call__ (self, *contents, **attrs) :