diff options
| author | Bdale Garbee <bdale@gag.com> | 2014-06-26 12:55:21 -0600 |
|---|---|---|
| committer | Iain R. Learmonth <irl@fsfe.org> | 2015-05-03 18:29:34 +0100 |
| commit | 5e9167a4a78a45e58ae9969b41e70e9d77176376 (patch) | |
| tree | ebc0c218856d44b1c60b62ba20ec9cd1b90e4791 /chirpui/config.py | |
| parent | df2e8c36e9ce0a448c1ec9a9665644d95d3014c2 (diff) | |
| parent | c86187dcdf158df59977baee6c8d6385f964b69b (diff) | |
Imported Debian patch 0.4.0-1debian/0.4.0-1
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 |
