Compare commits
3 commits
cc79c28d40
...
9d094a9676
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d094a9676 | |||
| 2c091f7a12 | |||
| 71fbe6dcbd |
6 changed files with 26 additions and 12 deletions
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "tiramisu"
|
name = "tiramisu"
|
||||||
version = "5.2.0a22"
|
version = "5.2.0a23"
|
||||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
description = "an options controller tool"
|
description = "an options controller tool"
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,13 @@ def make_metaconfig(double=False):
|
||||||
conf2.property.read_write()
|
conf2.property.read_write()
|
||||||
meta = MetaConfig([conf1, conf2], name='meta')
|
meta = MetaConfig([conf1, conf2], name='meta')
|
||||||
assert meta.config.type() == 'metaconfig'
|
assert meta.config.type() == 'metaconfig'
|
||||||
|
assert meta.type() == 'metaconfig'
|
||||||
assert meta.config.name() == 'meta'
|
assert meta.config.name() == 'meta'
|
||||||
|
assert meta.name() == 'meta'
|
||||||
|
assert conf1.config.type() == 'config'
|
||||||
|
assert conf1.type() == 'config'
|
||||||
|
assert conf1.config.name() == 'conf1'
|
||||||
|
assert conf1.name() == 'conf1'
|
||||||
if double:
|
if double:
|
||||||
meta.owner.set(owners.meta2)
|
meta.owner.set(owners.meta2)
|
||||||
meta = MetaConfig([meta], name='doublemeta')
|
meta = MetaConfig([meta], name='doublemeta')
|
||||||
|
|
|
||||||
|
|
@ -533,7 +533,7 @@ def test_multi_submulti_meta():
|
||||||
od1 = OptionDescription('od', '', [multi])
|
od1 = OptionDescription('od', '', [multi])
|
||||||
cfg = Config(od1, name='cfg')
|
cfg = Config(od1, name='cfg')
|
||||||
cfg.property.read_write()
|
cfg.property.read_write()
|
||||||
cfg2 = Config(od1)
|
cfg2 = Config(od1, name="cfg2")
|
||||||
cfg2.property.read_write()
|
cfg2.property.read_write()
|
||||||
meta = MetaConfig([cfg, cfg2])
|
meta = MetaConfig([cfg, cfg2])
|
||||||
meta.property.read_write()
|
meta.property.read_write()
|
||||||
|
|
@ -554,7 +554,7 @@ def test_multi_submulti_meta_no_cache():
|
||||||
od1 = OptionDescription('od', '', [multi])
|
od1 = OptionDescription('od', '', [multi])
|
||||||
cfg = Config(od1, name='cfg')
|
cfg = Config(od1, name='cfg')
|
||||||
cfg.property.read_write()
|
cfg.property.read_write()
|
||||||
cfg2 = Config(od1)
|
cfg2 = Config(od1, name="cfg2")
|
||||||
cfg.property.read_write()
|
cfg.property.read_write()
|
||||||
meta = MetaConfig([cfg, cfg2])
|
meta = MetaConfig([cfg, cfg2])
|
||||||
meta.property.read_write()
|
meta.property.read_write()
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
__version__ = "5.2.0a22"
|
__version__ = "5.2.0a23"
|
||||||
|
|
|
||||||
|
|
@ -1211,6 +1211,18 @@ class TiramisuConfig(TiramisuHelp, _TiramisuOptionWalk):
|
||||||
if isinstance(config, KernelGroupConfig):
|
if isinstance(config, KernelGroupConfig):
|
||||||
return GroupConfig(config)
|
return GroupConfig(config)
|
||||||
|
|
||||||
|
def type(self):
|
||||||
|
"""get the type"""
|
||||||
|
config = self._config_bag.context
|
||||||
|
if isinstance(config, KernelConfig):
|
||||||
|
return "config"
|
||||||
|
if isinstance(config, KernelMetaConfig):
|
||||||
|
return "metaconfig"
|
||||||
|
if isinstance(config, KernelMixConfig):
|
||||||
|
return "mixconfig"
|
||||||
|
if isinstance(config, KernelGroupConfig):
|
||||||
|
return "groupconfig"
|
||||||
|
|
||||||
def name(self):
|
def name(self):
|
||||||
"""get the name"""
|
"""get the name"""
|
||||||
return self._config_bag.context.impl_getname()
|
return self._config_bag.context.impl_getname()
|
||||||
|
|
@ -1826,10 +1838,6 @@ class TiramisuContextOption(TiramisuConfig, _TiramisuOptionWalk):
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
|
|
||||||
def name(self):
|
|
||||||
"""Get option name"""
|
|
||||||
return None
|
|
||||||
|
|
||||||
def path(
|
def path(
|
||||||
self,
|
self,
|
||||||
):
|
):
|
||||||
|
|
@ -1851,10 +1859,6 @@ class TiramisuContextOption(TiramisuConfig, _TiramisuOptionWalk):
|
||||||
"""Test if option is a dynamic optiondescription"""
|
"""Test if option is a dynamic optiondescription"""
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def type(self):
|
|
||||||
"""Get de option type"""
|
|
||||||
return "optiondescription"
|
|
||||||
|
|
||||||
def list(
|
def list(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
|
|
|
||||||
|
|
@ -1894,6 +1894,10 @@ class KernelMetaConfig(KernelMixConfig):
|
||||||
raise TypeError(_("child must be a Config or MetaConfig"))
|
raise TypeError(_("child must be a Config or MetaConfig"))
|
||||||
if descr is None:
|
if descr is None:
|
||||||
descr = child.get_description()
|
descr = child.get_description()
|
||||||
|
if child.impl_getname() is None:
|
||||||
|
raise ConfigError(
|
||||||
|
_("children in MetaConfig must have name")
|
||||||
|
)
|
||||||
elif descr is not child.get_description():
|
elif descr is not child.get_description():
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
_(
|
_(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue