From 8e285ea8a019ce597686d3914757c79faa584772 Mon Sep 17 00:00:00 2001 From: Oleksii Shevchuk Date: Sat, 11 Mar 2017 11:47:21 +0200 Subject: [PATCH] Add ability to unset keys from randoms section --- pupy/pupylib/PupyConfig.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pupy/pupylib/PupyConfig.py b/pupy/pupylib/PupyConfig.py index b17d8b41..08cab9d5 100644 --- a/pupy/pupylib/PupyConfig.py +++ b/pupy/pupylib/PupyConfig.py @@ -77,6 +77,15 @@ class PupyConfig(ConfigParser): else: return path.abspath(retfolder) + def remove_option(self, section, key): + if section != 'randoms': + ConfigParser.unset(self, section, key) + else: + if key in self.randoms: + del self.randoms[key] + elif key == 'all': + self.randoms = {} + def set(self, section, key, value, **kwargs): if section != 'randoms': ConfigParser.set(self, section, key, value)