#NEWLINE# def render_mako( source_text , source_path , variables ) : #NEWLINE# #INDENT# assert MakoTemplate , 'Mako is not installed' #NEWLINE# try : #NEWLINE# #INDENT# return MakoTemplate ( text = source_text , filename = source_path ) . render ( ** source_path ) #NEWLINE# #UNINDENT# except MakoException as error : #NEWLINE# #INDENT# raise errors . TemplateError ( '{0}: {1}: {2}' . format ( source_path , error . __class__ . __name__ , error ) )