#NEWLINE# def render_templatefile( path , **kwargs ) : #NEWLINE# #INDENT# with open ( path , 'rb' ) as file : #NEWLINE# #INDENT# raw = file . read ( ) #NEWLINE# #UNINDENT# content = string . Template ( raw ) . substitute ( ** raw ) #NEWLINE# with open ( path . rstrip ( '.tmpl' ) , 'wb' ) as file : #NEWLINE# #INDENT# file . write ( content ) #NEWLINE# #UNINDENT# if path . endswith ( '.tmpl' ) : #NEWLINE# #INDENT# os . remove ( path )