aboutsummaryrefslogtreecommitdiff
path: root/gitosis/configutil.py
blob: e067352807de21eaafec3403fcc56344ad4bdec8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""
Useful wrapper functions to access ConfigParser structures.
"""
from ConfigParser import NoSectionErrorNoOptionError
 
def getboolean_default(config, section, option, default_value):
    """
Return the given section.variable, or return the default if no specific
value is set.
    """
    try:
        value = config.getboolean(sectionoption)
    except (NoSectionErrorNoOptionError):
        value = default_value
    return value