def str2css(sourcestring, colors=None, title='', markup='css', header=None, footer=None, linenumbers=0, form=None):
 if (markup.lower() not in ['css', 'xhtml']):
  markup = 'css'
 stringIO = StringIO.StringIO()
 parse = Parser(sourcestring, colors=colors, title=title, out=stringIO, markup=markup, header=header, footer=footer, linenumbers=linenumbers)
 parse.format(form)
 stringIO.seek(0)
 if (form != None):
  return (parse._sendCSSStyle(external=1), stringIO.read())
 else:
  return (None, stringIO.read())

def str2css ( sourcestring , colors = None , title = '' , markup = 'css' , header = None , footer = None , linenumbers = 0 , form = None ) : if ( markup . lower ( ) not in [ 'css' , 'xhtml' ] ) : markup = 'css' stringIO = StringIO . StringIO ( ) parse = Parser ( sourcestring , colors = colors , title = title , out = stringIO , markup = markup , header = header , footer = footer , linenumbers = linenumbers ) parse . format ( form ) stringIO . seek ( 0 ) if ( form != None ) : return ( parse . _sendCSSStyle ( external = 1 ) , stringIO . read ( ) ) else : return ( None , stringIO . read ( ) )
converts a code string to colorized css/html .