#NEWLINE# def find_parameters( obj , fields = None ) : #NEWLINE# #INDENT# 'Find parameters in the given fields' #NEWLINE# if ( fields is None ) : #NEWLINE# #INDENT# fields = [ k for k in obj . __dict__ . keys ( ) if ( not k . startswith ( '_' ) ) ] #NEWLINE# #UNINDENT# params = [ ] #NEWLINE# for field in fields : #NEWLINE# #INDENT# data = getattr ( obj , field ) #NEWLINE# if isinstance ( data , basestring ) : #NEWLINE# #INDENT# for match in Template . pattern . finditer ( data ) : #NEWLINE# #INDENT# name = ( match . group ( 'named' ) or match . group ( 'braced' ) ) #NEWLINE# if ( name is not None ) : #NEWLINE# #INDENT# params . append ( name ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return params