msaf/configparser.py
def fetch_val_for_key(key, delete_key=False):
    """Return the overriding config value for a key.
    A successful search returns a string value.
    An unsuccessful search raises a KeyError
    The (decreasing) priority order is:
    - MSAF_FLAGS
    - ~./msafrc
    """

    # first try to find it in the FLAGS
    try:
        if delete_key:
            return MSAF_FLAGS_DICT.pop(key)
        return MSAF_FLAGS_DICT[key]
    except KeyError:
        pass

    # next try to find it in the config file

    # config file keys can be of form option, or section.option
    key_tokens = key.rsplit('.', 1)
    if len(key_tokens) == 2:
        section, option = key_tokens
    else:
        section, option = 'global', key
    try:
        try:
            return msaf_cfg.get(section, option)
        except InterpolationError:
            return msaf_raw_cfg.get(section, option)
    except (NoOptionError, NoSectionError):
        raise KeyError(key)
def fetch_val_for_key(key, delete_key=False):
    """Return the overriding config value for a key.
    A successful search returns a string value.
    An unsuccessful search raises a KeyError
    The (decreasing) priority order is:
    - MSAF_FLAGS
    - ~./msafrc
    """

    # first try to find it in the FLAGS
    try:
        if delete_key:
            return MSAF_FLAGS_DICT.pop(key)
        return MSAF_FLAGS_DICT[key]
    except KeyError:
        pass

    # next try to find it in the config file

    # config file keys can be of form option, or section.option
    key_tokens = key.rsplit('.', 1)
    if len(key_tokens) == 2:
        section, option = key_tokens
    else:
        section, option = 'global', key
    try:
        try:
            return msaf_cfg.get(section, option)
        except InterpolationError:
            return msaf_raw_cfg.get(section, option)
    except (NoOptionError, NoSectionError):
        raise KeyError(key)
Return the overriding config value for a key.
    A successful search returns a string value.
    An unsuccessful search raises a KeyError
    The (decreasing) priority order is:
    - MSAF_FLAGS
    - ~./msafrc