+class ConfigWrapper(object):
+ def __init__(self, config):
+ self.config = config
+
+ def get(self, section, option, default=None):
+ try:
+ return self.config.get(section, option)
+ except (NoSectionError, NoOptionError):
+ return default
+
+ def set(self, section, option, value):
+ self.config.set(section, option, value)
+
+ def getint(self, section, option, default=0):
+ try:
+ return self.config.getint(section, option)
+ except (NoSectionError, NoOptionError):
+ return default
+ # Do not catch ValueError here, it must be propagated
+
+