Package lemon :: Package external :: Module py2html :: Class PrettyPrint
[show private | hide private]
[frames | no frames]

Class PrettyPrint


generic Pretty Printer class

* supports tagging Python scripts in the following ways:

  # format/mode |  color  mono
  # --------------------------
  # rawhtml     |    x     x   (HTML without headers, etc.)
  # html        |    x     x   (a HTML page with HEAD&BODY:)
  # ansi        |          x   (with Ansi-escape sequences)

* interfaces:

   file_filter -- takes two files: input & output (may be stdin/stdout)
   filter -- takes a string and returns the highlighted version

* to create an instance use:

  c = PrettyPrint(tagfct,format,mode)

  where format and mode must be strings according to the
  above table if you plan to use PyFontify.fontify as
  tagfct

* the tagfct has to take one argument, text, and return a taglist
  (format: [(id,left,right,sublist),...], where id is the
  "name" given to the slice left:right in text and sublist is a
  taglist for tags inside the slice or None)

Method Summary
  __init__(self, tagfct, format, mode)
  escape_html(self, text)
  file_filter(self, infile, outfile)
  filter_ansi(self, text)
  filter_html(self, text)
  filter_rawhtml(self, text)
  filtertabs(self, s)
  fontify(self, pytext)
  set_mode_ansi_mono(self)
  set_mode_html_color(self)
  set_mode_html_mono(self)
  set_mode_rawhtml_color(self)
  set_mode_rawhtml_mono(self)

Class Variable Summary
str bgcolor = '#EEEEEE'
str footer = ''
dict formats = {}
str header = ''
int replace_URLs = 0                                                                     
str title = ''

Class Variable Details

bgcolor

Type:
str
Value:
'#EEEEEE'                                                              

footer

Type:
str
Value:
''                                                                     

formats

Type:
dict
Value:
{}                                                                     

header

Type:
str
Value:
''                                                                     

replace_URLs

Type:
int
Value:
0                                                                     

title

Type:
str
Value:
''                                                                     

Generated by Epydoc 2.0 on Mon Nov 10 15:07:42 2003 http://epydoc.sf.net