def htRecord(record):
    html = []
    wr = html.append
    for key in sorted(record):
        htKey = htmlEncode(key)
        value = record[key]
        htValue = None
        if hasattr(value, '__name__'):
            htValue = value.__name__
        if (key == 'mtime'):
            htValue = ('%s (%s)' % (time.asctime(time.localtime(value)), value))
        if (not htValue):
            htValue = htmlEncode(str(value))
        wr(('<tr><th>%s</th><td>%s</td></tr>' % (htKey, htValue)))
    return '\n'.join(html)
def htRecord(record):
    html = []
    wr = html.append
    for key in sorted(record):
        htKey = htmlEncode(key)
        value = record[key]
        htValue = None
        if hasattr(value, '__name__'):
            htValue = value.__name__
        if (key == 'mtime'):
            htValue = ('%s (%s)' % (time.asctime(time.localtime(value)), value))
        if (not htValue):
            htValue = htmlEncode(str(value))
        wr(('<tr><th>%s</th><td>%s</td></tr>' % (htKey, htValue)))
    return '\n'.join(html)