@@ -0,0 +1,2072 @@
+%22%22%22%0A    wtforms.widgets%0A    ~~~~~~~~~~~~~~~%0A    %0A    The WTForms widget system.%0A    %0A    :copyright: 2009 by James Crasta, Thomas Johansson.%0A    :license: MIT, see LICENSE.txt for details.%0A%22%22%22%0Afrom cgi import escape%0A%0A__all__ = (%0A    'ListWidget', 'TextInput', 'PasswordInput', 'HiddenInput', 'CheckboxInput',%0A    'RadioInput', 'Textarea', 'Select'%0A)%0A%0Adef html_params(**kwargs):%0A    %22%22%22%0A    Generate HTML parameters for keywords%0A    %22%22%22%0A    params = %5B%5D%0A    keys = kwargs.keys()%0A    keys.sort()%0A    for k in keys:%0A        if k in ('class_', 'class__'):%0A            k = k%5B:-1%5D%0A        k = unicode(k)%0A        v = escape(unicode(kwargs%5Bk%5D), quote=True)%0A        params.append(u'%25s=%22%25s%22' %25 (k, v))%0A    return str.join(' ', params)%0A%0Aclass Widget(object):%0A    %22%22%22%0A    Base class for all WTForms widgets.%0A    %22%22%22%0A    def render(self, field, **kwargs):%0A        %22%22%22%0A        Renders the widget. All widgets must implement this.%0A        %0A        %60field%60%0A            The field to render.%0A        %60**kwargs%60%0A            Any parameters used for rendering. Typically used to override or%0A            pass extra html attributes.%0A        %22%22%22%0A        raise NotImplementedError()%0A%0Aclass ListWidget(Widget):%0A    def __init__(self, parent_tag='ul', prefix_label=True):%0A        assert parent_tag in ('ol', 'ul')%0A        self.parent_tag = parent_tag%0A        self.prefix_label = prefix_label%0A%0A    def render(self, field, **kwargs):%0A        html = %5Bu'%3C%25s %25s%3E' %25 (self.parent_tag, html_params(**kwargs))%5D%0A        for subfield in field:%0A            if self.prefix_label:%0A                html.append(u'%3Cli%3E%25s: %25s%3C/li%3E' %25 (subfield.label, subfield()))%0A            else:%0A                out.append(u'%3Cli%3E%25s%25s%3C/li%3E' %25 (subfield(), subfield.label))%0A        html.append(u'%3C/%25s%3E' %25 self.parent_tag)%0A        return ''.join(html)%0A%0Aclass Input(Widget):%0A    pass%0A%0Aclass TextInput(Input):%0A    pass%0A    %0Aclass PasswordInput(Input):%0A    pass%0A%0Aclass HiddenInput(Input):%0A    pass%0A%0Aclass CheckboxInput(Input):%0A    pass%0A%0Aclass RadioInput(Input):%0A    pass%0A%0Aclass Textarea(Widget):%0A    pass%0A%0Aclass Select(Widget):%0A    pass%0A

Add rough first implementation of widgets.py