X-Git-Url: https://jfr.im/git/erebus.git/blobdiff_plain/70d52c484a626ff506cf9938993202916afad271..0ef0d38b8816b9092235ac0f9a7359fc2b6b1365:/config.py diff --git a/config.py b/config.py index bb44ba3..9755f84 100644 --- a/config.py +++ b/config.py @@ -12,7 +12,7 @@ else: class Config(object): def __init__(self, filename, writeout=True): - self.__dict__['config'] = ConfigParser.RawConfigParser() + self.__dict__['config'] = ConfigParser.RawConfigParser(delimiters=('=',)) self.__dict__['filename'] = filename self.__dict__['writeout'] = writeout self.config.read(filename) @@ -60,6 +60,11 @@ class Config(object): 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() + def write(self): with open(self.filename+'.tmp', 'w') as configfile: self.config.write(configfile)