Table of Contents

Module: py2html Twisted-0.19.0/admin/py2html.py

Python Highlighter Version: 0.7

py2html.py [options] files...

options: -h print help - read from stdin, write to stdout -stdout read from files, write to stdout -files read from files, write to filename+.html (default) -format: html output XHTML page (default) rawhtml output pure XHTML (without headers, titles, etc.) -mode: color output in color (default) mono output b/w (for printing) -title:Title use Title as title of the generated page -bgcolor:color use color as background-color for page -header:file use contents of file as header -footer:file use contents of file as footer -URL replace all occurances of URL: link with '<a href="link">link</a>'; this is always enabled in CGI mode -v verbose

Takes the input, assuming it is Python code and formats it into colored XHTML. When called without parameters the script tries to work in CGI mode. It looks for a field script=URL and tries to use that URL as input file. If it can't find this field, the path info (the part of the URL following the CGI script name) is tried. In case no host is given, the host where the CGI script lives and HTTP are used.

  • Uses Just van Rossum's PyFontify version 0.3 to tag Python scripts. You can get it via his homepage on starship: URL: http://starship.python.net/crew/just

Imported modules   
import re
import string
import sys
Functions   
addsplits
fileio
main
redirect_to
write_html_error
  addsplits 
addsplits (
        splits,
        text,
        formats,
        taglist,
        )

  fileio 
fileio (
        file,
        mode='rb',
        data=None,
        close=0,
        )

  main 
main ( cmdline )

main(cmdline)
process cmdline as if it were sys.argv
Exceptions   
ValueError
  redirect_to 
redirect_to ( url )

  write_html_error 
write_html_error ( titel,  text )

Classes   
PrettyPrint

generic Pretty Printer class


Table of Contents

This document was automatically generated on Sun Jul 14 19:52:28 2002 by HappyDoc version 2.0