blob: 799c84b0ef287593efe6d5eafc9d9adee4ffbcff (
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
|