support metaconfig for check
This commit is contained in:
parent
0a5e7c5886
commit
7c214bb8ee
|
@ -1168,7 +1168,7 @@ class _TiramisuContextConfig(TiramisuContext, _TiramisuContextConfigReset):
|
||||||
return Config(self._config_bag.context.cfgimpl_get_meta())
|
return Config(self._config_bag.context.cfgimpl_get_meta())
|
||||||
|
|
||||||
def path(self):
|
def path(self):
|
||||||
return self._config_bag.context.cfgimpl_get_path()
|
return self._config_bag.context.cfgimpl_get_config_path()
|
||||||
|
|
||||||
|
|
||||||
class _TiramisuContextGroupConfig(TiramisuContext):
|
class _TiramisuContextGroupConfig(TiramisuContext):
|
||||||
|
@ -1202,7 +1202,7 @@ class _TiramisuContextGroupConfig(TiramisuContext):
|
||||||
return Config(config)
|
return Config(config)
|
||||||
|
|
||||||
def path(self):
|
def path(self):
|
||||||
return self._config_bag.context.cfgimpl_get_path()
|
return self._config_bag.context.cfgimpl_get_config_path()
|
||||||
|
|
||||||
|
|
||||||
class _TiramisuContextMixConfig(_TiramisuContextGroupConfig, _TiramisuContextConfigReset):
|
class _TiramisuContextMixConfig(_TiramisuContextGroupConfig, _TiramisuContextConfigReset):
|
||||||
|
|
|
@ -617,11 +617,6 @@ class _CommonConfig(SubConfig):
|
||||||
config_bag = ConfigBag(context=self)
|
config_bag = ConfigBag(context=self)
|
||||||
descr.impl_build_force_store_values(config_bag)
|
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):
|
def cfgimpl_get_meta(self):
|
||||||
if self._impl_meta is not None:
|
if self._impl_meta is not None:
|
||||||
return self._impl_meta()
|
return self._impl_meta()
|
||||||
|
@ -767,6 +762,11 @@ class KernelConfig(_CommonConfig):
|
||||||
def impl_getname(self):
|
def impl_getname(self):
|
||||||
return self._impl_name
|
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):
|
class KernelGroupConfig(_CommonConfig):
|
||||||
__slots__ = ('__weakref__',
|
__slots__ = ('__weakref__',
|
||||||
|
@ -961,6 +961,11 @@ class KernelGroupConfig(_CommonConfig):
|
||||||
return child
|
return child
|
||||||
raise ConfigError(_('unknown config "{}"').format(name))
|
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):
|
class KernelMixConfig(KernelGroupConfig):
|
||||||
__slots__ = tuple()
|
__slots__ = tuple()
|
||||||
|
|
|
@ -160,7 +160,7 @@ class Values(object):
|
||||||
moption_bag = self._get_meta(option_bag)
|
moption_bag = self._get_meta(option_bag)
|
||||||
if moption_bag:
|
if moption_bag:
|
||||||
# retrieved value from meta config
|
# 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 opt.impl_has_callback():
|
||||||
# if value has callback, calculate value
|
# if value has callback, calculate value
|
||||||
|
|
Loading…
Reference in New Issue