#NEWLINE# def __resolve_value( self , value , saw , original ) : #NEWLINE# #INDENT# expression_re = re . compile ( '\\${([\\._a-zA-Z0-9]+)(:.+?)?}' ) #NEWLINE# exact_match = expression_re . match ( value ) #NEWLINE# if ( exact_match and ( exact_match . group ( 0 ) == value ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# got = self . __get_field_value ( exact_match . group ( 1 ) , saw , original ) #NEWLINE# return got #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# if exact_match . group ( 2 ) : #NEWLINE# #INDENT# return self . __typed_value ( exact_match . group ( 2 ) [ 1 : ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return value #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# result = [ ] #NEWLINE# offset = 0 #NEWLINE# text = expression_re #NEWLINE# for match in expression_re . finditer ( text ) : #NEWLINE# #INDENT# result . append ( text [ offset : match . start ( ) ] ) #NEWLINE# try : #NEWLINE# #INDENT# got = self . __get_field_value ( str ( match . group ( 1 ) ) , saw , original ) #NEWLINE# result . append ( str ( got ) ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# if match . group ( 2 ) : #NEWLINE# #INDENT# result . append ( str ( match . group ( 2 ) [ 1 : ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result . append ( match . group ( 0 ) ) #NEWLINE# #UNINDENT# #UNINDENT# offset = match . end ( ) #NEWLINE# #UNINDENT# result . append ( text [ offset : ] ) #NEWLINE# return '' . join ( result )