(file_path='')
return {}
Loads YAML config and returns a list of dict with the results.

    Args:
        file_path (str): path to the YAML config file. This is optional
            and if not defined the default formatter.yaml file will be
            used that comes with the tool.

    Returns:
        dict: a dict with the key being a config file identifier and the value
        being another dict with the configuration items.
Loads YAML config and returns a list of dict with the results.
Loads YAML config and returns a list of dict with the results .
def load_config(file_path=''):
    """Loads YAML config and returns a list of dict with the results.

    Args:
        file_path (str): path to the YAML config file. This is optional
            and if not defined the default formatter.yaml file will be
            used that comes with the tool.

    Returns:
        dict: a dict with the key being a config file identifier and the value
        being another dict with the configuration items.
    """
    if not file_path:
        base_path = os.path.dirname(__file__)
        file_path = os.path.join(base_path, DEFAULT_FILE)

    if not file_path.endswith('.yaml'):
        logger.error('Can\'t load a config that is not a YAML file.')
        return {}

    if not os.path.isfile(file_path):
        logger.error('File path does not exist, unable to load YAML config.')
        return {}

    with codecs.open(file_path, 'r') as fh:
        try:
            data = yaml.safe_load(fh)
            return data
        except (AttributeError, yaml.parser.ParserError) as e:
            logger.error('Unable to parse YAML file, with error: %s', e)
            return {}

    return {}
def load_config ( file_path = '' ) : if not file_path : base_path = os . path . dirname ( __file__ ) file_path = os . path . join ( base_path , DEFAULT_FILE ) if not file_path . endswith ( '.yaml' ) : logger . error ( 'Can\'t load a config that is not a YAML file.' ) return { } if not os . path . isfile ( file_path ) : logger . error ( 'File path does not exist, unable to load YAML config.' ) return { } with codecs . open ( file_path , 'r' ) as fh : try : data = yaml . safe_load ( fh ) return data except ( AttributeError , yaml . parser . ParserError ) as e : logger . error ( 'Unable to parse YAML file, with error: %s' , e ) return { } return { }