summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>2013-05-24 12:47:29 +0200
committerNicolas Chauvat <nicolas.chauvat@logilab.fr>2013-05-24 12:47:29 +0200
commit8fbf288039fe17d919ea576a1d7f90cd7717d1fc (patch)
tree9e139faf51e2f750e2c847f48aef7b4a40b8b4a4
parent846a89e5209838e8a699367acf334608f3953500 (diff)
downloadlogilab-common-8fbf288039fe17d919ea576a1d7f90cd7717d1fc.tar.gz
[configuration] rename convert() to _validate()
this isn't a perfect move as validate doesn't feel like some type conversion is done, though this is at least coherent with other related stuff
-rw-r--r--configuration.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/configuration.py b/configuration.py
index 6486d00..4cece55 100644
--- a/configuration.py
+++ b/configuration.py
@@ -286,7 +286,7 @@ def expand_default(self, option):
return option.help.replace(self.default_tag, str(value))
-def convert(value, optdict, name=''):
+def _validate(value, optdict, name=''):
"""return a validated value for an option according to its type
optional argument name is only used for error message formatting
@@ -297,6 +297,7 @@ def convert(value, optdict, name=''):
# FIXME
return value
return _call_validator(_type, optdict, name, value)
+convert = deprecated('[0.60] convert() was renamed _validate()')(_validate)
def comment(string):
"""return string as a comment"""
@@ -796,7 +797,7 @@ class OptionsProviderMixIn(object):
if optdict is None:
optdict = self.get_option_def(opt)
if value is not None:
- value = convert(value, optdict, opt)
+ value = _validate(value, optdict, opt)
if action is None:
action = optdict.get('action', 'store')
if optdict.get('type') == 'named': # XXX need specific handling