support metaconfig for check

This commit is contained in:
Emmanuel Garette 2019-02-07 10:39:28 +01:00
parent 0a5e7c5886
commit 7c214bb8ee
3 changed files with 13 additions and 8 deletions

View File

@ -1168,7 +1168,7 @@ class _TiramisuContextConfig(TiramisuContext, _TiramisuContextConfigReset):
return Config(self._config_bag.context.cfgimpl_get_meta())
def path(self):
return self._config_bag.context.cfgimpl_get_path()
return self._config_bag.context.cfgimpl_get_config_path()
class _TiramisuContextGroupConfig(TiramisuContext):
@ -1202,7 +1202,7 @@ class _TiramisuContextGroupConfig(TiramisuContext):
return Config(config)
def path(self):
return self._config_bag.context.cfgimpl_get_path()
return self._config_bag.context.cfgimpl_get_config_path()
class _TiramisuContextMixConfig(_TiramisuContextGroupConfig, _TiramisuContextConfigReset):

View File

@ -617,11 +617,6 @@ class _CommonConfig(SubConfig):
config_bag = ConfigBag(context=self)
descr.impl_build_force_store_values(config_bag)
def cfgimpl_get_path(self, dyn=True):
if self._impl_meta is None or self._impl_meta() is None:
return self._impl_name
return self._impl_meta().cfgimpl_get_path() + '.' + self._impl_name
def cfgimpl_get_meta(self):
if self._impl_meta is not None:
return self._impl_meta()
@ -767,6 +762,11 @@ class KernelConfig(_CommonConfig):
def impl_getname(self):
return self._impl_name
def cfgimpl_get_config_path(self):
if self._impl_meta is None or self._impl_meta() is None:
return self._impl_name
return self._impl_meta().cfgimpl_get_config_path() + '.' + self._impl_name
class KernelGroupConfig(_CommonConfig):
__slots__ = ('__weakref__',
@ -961,6 +961,11 @@ class KernelGroupConfig(_CommonConfig):
return child
raise ConfigError(_('unknown config "{}"').format(name))
def cfgimpl_get_config_path(self):
if self._impl_meta is None or self._impl_meta() is None:
return self._impl_name
return self._impl_meta().cfgimpl_get_config_path() + '.' + self._impl_name
class KernelMixConfig(KernelGroupConfig):
__slots__ = tuple()

View File

@ -160,7 +160,7 @@ class Values(object):
moption_bag = self._get_meta(option_bag)
if moption_bag:
# retrieved value from meta config
return moption_bag.config_bag.context.cfgimpl_get_values().get_cached_value(moption_bag)
return moption_bag.config_bag.context.cfgimpl_get_values().get_cached_value(option_bag)
if opt.impl_has_callback():
# if value has callback, calculate value