Commits

Andriy Kornatskyy committed d69ff5d

Do not use kwargs while call to Tag, explicitly set each argument

Comments (0)

Files changed (1)

src/wheezy/html/widgets.py

         >>> hidden('pref', 'abc')
         <input type="hidden" name="pref" value="abc" />
     """
-    return Tag('input', attrs={
+    return Tag('input', None, {
             'name': name,
             'type': 'hidden',
             'value': value
     }
     if attrs:
         tag_attrs.update(attrs)
-    return Tag('input', attrs=tag_attrs)
+    return Tag('input', None, tag_attrs)
 
 
 def password(name, value, attrs=None):
     }
     if attrs:
         tag_attrs.update(attrs)
-    return Tag('input', attrs=tag_attrs)
+    return Tag('input', None, tag_attrs)
 
 
 def textarea(name, value, attrs):
         tag_attrs['checked'] = 'checked'
     if attrs:
         tag_attrs.update(attrs)
-    return Tag('input', attrs=tag_attrs)
+    return Tag('input', None, tag_attrs)
 
 
 def multiple_checkbox(name, value, attrs):
         if attrs:
             tag_attrs.update(attrs)
         append(Tag('label',
-            Fragment((Tag('input', attrs=tag_attrs), text)), attrs=attrs))
+            Fragment((Tag('input', None, tag_attrs), text)), attrs))
     return Fragment(elements)
 
 
     }
     if attrs:
         tag_attrs.update(attrs)
-    return Tag('label', inner=value, attrs=tag_attrs)
+    return Tag('label', value, tag_attrs)
 
 
 def dropdown(name, value, attrs):
             selected="selected" value="1">Yellow</option></select>
     """
     choices = attrs.pop('choices')
-    options = Fragment([])
-    append = options.tags.append
+    options = []
+    append = options.append
     for key, text in choices:
         if key == value:
             tag_attrs = {
             tag_attrs = {
                     'value': key
             }
-        append(Tag('option', inner=text, attrs=tag_attrs))
+        append(Tag('option', text, tag_attrs))
     tag_attrs = {
             'id': id(name),
             'name': name
     }
     if attrs:
         tag_attrs.update(attrs)
-    return Tag('select', inner=options, attrs=tag_attrs)
+    return Tag('select', Fragment(options), tag_attrs)
 
 
 def listbox(name, value, attrs):
             selected="selected" value="1">Yellow</option></select>
     """
     choices = attrs.pop('choices')
-    options = Fragment([])
-    append = options.tags.append
+    options = []
+    append = options.append
     for key, text in choices:
         if key in value:
             tag_attrs = {
             tag_attrs = {
                     'value': key
             }
-        append(Tag('option', inner=text, attrs=tag_attrs))
+        append(Tag('option', text, tag_attrs))
     tag_attrs = {
             'id': id(name),
             'name': name,
     }
     if attrs:
         tag_attrs.update(attrs)
-    return Tag('select', inner=options, attrs=tag_attrs)
+    return Tag('select', Fragment(options), tag_attrs)
 
 
 def radio(name, value, attrs):
         if attrs:
             tag_attrs.update(attrs)
         append(Tag('label',
-            Fragment((Tag('input', attrs=tag_attrs), text)), attrs=attrs))
+            Fragment((Tag('input', None, tag_attrs), text)), attrs))
     return Fragment(elements)
 
 default = {