def read_configuration_file(filepath=_give_default_file_path()):
    """Read the configuration file.

    .. note:: This function changes ``cc.settings`` inplace and is
        therefore not sideeffect free.

    Args:
        filepath (str): Where to read the file.
            The default is under both UNIX and Windows ``~/.chemcoordrc``.

    Returns:
        None:
    """
    config = configparser.ConfigParser()
    config.read(filepath)

    def get_correct_type(section, key, config):
        """Gives e.g. the boolean True for the string 'True'"""
        def getstring(section, key, config):
            return config[section][key]

        def getinteger(section, key, config):  # pylint:disable=unused-variable
            return config[section].getint(key)

        def getboolean(section, key, config):
            return config[section].getboolean(key)

        def getfloat(section, key, config):  # pylint:disable=unused-variable
            return config[section].getfloat(key)
        special_actions = {}  # Something different than a string is expected
        special_actions['defaults'] = {}
        special_actions['defaults']['use_lookup'] = getboolean
        try:
            return special_actions[section][key](section, key, config)
        except KeyError:
            return getstring(section, key, config)

    for section in config.sections():
        for key in config[section]:
            settings[section][key] = get_correct_type(section, key, config)
    return settings
def read_configuration_file ( filepath = _give_default_file_path ( ) ) : config = configparser . ConfigParser ( ) config . read ( filepath ) def get_correct_type ( section , key , config ) : def getstring ( section , key , config ) : return config [ section ] [ key ] def getinteger ( section , key , config ) : return config [ section ] . getint ( key ) def getboolean ( section , key , config ) : return config [ section ] . getboolean ( key ) def getfloat ( section , key , config ) : return config [ section ] . getfloat ( key ) special_actions = { } special_actions [ 'defaults' ] = { } special_actions [ 'defaults' ] [ 'use_lookup' ] = getboolean try : return special_actions [ section ] [ key ] ( section , key , config ) except KeyError : return getstring ( section , key , config ) for section in config . sections ( ) : for key in config [ section ] : settings [ section ] [ key ] = get_correct_type ( section , key , config ) return settings
Read the configuration file.

    .. note:: This function changes ``cc.settings`` inplace and is
        therefore not sideeffect free.

    Args:
        filepath (str): Where to read the file.
            The default is under both UNIX and Windows ``~/.chemcoordrc``.

    Returns:
        None: