<s> """<STR_LIT>""" <EOL> from pycopia import reports <EOL> from pycopia import timelib <EOL> def escape ( s ) : <EOL> s = s . replace ( "<STR_LIT:&>" , "<STR_LIT>" ) <EOL> s = s . replace ( "<STR_LIT:<>" , "<STR_LIT>" ) <EOL> s = s . replace ( "<STR_LIT:>>" , "<STR_LIT>" ) <EOL> s = s . replace ( '<STR_LIT:">' , "<STR_LIT>" ) <EOL> return s <EOL> class XHTMLFormatter ( reports . NullFormatter ) : <EOL> MIMETYPE = "<STR_LIT>" <EOL> _MSGTYPESUB = { <EOL> "<STR_LIT>" : '<STR_LIT>' , <EOL> "<STR_LIT>" : '<STR_LIT>' , <EOL> "<STR_LIT>" : '<STR_LIT>' , <EOL> "<STR_LIT>" : '<STR_LIT>' , <EOL> "<STR_LIT>" : '<STR_LIT>' , <EOL> "<STR_LIT>" : '<STR_LIT>' , <EOL> "<STR_LIT>" : '<STR_LIT>' , <EOL> } <EOL> def initialize ( self ) : <EOL> return """<STR_LIT>""" <EOL> def finalize ( self ) : <EOL> return "<STR_LIT>" <EOL> def page ( self ) : <EOL> return "<STR_LIT>" <EOL> def title ( self , title ) : <EOL> s = [ "<STR_LIT>" ] <EOL> s . append ( escape ( title ) ) <EOL> s . append ( "<STR_LIT>" ) <EOL> return "<STR_LIT>" . join ( s ) <EOL> def heading ( self , text , level = <NUM_LIT:1> ) : <EOL> s = [ ] <EOL> s . append ( "<STR_LIT>" % ( level , ) ) <EOL> s . append ( escape ( text ) ) <EOL> s . append ( "<STR_LIT>" % ( level , ) ) <EOL> return "<STR_LIT>" . join ( s ) <EOL> def paragraph ( self , text ) : <EOL> return "<STR_LIT>" % ( escape ( text ) , ) <EOL> def message ( self , msgtype , msg , level = <NUM_LIT:1> ) : <EOL> if msgtype . find ( "<STR_LIT>" ) >= <NUM_LIT:0> : <EOL> msg = timelib . localtimestamp ( msg ) <EOL> msg = str ( msg ) <EOL> msgtype = self . _MSGTYPESUB . get ( msgtype , msgtype ) <EOL> if msg . find ( "<STR_LIT:\n>" ) > <NUM_LIT:0> : <EOL> return "<STR_LIT>" % ( msgtype , escape ( msg ) ) <EOL> else : <EOL> return '<STR_LIT>' % ( msgtype , escape ( msg ) ) <EOL> def text ( self , text ) : <EOL> return "<STR_LIT>" % ( text , ) <EOL> def analysis ( self , text ) : <EOL> return '<STR_LIT>' % ( text , ) <EOL> def url ( self , text , url ) : <EOL> return '<STR_LIT>' % ( text , url , url ) <EOL> def summaryline ( self , entry ) : <EOL> sum = "<STR_LIT>" % ( entry , ) <EOL> sum = sum . replace ( "<STR_LIT>" , self . _MSGTYPESUB [ "<STR_LIT>" ] ) <EOL> sum = sum . replace ( "<STR_LIT>" , self . _MSGTYPESUB [ "<STR_LIT>" ] ) <EOL> sum = sum . replace ( "<STR_LIT>" , self . _MSGTYPESUB [ "<STR_LIT>" ] ) <EOL> return sum <EOL> def section ( self ) : <EOL> return "<STR_LIT>" <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> report = reports . get_report ( ( None , "<STR_LIT:->" , "<STR_LIT>" , ) ) <EOL> report . initialize ( ) <EOL> report . info ( "<STR_LIT>" ) <EOL> report . passed ( "<STR_LIT>" ) <EOL> report . add_analysis ( "<STR_LIT>" ) <EOL> report . finalize ( ) </s>
