#NEWLINE# def _load_config( self ) : #NEWLINE# #INDENT# '\n        Load specified config file\n        ' #NEWLINE# try : #NEWLINE# #INDENT# with open ( self . conf [ 'config' ] , 'r' ) as fp : #NEWLINE# #INDENT# config = fp . read ( ) #NEWLINE# #UNINDENT# #UNINDENT# except IOError as e : #NEWLINE# #INDENT# lg . error ( ( "Can't read config file %s: %s" % ( self . conf [ 'config' ] , e ) ) ) #NEWLINE# raise #NEWLINE# #UNINDENT# yaml . add_constructor ( '!include_dir' , self . _yaml_include_dir ) #NEWLINE# yaml . add_constructor ( '!include' , self . _yaml_include ) #NEWLINE# try : #NEWLINE# #INDENT# conf = yaml . load ( config ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# lg . error ( ( "Can't parse config file %s: %s" % ( self . conf [ 'config' ] , e ) ) ) #NEWLINE# raise #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# fp . close ( ) #NEWLINE# #UNINDENT# for ( key , value ) in conf . iteritems ( ) : #NEWLINE# #INDENT# if self . conf . has_key ( key ) : #NEWLINE# #INDENT# lg . debug ( ( 'Using parameter %s from user, ignoring config file value' % key ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . conf [ key ] = value