Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
If the ``config_file`` session variable exists, parse that
file and return all of the data found within the file as a
dictionary of dictionaries, one for each profile section found
in the configuration file.

:returns: A dict with keys for each profile found in the config
    file and the value of each key being a dict containing name
    value pairs found in that profile.

:raises: ConfigNotFound, ConfigParseError

        def get_config(session):
    """
    If the ``config_file`` session variable exists, parse that
    file and return all of the data found within the file as a
    dictionary of dictionaries, one for each profile section found
    in the configuration file.

    :returns: A dict with keys for each profile found in the config
        file and the value of each key being a dict containing name
        value pairs found in that profile.

    :raises: ConfigNotFound, ConfigParseError
    """
    config = {}
    path = None
    path = session.get_config_variable('config_file')
    if path is not None:
        path = os.path.expandvars(path)
        path = os.path.expanduser(path)
        if not os.path.isfile(path):
            raise botocore.exceptions.ConfigNotFound(path=path)
        cp = configparser.RawConfigParser()
        try:
            cp.read(path)
        except configparser.Error:
            raise botocore.exceptions.ConfigParseError(path=path)
        else:
            config['_path'] = path
            for section in cp.sections():
                config[section] = {}
                for option in cp.options(section):
                    config_value = cp.get(section, option)
                    if config_value.startswith('\n'):
                        # Then we need to parse the inner contents as
                        # hierarchical.  We support a single level
                        # of nesting for now.
                        try:
                            config_value = _parse_nested(config_value)
                        except ValueError:
                            raise botocore.exceptions.ConfigParseError(
                                path=path)
                    config[section][option] = config_value
    return config
        


src/b/o/botocore-0.42.0/botocore/session.py   botocore(Download)
        if self._config is None:
            try:
                self._config = botocore.config.get_config(self)
            except ConfigNotFound:
                self._config = {}

src/b/o/botocore-HEAD/botocore/session.py   botocore(Download)
        if self._config is None:
            try:
                self._config = botocore.config.get_config(self)
            except ConfigNotFound:
                self._config = {}