diff options
Diffstat (limited to 'configuration.py')
-rw-r--r-- | configuration.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/configuration.py b/configuration.py index 1890ccb..012d4a2 100644 --- a/configuration.py +++ b/configuration.py @@ -396,6 +396,13 @@ class OptionsManagerMixIn(object): use with optik/optparse """ opt_dict = copy(opt_dict) + # if yn option then create right action depending of default value + if "type" in opt_dict and opt_dict['type'] == "yn": + if "default" in opt_dict and opt_dict['default']: + opt_dict['action'] = "store_false" + else: + opt_dict['action'] = "store_true" + del opt_dict['type'] if 'action' in opt_dict: self._nocallback_options[provider] = opt_name else: |