]> jfr.im git - erebus.git/blobdiff - config.py
urls - beautifulsoup: use encoding from Content-Type if available
[erebus.git] / config.py
index fd8460a2d35e0e3d8d466e3d553e9c094e570e14..5538dc78c9f68db4b27d6d9c2c1995fa2bb26e4c 100644 (file)
--- a/config.py
+++ b/config.py
@@ -60,8 +60,13 @@ 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', 'wb') as configfile:
+               with open(self.filename+'.tmp', 'w') as configfile:
                        self.config.write(configfile)
                        os.rename(configfile.name, self.filename)