]> jfr.im git - erebus.git/commitdiff
config - add delete method
authorJohn Runyon <redacted>
Mon, 4 Sep 2023 02:56:55 +0000 (20:56 -0600)
committerJohn Runyon <redacted>
Mon, 4 Sep 2023 02:56:55 +0000 (20:56 -0600)
config.py

index bb44ba3a4e9a049aa58b379a058b73a616b5ffb1..5538dc78c9f68db4b27d6d9c2c1995fa2bb26e4c 100644 (file)
--- a/config.py
+++ b/config.py
@@ -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)