"""Default mask for the form.py module"""
import warnings
warnings.warn("cherrypy.lib.defaultformmask is deprecated and might disappear in future versions of CherryPy", DeprecationWarning, stacklevel = 2)
from xml.sax.saxutils import quoteattr as q
def selected(value):
"""If value is True, return a valid XHTML 'selected' attribute, else ''."""
if value:
return ' selected="selected" '
return ''
def checked(value):
"""If value is True, return a valid XHTML 'checked' attribute, else ''."""
if value:
return ' checked="checked" '
return ''
def defaultMask(field):
res = ["
",
"
%s
" % field.label]
if field.typ == 'text':
res.append('