import configparser


def get_default(parser, section, option, default):
    """helper to get config settings with a default if not present"""
    try:
        result = parser.get(section, option)
    except (configparser.NoSectionError, configparser.NoOptionError):
        result = default
    return result