""" $URL: svn+ssh://svn.mems-exchange.org/repos/trunk/qp/fill/html.qpy $ $Id: html.qpy 28351 2006-05-10 17:27:02Z dbinger $ """ from qpy import h8, stringify from urllib import quote as url_quote def htmltag [html] (tag, xml_end=False, css_class=None, **attrs): "<" tag if css_class is not None: attrs['class'] = css_class for (attr, val) in attrs.iteritems(): if val is not None: ' %s="%s"' % (attr, val) if xml_end: " />" else: ">" def href [html] (url, text, title=None, **attrs): htmltag("a", href=url, title=title, **attrs) text "" def dl [html] (tuples, **kwargs): htmltag('dl', **kwargs) for title, description in tuples: if title: '