diff options
author | Fabrice Douchant <Fabrice.Douchant@logilab.fr> | 2008-10-30 14:46:12 +0100 |
---|---|---|
committer | Fabrice Douchant <Fabrice.Douchant@logilab.fr> | 2008-10-30 14:46:12 +0100 |
commit | be8b57ad915d263e8c9118eb6a81be283b10f92a (patch) | |
tree | 679fdf1cee945b93fc6edb915cb61031a16685cb /configuration.py | |
parent | a1af7257ffd5a75b5296a8baaba0be9cd22d6835 (diff) | |
parent | 7564ccf79cd69054bcab0d117182e9b49ce40deb (diff) | |
download | logilab-common-be8b57ad915d263e8c9118eb6a81be283b10f92a.tar.gz |
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: |