setpermissive => setpermissives
This commit is contained in:
@ -368,8 +368,8 @@ class TiramisuOptionPermissive(CommonTiramisuOption):
|
||||
def set(self, permissives):
|
||||
"""set permissives value"""
|
||||
option = self.option_bag.option
|
||||
self.settings.setpermissive(self.option_bag,
|
||||
permissives=permissives)
|
||||
self.settings.setpermissives(self.option_bag,
|
||||
permissives=permissives)
|
||||
|
||||
def reset(self):
|
||||
"""reset all personalised permissive"""
|
||||
@ -739,7 +739,7 @@ class TiramisuContextProperty(TiramisuContext):
|
||||
settings = self.config_bag.context.cfgimpl_get_settings()
|
||||
settings.read_write()
|
||||
# #FIXME ?
|
||||
settings.set_context_permissive(frozenset(['hidden']))
|
||||
settings.set_context_permissives(frozenset(['hidden']))
|
||||
try:
|
||||
del self.config_bag.properties
|
||||
except AttributeError:
|
||||
@ -787,11 +787,11 @@ class TiramisuContextPermissive(TiramisuContext):
|
||||
|
||||
def get(self):
|
||||
"""get configuration permissives"""
|
||||
return self.config_bag.context.cfgimpl_get_settings().get_context_permissive()
|
||||
return self.config_bag.context.cfgimpl_get_settings().get_context_permissives()
|
||||
|
||||
def set(self, permissives):
|
||||
"""set configuration permissives"""
|
||||
self.config_bag.context.cfgimpl_get_settings().set_context_permissive(permissives)
|
||||
self.config_bag.context.cfgimpl_get_settings().set_context_permissives(permissives)
|
||||
|
||||
def exportation(self):
|
||||
"""export configuration permissives"""
|
||||
|
@ -625,14 +625,14 @@ class Settings(object):
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
def set_context_permissive(self,
|
||||
permissive):
|
||||
self.setpermissive(None,
|
||||
permissive)
|
||||
def set_context_permissives(self,
|
||||
permissives):
|
||||
self.setpermissives(None,
|
||||
permissives)
|
||||
|
||||
def setpermissive(self,
|
||||
option_bag,
|
||||
permissives):
|
||||
def setpermissives(self,
|
||||
option_bag,
|
||||
permissives):
|
||||
"""
|
||||
enables us to put the permissives in the storage
|
||||
|
||||
@ -658,7 +658,7 @@ class Settings(object):
|
||||
if forbidden_permissives:
|
||||
raise ConfigError(_('cannot add those permissives: {0}').format(
|
||||
' '.join(forbidden_permissives)))
|
||||
self._pp_.setpermissive(path, permissives)
|
||||
self._pp_.setpermissives(path, permissives)
|
||||
if option_bag is not None:
|
||||
self._getcontext().cfgimpl_reset_cache(option_bag)
|
||||
|
||||
|
@ -73,14 +73,14 @@ class Permissives(Cache):
|
||||
self._permissives = {}
|
||||
super(Permissives, self).__init__(storage)
|
||||
|
||||
def setpermissive(self, path, permissive):
|
||||
def setpermissives(self, path, permissives):
|
||||
if DEBUG: # pragma: no cover
|
||||
print('setpermissive', path, permissive)
|
||||
if not permissive:
|
||||
print('setpermissives', path, permissives)
|
||||
if not permissives:
|
||||
if path in self._permissives:
|
||||
del self._permissives[path]
|
||||
else:
|
||||
self._permissives[path] = permissive
|
||||
self._permissives[path] = permissives
|
||||
|
||||
def getpermissives(self, path=None):
|
||||
ret = self._permissives.get(path, frozenset())
|
||||
|
Reference in New Issue
Block a user