permissives are for a specified option not config

This commit is contained in:
Emmanuel Garette 2013-04-04 15:14:16 +02:00
parent 9006dca09f
commit c918191d21
2 changed files with 9 additions and 15 deletions

View file

@ -95,7 +95,7 @@ class SubConfig(object):
properties = properties & set_properties properties = properties & set_properties
if force_permissive is True or self.cfgimpl_get_settings().has_property('permissive'): if force_permissive is True or self.cfgimpl_get_settings().has_property('permissive'):
properties = properties - set(self.cfgimpl_get_settings().get_permissive()) properties = properties - set(self.cfgimpl_get_settings().get_permissive())
properties = properties - set(self.cfgimpl_get_settings().get_permissive(self.cfgimpl_get_description())) properties = properties - set(self.cfgimpl_get_settings().get_permissive(opt_or_descr))
properties = list(properties) properties = list(properties)
if properties != []: if properties != []:
raise PropertiesOptionError("trying to access" raise PropertiesOptionError("trying to access"
@ -236,12 +236,6 @@ class SubConfig(object):
pass pass
# ______________________________________________________________________ # ______________________________________________________________________
def cfgimpl_set_permissive(self, permissive):
if not isinstance(permissive, list):
raise TypeError('permissive must be a list')
self.cfgimpl_get_settings().set_permissive(permissive, self.cfgimpl_get_description())
# ______________________________________________________________________
def __str__(self): def __str__(self):
"Config's string representation" "Config's string representation"
lines = [] lines = []

View file

@ -205,13 +205,13 @@ class Setting(object):
self.set_properties(properties, opt) self.set_properties(properties, opt)
#____________________________________________________________ #____________________________________________________________
def get_permissive(self, config=None): def get_permissive(self, opt=None):
return self.permissives.get(config, []) return self.permissives.get(opt, [])
def set_permissive(self, permissive, config=None): def set_permissive(self, permissive, opt=None):
if not isinstance(permissive, list): if not isinstance(permissive, list):
raise TypeError('permissive must be a list') raise TypeError('permissive must be a list')
self.permissives[config] = permissive self.permissives[opt] = permissive
#____________________________________________________________ #____________________________________________________________
def setowner(self, owner): def setowner(self, owner):