allow mandatory value (see 9ddf100118 for more details)

This commit is contained in:
2013-09-16 20:51:13 +02:00
parent 9ddf100118
commit 57f4dd8d3f
3 changed files with 45 additions and 6 deletions

View File

@ -385,13 +385,17 @@ class Settings(object):
#____________________________________________________________
def validate_properties(self, opt_or_descr, is_descr, is_write, path,
value=None, force_permissive=False,
force_properties=None):
force_properties=None, force_permissives=None):
"""
validation upon the properties related to `opt_or_descr`
:param opt_or_descr: an option or an option description object
:param force_permissive: behaves as if the permissive property
was present
:param force_properties: set() with properties that is force to add
in global properties
:param force_permissives: set() with permissives that is force to add
in global permissives
:param is_descr: we have to know if we are in an option description,
just because the mandatory property
doesn't exist here
@ -408,6 +412,8 @@ class Settings(object):
self_properties = copy(self._getproperties())
if force_permissive is True or 'permissive' in self_properties:
properties -= self._p_.getpermissive()
if force_permissives is not None:
properties -= force_permissives
# global properties
if force_properties is not None: