#NEWLINE# def interpolate( self , text , escape = None ) : #NEWLINE# #INDENT# def repl( matchobj ) : #NEWLINE# #INDENT# if ( escape is None ) : #NEWLINE# #INDENT# if ( matchobj . group ( 2 ) == '!' ) : #NEWLINE# #INDENT# filter_string = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# filter_string = '|escape' #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( escape is True ) : #NEWLINE# #INDENT# filter_string = '|escape' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( escape is False ) : #NEWLINE# #INDENT# filter_string = '' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return ( ( ( self . variable_start_string + matchobj . group ( 3 ) ) + filter_string ) + self . variable_end_string ) #NEWLINE# #UNINDENT# return self . RE_INTERPOLATE . sub ( repl , text )