#NEWLINE# def _call_model( self , function , model , * args , **kwargs ) : #NEWLINE# #INDENT# model = model . lower ( ) #NEWLINE# if ( not ( model in self . model_list ) ) : #NEWLINE# #INDENT# raise KeyError ( ( 'unknown model %s' % model ) ) #NEWLINE# #UNINDENT# if ( not hasattr ( self . model_list [ model ] , function ) ) : #NEWLINE# #INDENT# raise ValueError ( ( 'unknown model function %s' % function ) ) #NEWLINE# #UNINDENT# if stupid_amount_of_logging : #NEWLINE# #INDENT# self . logger . debug ( ( 'calling %s on model %s with %s, %s' % ( function , model , args , kwargs ) ) ) #NEWLINE# #UNINDENT# result = getattr ( self . model_list [ model ] , function ) ( * args , ** kwargs ) #NEWLINE# if stupid_amount_of_logging : #NEWLINE# #INDENT# self . logger . debug ( ( 'return from %s on model %s: %s' % ( function , model , result ) ) ) #NEWLINE# #UNINDENT# return result