diff options
| author | Iain R. Learmonth <irl@fsfe.org> | 2015-05-03 18:15:26 +0100 |
|---|---|---|
| committer | Iain R. Learmonth <irl@fsfe.org> | 2015-05-03 18:15:26 +0100 |
| commit | c86187dcdf158df59977baee6c8d6385f964b69b (patch) | |
| tree | 9b4f956c3bbfd9bbb48cf60aa75a32051e496d2c /chirpui/config.py | |
| parent | 717fcf5fd76d3c672c609f336c80a675a548c4c6 (diff) | |
Imported Upstream version 0.4.0upstream/0.4.0
Diffstat (limited to 'chirpui/config.py')
| -rw-r--r-- | chirpui/config.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chirpui/config.py b/chirpui/config.py index d82a1db..c5b55c1 100644 --- a/chirpui/config.py +++ b/chirpui/config.py @@ -54,6 +54,12 @@ class ChirpConfig: def is_defined(self, key, section): return self.__config.has_option(section, key) + def remove_option(self, section, key): + self.__config.remove_option(section, key) + + if not self.__config.items(section): + self.__config.remove_section(section) + class ChirpConfigProxy: def __init__(self, config, section="global"): self._config = config @@ -98,6 +104,9 @@ class ChirpConfigProxy: def is_defined(self, key, section=None): return self._config.is_defined(key, section or self._section) + def remove_option(self, key, section): + self._config.remove_option(section, key) + _CONFIG = None def get(section="global"): global _CONFIG |
