#NEWLINE# def generate( node , environment , name , filename , stream = None , defer_init = False ) : #NEWLINE# #INDENT# 'Generate the python source for a node tree.' #NEWLINE# if ( not isinstance ( node , nodes . Template ) ) : #NEWLINE# #INDENT# raise TypeError ( "Can't compile non template nodes" ) #NEWLINE# #UNINDENT# generator = CodeGenerator ( name , name , filename , stream , defer_init ) #NEWLINE# generator . visit ( node ) #NEWLINE# if ( stream is None ) : #NEWLINE# #INDENT# return generator . stream . getvalue ( )