Add ability to unset keys from randoms section

This commit is contained in:
Oleksii Shevchuk 2017-03-11 11:47:21 +02:00
parent b7515c6a74
commit 8e285ea8a0
1 changed files with 9 additions and 0 deletions

View File

@ -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)