feat: tags for family
This commit is contained in:
parent
2c1f2e7d9b
commit
24d87c3395
3 changed files with 14 additions and 8 deletions
|
|
@ -25,7 +25,7 @@ classifiers = [
|
||||||
|
|
||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ruamel.yaml ~= 0.19.1",
|
"ruamel.yaml ~= 0.19.1", # same version as rougail-user-data-yaml
|
||||||
"pydantic ~= 2.13.4",
|
"pydantic ~= 2.13.4",
|
||||||
"rougail-base == 1.2.0rc3",
|
"rougail-base == 1.2.0rc3",
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ class Annotator(Walk):
|
||||||
"""convert families"""
|
"""convert families"""
|
||||||
for family in self.get_families():
|
for family in self.get_families():
|
||||||
self.family_variable_property(family)
|
self.family_variable_property(family)
|
||||||
|
self.convert_tag(family)
|
||||||
# collect for force_default_on_freeze
|
# collect for force_default_on_freeze
|
||||||
if family.hidden:
|
if family.hidden:
|
||||||
if family.hidden is True:
|
if family.hidden is True:
|
||||||
|
|
@ -164,7 +165,11 @@ class Annotator(Walk):
|
||||||
self.objectspace.properties.add(path, "notunique", True)
|
self.objectspace.properties.add(path, "notunique", True)
|
||||||
if variable.auto_save:
|
if variable.auto_save:
|
||||||
self.objectspace.properties.add(path, "force_store_value", True)
|
self.objectspace.properties.add(path, "force_store_value", True)
|
||||||
if variable.tags:
|
self.convert_tag(variable)
|
||||||
|
|
||||||
|
def convert_tag(self, variable):
|
||||||
|
if not variable.tags:
|
||||||
|
return
|
||||||
for tag in variable.tags:
|
for tag in variable.tags:
|
||||||
self.check_tag(tag, variable.xmlfiles)
|
self.check_tag(tag, variable.xmlfiles)
|
||||||
self.objectspace.properties.add(variable.path, tag, True)
|
self.objectspace.properties.add(variable.path, tag, True)
|
||||||
|
|
|
||||||
|
|
@ -1063,6 +1063,7 @@ class Family(BaseModel):
|
||||||
# properties
|
# properties
|
||||||
hidden: Union[bool, Calculation] = False
|
hidden: Union[bool, Calculation] = False
|
||||||
disabled: Union[bool, Calculation] = False
|
disabled: Union[bool, Calculation] = False
|
||||||
|
tags: Optional[List[StrictStr]] = None
|
||||||
# others
|
# others
|
||||||
namespace: Optional[StrictStr]
|
namespace: Optional[StrictStr]
|
||||||
path: StrictStr
|
path: StrictStr
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue