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 NoSectionError, NoOptionError 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(section, option) except (NoSectionError, NoOptionError): value = default_value return value
|