confidant_client/__init__.py
def _load_config(self, config_files, profile):
        """Initialize client settings from config."""
        for filename in config_files:
            try:
                with open(os.path.expanduser(filename), 'r') as f:
                    config = yaml.safe_load(f.read())
                    return config.get(profile, {})
            except IOError:
                logging.debug('{0} config file not found.'.format(filename))
                pass
            except yaml.YAMLError as e:
                msg = 'Failed to parse {0}: {1}'.format(filename, e)
                logging.error(msg)
                raise ClientConfigurationError(msg)
        # No file found
        return {}
Initialize client settings from config.
Initialize client settings from config.
Initialize client settings from config .
def _load_config(self, config_files, profile):
        for filename in config_files:
            try:
                with open(os.path.expanduser(filename), 'r') as f:
                    config = yaml.safe_load(f.read())
                    return config.get(profile, {})
            except IOError:
                logging.debug('{0} config file not found.'.format(filename))
                pass
            except yaml.YAMLError as e:
                msg = 'Failed to parse {0}: {1}'.format(filename, e)
                logging.error(msg)
                raise ClientConfigurationError(msg)
        return {}
def _load_config ( self , config_files , profile ) : for filename in config_files : try : with open ( os . path . expanduser ( filename ) , 'r' ) as f : config = yaml . safe_load ( f . read ( ) ) return config . get ( profile , { } ) except IOError : logging . debug ( '{0} config file not found.' . format ( filename ) ) pass except yaml . YAMLError as e : msg = 'Failed to parse {0}: {1}' . format ( filename , e ) logging . error ( msg ) raise ClientConfigurationError ( msg ) return { }
Initialize client settings from config.
Initialize client settings from config .
"""Initialize client settings from config.""" # No file found
self
config_files
profile