+ def get(self, section, key, default=None):
+ try:
+ return self.config.get(section, key)
+ except:
+ return default
+ def getint(self, section, key, default=0):
+ try:
+ return int(self.config.get(section, key))
+ except:
+ return default
+ def getboolean(self, section, key, default=False):
+ val = self.get(section, key, default)
+ if type(val) is bool:
+ return val
+ elif val == "0" or val.lower() == "false":
+ return False
+ else:
+ return True
+
+ def set(self, section, key, value):
+ if not self.config.has_section(section):
+ self.config.add_section(section)
+ self.config.set(section, key, str(value))
+ if self.writeout: self.write()
+
+ def delete(self, section, key):
+ if self.config.has_section(section):
+ self.config.remove_option(section, key)
+ if self.writeout: self.write()
+