simplify meta support
This commit is contained in:
@ -359,12 +359,8 @@ class Settings(object):
|
||||
{},
|
||||
'context_props')
|
||||
if not is_cached:
|
||||
meta = self._getcontext().cfgimpl_get_meta()
|
||||
if meta is None:
|
||||
props = self._p_.getproperties(None,
|
||||
default_properties)
|
||||
else:
|
||||
props = meta.cfgimpl_get_settings().get_context_properties()
|
||||
props = self._p_.getproperties(None,
|
||||
default_properties)
|
||||
self._p_.setcache(None,
|
||||
None,
|
||||
props,
|
||||
@ -396,13 +392,8 @@ class Settings(object):
|
||||
else:
|
||||
is_cached = False
|
||||
if not is_cached:
|
||||
meta = self._getcontext().cfgimpl_get_meta()
|
||||
if meta is None:
|
||||
props = self._p_.getproperties(path,
|
||||
opt.impl_getproperties())
|
||||
else:
|
||||
props = meta.cfgimpl_get_settings().getproperties(option_bag,
|
||||
apply_requires)
|
||||
props = self._p_.getproperties(path,
|
||||
opt.impl_getproperties())
|
||||
if apply_requires:
|
||||
props |= self.apply_requires(option_bag,
|
||||
False)
|
||||
@ -425,10 +416,6 @@ class Settings(object):
|
||||
if opt and opt.impl_is_symlinkoption():
|
||||
opt = opt.impl_getopt()
|
||||
path = opt.impl_getpath(self._getcontext())
|
||||
meta = self._getcontext().cfgimpl_get_meta()
|
||||
if meta is not None:
|
||||
return meta.cfgimpl_get_settings().getpermissives(opt,
|
||||
path)
|
||||
return self._pp_.getpermissives(path)
|
||||
|
||||
def apply_requires(self,
|
||||
@ -600,8 +587,6 @@ class Settings(object):
|
||||
(never save properties if same has option properties)
|
||||
"""
|
||||
# should have index !!!
|
||||
if self._getcontext().cfgimpl_get_meta() is not None:
|
||||
raise ConfigError(_('cannot change property with metaconfig'))
|
||||
if path is not None and option_bag.option.impl_getrequires() is not None:
|
||||
not_allowed_props = properties & \
|
||||
getattr(option_bag.option, '_calc_properties', static_set)
|
||||
@ -650,8 +635,6 @@ class Settings(object):
|
||||
it is better (faster) to set the path parameter
|
||||
instead of passing a :class:`tiramisu.option.Option()` object.
|
||||
"""
|
||||
if self._getcontext().cfgimpl_get_meta() is not None:
|
||||
raise ConfigError(_('cannot change permissive with metaconfig'))
|
||||
if not isinstance(permissives, frozenset):
|
||||
raise TypeError(_('permissive must be a frozenset'))
|
||||
if option_bag is not None:
|
||||
@ -676,8 +659,6 @@ class Settings(object):
|
||||
def reset(self,
|
||||
option_bag):
|
||||
# all_properties=False):
|
||||
if self._getcontext().cfgimpl_get_meta() is not None:
|
||||
raise ConfigError(_('cannot change property with metaconfig'))
|
||||
if option_bag is None:
|
||||
opt = None
|
||||
else:
|
||||
|
Reference in New Issue
Block a user