#NEWLINE# def run_configure( self , key , value , configurable , validator_func = None , converter_func = None , store_func = None , * args , **kwargs ) : #NEWLINE# #INDENT# ' Run a single configuration element\n            Run a validator on the value, if supplied\n            Run a converter_funct to turn the value into something to storeable:\n                converter_func takes params (value) at least and throws exception if failed\n            If a  store_func is supplied, use that to store the option\n              store_func needs to take params (object, key, value, args, kwargs)\n            If store_func NOT supplied we do a setattr on object\n        ' #NEWLINE# if ( validator_func and ( not validator ( value ) ) ) : #NEWLINE# #INDENT# raise TypeError ( 'Illegal argument for {0}' . format ( value ) ) #NEWLINE# #UNINDENT# storeable = validator_func #NEWLINE# if converter_func : #NEWLINE# #INDENT# storeable = converter_func ( value ) #NEWLINE# #UNINDENT# if store_func : #NEWLINE# #INDENT# store_func ( configurable , key , storeable ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# configurable . setattr ( configurable , key , value )