]> jfr.im git - erebus.git/blobdiff - config.py
admin_config - add !getconfig, remove some unused functions
[erebus.git] / config.py
index bb44ba3a4e9a049aa58b379a058b73a616b5ffb1..9755f84644d25ac076c05d521973bf04f4c79328 100644 (file)
--- 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)