PYME.util.mProfile.colorize_db_t module

mProfile syntax highlighting and profile results display

class PYME.util.mProfile.colorize_db_t.Parser(raw, times, counts, thresholdT=0.01, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)

Bases: object

Send colored python source.

Store the source text.

format()

Parse and send the colored source.

stylesheet = '<style type="text/css">\npre.code {\n    font-style: Lucida,"Courier New";\n}\n\n.number {\n    color: #0080C0;\n}\n.operator {\n    color: #000000;\n}\n.string {\n    color: #008000;\n}\n.comment {\n    color: #808080;\n}\n.name {\n    color: #000000;\n}\n.error {\n    color: #FF8080;\n    border: solid 1.5pt #FF0000;\n}\n.keyword {\n    color: #0000FF;\n    font-weight: bold;\n}\n.text {\n    color: #000000;\n}\n\n}\n\n\n</style>\n\n'
PYME.util.mProfile.colorize_db_t.colorize_file(times, counts, file=None, outstream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, standalone=True)

Convert a python source file into colorized HTML.

Reads file and writes to outstream (default sys.stdout). file can be a filename or a file-like object (only the read method is used). If file is None, act as a filter and read from sys.stdin. If standalone is True (default), send a complete HTML document with header and footer. Otherwise only a stylesheet and a <pre> section are written.