#NEWLINE# def _update_from_config( self , filename , section = None ) : #NEWLINE# #INDENT# self . logger . info ( ( 'Loading ' + filename ) ) #NEWLINE# with open ( filename ) as config : #NEWLINE# #INDENT# data = yaml . safe_load ( config . read ( ) ) #NEWLINE# #UNINDENT# settings = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# settings . update ( data . get ( 'common' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) #NEWLINE# if section : #NEWLINE# #INDENT# settings . update ( data . get ( section , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# for ( key , value ) in settings . iteritems ( ) : #NEWLINE# #INDENT# key = key . lower ( ) #NEWLINE# if ( key not in self . settings ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# override = getattr ( key , ( 'override_%s' % key ) , None ) #NEWLINE# if ( ( override is not None ) and callable ( override ) ) : #NEWLINE# #INDENT# value = override ( value ) #NEWLINE# #UNINDENT# self [ key ] = value