def htmlTuple(l): io = StringIO.StringIO() w = io.write w('<div class="list tuple"><span class="heading">Tuple instance @ %s</span>' % hex(id(l))) for i in l: w('<div class="listItem">%s</div>' % util.htmlrepr(i)) w('</div>') return io.getvalue()
def htmlFormNode(d): io = StringIO.StringIO() w = io.write w('<div class="dict formnode"><span class="heading">FormNode instance @ %s</span>' % hex(id(d))) w('<table class="dict">') keys = d.keys() if not(isinstance(d, OrderedDict)): keys.sort() for k in keys: w('<tr><td class="dictKey">%s</td><td class="dictValue">%s</td></tr>' % (util.htmlrepr(k), htmlFormNode(d[k]))) attribsrepr = dictFormatMaker('attributes dictionary') w('<tr><td class="attribs" colspan="2">%s</td></tr>' % (attribsrepr(d.attributes))) w('</table>') w('</div>') return io.getvalue()
def _htmlDict(d): io = StringIO.StringIO() w = io.write w('<div class="dict %s"><span class="heading">%s instance @ %s</span>' % (name.lower(), name, hex(id(d)))) w('<table class="dict">') keys = d.keys() if not(isinstance(d, OrderedDict)): keys.sort() for k in keys: if k == '__builtins__': v = 'builtin dictionary' else: v = d[k] w('<tr><td class="dictKey">%s</td><td class="dictValue">%s</td></tr>' % (util.htmlrepr(k), util.htmlrepr(v))) w('</table></div>') return io.getvalue()
def _miniFieldStorageValue(v): return util.htmlrepr(v.value)