@@ -628,44 +628,20 @@ def html4_cgi_escape_attrs(**attrs):
628
628
for k , v in sorted (attrs .items ())])
629
629
630
630
631
- def xhtml_cgi_escape_attrs (** attrs ):
632
- ''' Boolean attributes like 'disabled', 'required'
633
- are represented with a value that is the same as
634
- the attribute name.. E.G.
635
- <input required="required" ...> not <input required ..>
636
- The latter is html4 or 5. Recognize booleans by:
637
- value is None
638
- Code can use None to indicate a pure boolean.
639
- '''
640
- return ' ' .join (['%s="%s"' % (k , html_escape (str (v ), True ))
641
- if v is not None else '%s="%s"' % (k , k )
642
- for k , v in sorted (attrs .items ())])
643
-
644
-
645
631
def input_html4 (** attrs ):
646
632
"""Generate an 'input' (html4) element with given attributes"""
647
633
_set_input_default_args (attrs )
648
634
return '<input %s>' % html4_cgi_escape_attrs (** attrs )
649
635
650
636
651
- def input_xhtml (** attrs ):
652
- """Generate an 'input' (xhtml) element with given attributes"""
653
- _set_input_default_args (attrs )
654
- return '<input %s/>' % xhtml_cgi_escape_attrs (** attrs )
655
-
656
-
657
637
class HTMLInputMixin (object ):
658
638
""" requires a _client property """
659
639
def __init__ (self ):
660
640
html_version = 'html4'
661
641
if hasattr (self ._client .instance .config , 'HTML_VERSION' ):
662
642
html_version = self ._client .instance .config .HTML_VERSION
663
- if html_version == 'xhtml' :
664
- self .input = input_xhtml
665
- self .cgi_escape_attrs = xhtml_cgi_escape_attrs
666
- else :
667
- self .input = input_html4
668
- self .cgi_escape_attrs = html4_cgi_escape_attrs
643
+ self .input = input_html4
644
+ self .cgi_escape_attrs = html4_cgi_escape_attrs
669
645
# self._context is used for translations.
670
646
# will be initialized by the first call to .gettext()
671
647
self ._context = None
0 commit comments