from common import htmlEncode #import py2html, PyFontify import PySourceColor import converter_registry def convert_html(page, text, mime_type): return text converter_registry.register(convert_html, 'text/html') def convert_text(page, text, mime_type): return '''
%s''' % (page.sourceLinkForMimeType(mime_type), htmlEncode(text)) converter_registry.register(convert_text, 'text/*') def convert_application(page, text, mime_type): return ''' View file (%s) ''' % (page.sourceLinkForMimeType(mime_type), mime_type) converter_registry.register(convert_application, 'application/*') def convert_image(page, text, mime_type): attrs = '' if page.width: attrs += ' width="%i"' % page.width if page.height: attrs += ' height="%i"' % page.height return '