#NEWLINE# def get_template_source( template_name , response_format = 'html' ) : #NEWLINE# #INDENT# 'Returns source of the template file' #NEWLINE# if ( ( not response_format ) or ( 'pdf' in response_format ) or ( response_format not in settings . HARDTREE_RESPONSE_FORMATS ) ) : #NEWLINE# #INDENT# response_format = 'html' #NEWLINE# #UNINDENT# if ( not ( ( '.' + response_format ) in template_name ) ) : #NEWLINE# #INDENT# template_name += ( '.' + response_format ) #NEWLINE# #UNINDENT# template_name = ( ( response_format + '/' ) + template_name ) #NEWLINE# t = loader . get_template ( template_name ) #NEWLINE# f = open ( t . filename , 'r' ) #NEWLINE# return f . read ( )