Compare commits
13 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f831f56ac | |||
| c317792292 | |||
| a051c1e713 | |||
| 3fa7beafd6 | |||
| 8ac603100d | |||
| 2f7711d989 | |||
| be491bfdb2 | |||
| dcc42a4ea0 | |||
| d90a0c0066 | |||
| ad1928bc88 | |||
| f65b168c21 | |||
| 5f9c79664f | |||
| 3986026f3b |
30 changed files with 312 additions and 107 deletions
23
CHANGELOG.md
23
CHANGELOG.md
|
|
@ -1,3 +1,26 @@
|
||||||
|
## 1.1.1 (2024-11-06)
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- upgrade tests
|
||||||
|
|
||||||
|
## 1.1.1rc0 (2024-11-06)
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- update tiramisu dependency
|
||||||
|
- better user information if a needed package is not installed
|
||||||
|
- **37**: import doesn't works for some python version
|
||||||
|
- **36**: format 1.0: suffix attribut must works
|
||||||
|
- update fr/rougail.mo
|
||||||
|
|
||||||
|
## 1.1.0 (2024-11-01)
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- black
|
||||||
|
- add changelog_merge_prerelease to commitizen
|
||||||
|
|
||||||
## 1.1.0rc0 (2024-11-01)
|
## 1.1.0rc0 (2024-11-01)
|
||||||
|
|
||||||
### Feat
|
### Feat
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"POT-Creation-Date: 2024-10-30 13:21+0100\n"
|
"POT-Creation-Date: 2024-11-04 12:04+0100\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
|
@ -15,103 +15,103 @@ msgstr ""
|
||||||
"Generated-By: pygettext.py 1.5\n"
|
"Generated-By: pygettext.py 1.5\n"
|
||||||
|
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:142
|
#: src/rougail/annotator/family.py:139
|
||||||
msgid "default variable mode \"{0}\" is not a valid mode, valid modes are {1}"
|
msgid "default variable mode \"{0}\" is not a valid mode, valid modes are {1}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:148
|
#: src/rougail/annotator/family.py:145
|
||||||
msgid "default family mode \"{0}\" is not a valid mode, valid modes are {1}"
|
msgid "default family mode \"{0}\" is not a valid mode, valid modes are {1}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:180
|
#: src/rougail/annotator/family.py:177
|
||||||
msgid "mode \"{0}\" for \"{1}\" is not a valid mode, valid modes are {2}"
|
msgid "mode \"{0}\" for \"{1}\" is not a valid mode, valid modes are {2}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:184
|
#: src/rougail/annotator/family.py:181
|
||||||
msgid "mode \"{0}\" for \"{1}\" is not a valid mode, no modes are available"
|
msgid "mode \"{0}\" for \"{1}\" is not a valid mode, no modes are available"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:248
|
#: src/rougail/annotator/family.py:245
|
||||||
msgid "the variable \"{0}\" is mandatory so in \"{1}\" mode but family has the higher family mode \"{2}\""
|
msgid "the variable \"{0}\" is mandatory so in \"{1}\" mode but family has the higher family mode \"{2}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:286
|
#: src/rougail/annotator/family.py:283
|
||||||
msgid "the follower \"{0}\" is in \"{1}\" mode but leader have the higher mode \"{2}\""
|
msgid "the follower \"{0}\" is in \"{1}\" mode but leader have the higher mode \"{2}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:319
|
#: src/rougail/annotator/family.py:316
|
||||||
msgid "the family \"{0}\" is in \"{1}\" mode but variables and families inside have the higher modes \"{2}\""
|
msgid "the family \"{0}\" is in \"{1}\" mode but variables and families inside have the higher modes \"{2}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:337
|
#: src/rougail/annotator/family.py:334
|
||||||
msgid "the variable \"{0}\" is in \"{1}\" mode but family has the higher family mode \"{2}\""
|
msgid "the variable \"{0}\" is in \"{1}\" mode but family has the higher family mode \"{2}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/value.py:80
|
#: src/rougail/annotator/value.py:77
|
||||||
msgid "the follower \"{0}\" without multi attribute can only have one value"
|
msgid "the follower \"{0}\" without multi attribute can only have one value"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/value.py:96
|
#: src/rougail/annotator/value.py:93
|
||||||
msgid "the variable \"{0}\" is multi but has a non list default value"
|
msgid "the variable \"{0}\" is multi but has a non list default value"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/variable.py:192
|
#: src/rougail/annotator/variable.py:189
|
||||||
msgid "the variable \"{0}\" has regexp attribut but has not the \"regexp\" type"
|
msgid "the variable \"{0}\" has regexp attribut but has not the \"regexp\" type"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/variable.py:235
|
#: src/rougail/annotator/variable.py:232
|
||||||
msgid "the variable \"{0}\" has choices attribut but has not the \"choice\" type"
|
msgid "the variable \"{0}\" has choices attribut but has not the \"choice\" type"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/variable.py:263
|
#: src/rougail/annotator/variable.py:260
|
||||||
msgid "the variable \"{0}\" has an unvalid default value \"{1}\" should be in {2}"
|
msgid "the variable \"{0}\" has an unvalid default value \"{1}\" should be in {2}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/convert.py:268
|
#: src/rougail/convert.py:281
|
||||||
msgid "A variable or a family located in the \"{0}\" namespace shall not be used in the \"{1}\" namespace"
|
msgid "A variable or a family located in the \"{0}\" namespace shall not be used in the \"{1}\" namespace"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/convert.py:462
|
#: src/rougail/convert.py:475
|
||||||
msgid "unknown type {0} for {1}"
|
msgid "unknown type {0} for {1}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/convert.py:1323
|
#: src/rougail/convert.py:1345
|
||||||
msgid "duplicate dictionary file name {0}"
|
msgid "duplicate dictionary file name {0}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/convert.py:1370
|
#: src/rougail/convert.py:1392
|
||||||
msgid "Cannot execute annotate multiple time"
|
msgid "Cannot execute annotate multiple time"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/error.py:70
|
#: src/rougail/error.py:67
|
||||||
msgid "{0} in {1}"
|
msgid "{0} in {1}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/structural_commandline/annotator.py:70
|
#: src/rougail/structural_commandline/annotator.py:67
|
||||||
msgid "alternative_name \"{0}\" conflict with \"--help\""
|
msgid "alternative_name \"{0}\" conflict with \"--help\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/structural_commandline/annotator.py:73
|
#: src/rougail/structural_commandline/annotator.py:72
|
||||||
msgid "conflict alternative_name \"{0}\": \"{1}\" and \"{2}\""
|
msgid "conflict alternative_name \"{0}\": \"{1}\" and \"{2}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/structural_commandline/annotator.py:96
|
#: src/rougail/structural_commandline/annotator.py:95
|
||||||
msgid "negative_description is mandatory for boolean variable, but \"{0}\" hasn't"
|
msgid "negative_description is mandatory for boolean variable, but \"{0}\" hasn't"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/structural_commandline/annotator.py:105
|
#: src/rougail/structural_commandline/annotator.py:104
|
||||||
msgid "negative_description is only available for boolean variable, but \"{0}\" is \"{1}\""
|
msgid "negative_description is only available for boolean variable, but \"{0}\" is \"{1}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/update/update.py:741
|
#: src/rougail/update/update.py:738
|
||||||
msgid "not a XML file: {0}"
|
msgid "not a XML file: {0}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/utils.py:58
|
#: src/rougail/utils.py:55
|
||||||
msgid "invalid variable or family name \"{0}\" must only contains lowercase ascii character, number or _"
|
msgid "invalid variable or family name \"{0}\" must only contains lowercase ascii character, number or _"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/utils.py:120
|
#: src/rougail/utils.py:117
|
||||||
msgid "error in jinja \"{0}\" for the variable \"{1}\": {2}"
|
msgid "error in jinja \"{0}\" for the variable \"{1}\": {2}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,10 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail"
|
name = "rougail"
|
||||||
version = "1.1.0rc0"
|
version = "1.1.1"
|
||||||
authors = [
|
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||||
{name = "Emmanuel Garette", email = "gnunux@gnunux.info"},
|
|
||||||
]
|
|
||||||
description = "A consistency handling system that was initially designed in the configuration management"
|
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
description = "A consistency handling system that was initially designed in the configuration management"
|
||||||
requires-python = ">=3.8"
|
requires-python = ">=3.8"
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
|
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
|
||||||
|
|
@ -29,12 +27,9 @@ dependencies = [
|
||||||
"ruamel.yaml ~= 0.18.6",
|
"ruamel.yaml ~= 0.18.6",
|
||||||
"pydantic ~= 2.9.2",
|
"pydantic ~= 2.9.2",
|
||||||
"jinja2 ~= 3.1.4",
|
"jinja2 ~= 3.1.4",
|
||||||
"tiramisu ~= 5.0.0"
|
"tiramisu >=5.0,<6"
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.urls]
|
|
||||||
Home = "https://forge.cloud.silique.fr/stove/rougail"
|
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
dev = [
|
dev = [
|
||||||
"pylint ~= 3.0.3",
|
"pylint ~= 3.0.3",
|
||||||
|
|
@ -42,9 +37,14 @@ dev = [
|
||||||
"lxml ~= 5.2.2"
|
"lxml ~= 5.2.2"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[project.urls]
|
||||||
|
Home = "https://forge.cloud.silique.fr/stove/rougail"
|
||||||
|
|
||||||
|
|
||||||
[tool.commitizen]
|
[tool.commitizen]
|
||||||
name = "cz_conventional_commits"
|
name = "cz_conventional_commits"
|
||||||
tag_format = "$version"
|
tag_format = "$version"
|
||||||
version_scheme = "pep440"
|
version_scheme = "pep440"
|
||||||
version_provider = "pep621"
|
version_provider = "pep621"
|
||||||
update_changelog_on_bump = true
|
update_changelog_on_bump = true
|
||||||
|
changelog_merge_prerelease = true
|
||||||
|
|
|
||||||
|
|
@ -37,16 +37,23 @@ def get_level(module):
|
||||||
return module.level
|
return module.level
|
||||||
|
|
||||||
|
|
||||||
def get_annotators(annotators, module_name):
|
def get_annotators(annotators, module_name, file_name=None):
|
||||||
annotators[module_name] = []
|
if file_name is None:
|
||||||
|
_module_name = module_name
|
||||||
|
else:
|
||||||
|
_module_name = module_name + "." + file_name
|
||||||
|
full_file_name = f"/{file_name}.py"
|
||||||
|
annotators[_module_name] = []
|
||||||
for pathobj in importlib.resources.files(module_name).iterdir():
|
for pathobj in importlib.resources.files(module_name).iterdir():
|
||||||
path = str(pathobj)
|
path = str(pathobj)
|
||||||
if not path.endswith(".py") or path.endswith("__.py"):
|
if not path.endswith(".py") or path.endswith("__.py"):
|
||||||
continue
|
continue
|
||||||
|
if file_name is not None and not path.endswith(full_file_name):
|
||||||
|
continue
|
||||||
module = load_modules(module_name, path)
|
module = load_modules(module_name, path)
|
||||||
if "Annotator" not in dir(module):
|
if "Annotator" not in dir(module):
|
||||||
continue
|
continue
|
||||||
annotators[module_name].append(module.Annotator)
|
annotators[_module_name].append(module.Annotator)
|
||||||
|
|
||||||
|
|
||||||
class SpaceAnnotator: # pylint: disable=R0903
|
class SpaceAnnotator: # pylint: disable=R0903
|
||||||
|
|
@ -66,7 +73,7 @@ class SpaceAnnotator: # pylint: disable=R0903
|
||||||
get_annotators(ANNOTATORS, extra_annotator)
|
get_annotators(ANNOTATORS, extra_annotator)
|
||||||
for plugin in objectspace.plugins:
|
for plugin in objectspace.plugins:
|
||||||
try:
|
try:
|
||||||
get_annotators(ANNOTATORS, f"rougail.{plugin}.annotator")
|
get_annotators(ANNOTATORS, f"rougail.{plugin}", "annotator")
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
pass
|
pass
|
||||||
annotators = ANNOTATORS["rougail.annotator"].copy()
|
annotators = ANNOTATORS["rougail.annotator"].copy()
|
||||||
|
|
|
||||||
|
|
@ -259,5 +259,9 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||||
if value not in choices:
|
if value not in choices:
|
||||||
msg = _(
|
msg = _(
|
||||||
'the variable "{0}" has an unvalid default value "{1}" should be in {2}'
|
'the variable "{0}" has an unvalid default value "{1}" should be in {2}'
|
||||||
).format(variable.path, value, display_list(choices, separator="or", add_quote=True))
|
).format(
|
||||||
|
variable.path,
|
||||||
|
value,
|
||||||
|
display_list(choices, separator="or", add_quote=True),
|
||||||
|
)
|
||||||
raise DictConsistencyError(msg, 26, variable.xmlfiles)
|
raise DictConsistencyError(msg, 26, variable.xmlfiles)
|
||||||
|
|
|
||||||
|
|
@ -403,7 +403,7 @@ suffix:
|
||||||
disabled:
|
disabled:
|
||||||
variable: upgrade"""
|
variable: upgrade"""
|
||||||
for process in processes:
|
for process in processes:
|
||||||
if processes[process] or process == 'output':
|
if processes[process]:
|
||||||
objects = processes[process]
|
objects = processes[process]
|
||||||
rougail_process += """
|
rougail_process += """
|
||||||
{NAME}:
|
{NAME}:
|
||||||
|
|
@ -435,20 +435,30 @@ suffix:
|
||||||
rougail_process += """ {% if _.output == 'NAME' %}
|
rougail_process += """ {% if _.output == 'NAME' %}
|
||||||
Cannot load user data for NAME output
|
Cannot load user data for NAME output
|
||||||
{% endif %}
|
{% endif %}
|
||||||
""".replace("NAME", hidden_output)
|
""".replace(
|
||||||
|
"NAME", hidden_output
|
||||||
|
)
|
||||||
elif objects:
|
elif objects:
|
||||||
rougail_process += " default: {DEFAULT}".format(
|
rougail_process += " default: {DEFAULT}".format(
|
||||||
DEFAULT=objects[0]["name"]
|
DEFAULT=objects[0]["name"]
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
if process == 'output':
|
||||||
|
prop = 'hidden'
|
||||||
|
else:
|
||||||
|
prop = 'disabled'
|
||||||
rougail_process += """
|
rougail_process += """
|
||||||
{NAME}:
|
{NAME}:
|
||||||
description: Select for {NAME}
|
description: Select for {NAME}
|
||||||
hidden: true
|
|
||||||
mandatory: false
|
mandatory: false
|
||||||
|
{PROP}: true
|
||||||
multi: true
|
multi: true
|
||||||
|
default: ["You haven't installed \\\"{NAME}\\\" package for rougail"]
|
||||||
|
validators:
|
||||||
|
- jinja: Please install a rougail-{NAME}-* package.
|
||||||
""".format(
|
""".format(
|
||||||
NAME=normalize_family(process),
|
NAME=normalize_family(process),
|
||||||
|
PROP=prop,
|
||||||
)
|
)
|
||||||
rougail_options += rougail_process
|
rougail_options += rougail_process
|
||||||
convert = FakeRougailConvert(add_extra_options)
|
convert = FakeRougailConvert(add_extra_options)
|
||||||
|
|
|
||||||
|
|
@ -162,45 +162,61 @@ class Paths:
|
||||||
path = get_realpath(path, identifier_path)
|
path = get_realpath(path, identifier_path)
|
||||||
dynamic = None
|
dynamic = None
|
||||||
# version 1.0
|
# version 1.0
|
||||||
if (
|
if version == "1.0":
|
||||||
version == "1.0"
|
if not path in self._data and "{{ suffix }}" not in path:
|
||||||
and not path in self._data
|
new_path = None
|
||||||
and "{{ identifier }}" not in path
|
current_path = None
|
||||||
):
|
identifiers = []
|
||||||
new_path = None
|
for name in path.split("."):
|
||||||
current_path = None
|
parent_path = current_path
|
||||||
for name in path.split("."):
|
if current_path:
|
||||||
parent_path = current_path
|
current_path += "." + name
|
||||||
if current_path:
|
|
||||||
current_path += "." + name
|
|
||||||
else:
|
|
||||||
current_path = name
|
|
||||||
if current_path in self._data:
|
|
||||||
if new_path:
|
|
||||||
new_path += "." + name
|
|
||||||
else:
|
else:
|
||||||
new_path = name
|
current_path = name
|
||||||
continue
|
if current_path in self._data:
|
||||||
for dynamic_path in self._dynamics:
|
if new_path:
|
||||||
if "." in dynamic_path:
|
new_path += "." + name
|
||||||
parent_dynamic, name_dynamic = dynamic_path.rsplit(".", 1)
|
else:
|
||||||
else:
|
new_path = name
|
||||||
parent_dynamic = None
|
continue
|
||||||
name_dynamic = dynamic_path
|
for dynamic_path in self._dynamics:
|
||||||
if (
|
if "." in dynamic_path:
|
||||||
parent_dynamic == parent_path
|
parent_dynamic, name_dynamic = dynamic_path.rsplit(".", 1)
|
||||||
and name_dynamic.endswith("{{ identifier }}")
|
else:
|
||||||
and name == name_dynamic.replace("{{ identifier }}", "")
|
parent_dynamic = None
|
||||||
):
|
name_dynamic = dynamic_path
|
||||||
new_path += "." + name_dynamic
|
if (
|
||||||
|
parent_dynamic == parent_path
|
||||||
|
and name_dynamic.endswith("{{ identifier }}")
|
||||||
|
and name == name_dynamic.replace("{{ identifier }}", "")
|
||||||
|
):
|
||||||
|
new_path += "." + name_dynamic
|
||||||
|
break
|
||||||
|
regexp = "^" + name_dynamic.replace("{{ identifier }}", "(.*)")
|
||||||
|
finded = findall(regexp, name)
|
||||||
|
if len(finded) != 1 or not finded[0]:
|
||||||
|
continue
|
||||||
|
if finded[0] == "{{ identifier }}":
|
||||||
|
identifiers.append(None)
|
||||||
|
else:
|
||||||
|
identifiers.append(finded[0])
|
||||||
|
if new_path is None:
|
||||||
|
new_path = name_dynamic
|
||||||
|
else:
|
||||||
|
new_path += "." + name_dynamic
|
||||||
|
parent_path = dynamic_path
|
||||||
break
|
break
|
||||||
else:
|
|
||||||
if new_path:
|
|
||||||
new_path += "." + name
|
|
||||||
else:
|
else:
|
||||||
new_path = name
|
if new_path:
|
||||||
path = new_path
|
new_path += "." + name
|
||||||
if version != "1.0" and not path in self._data:
|
else:
|
||||||
|
new_path = name
|
||||||
|
path = new_path
|
||||||
|
else:
|
||||||
|
identifiers = None
|
||||||
|
if "{{ suffix }}" in path:
|
||||||
|
path = path.replace("{{ suffix }}", "{{ identifier }}")
|
||||||
|
elif not path in self._data:
|
||||||
current_path = None
|
current_path = None
|
||||||
parent_path = None
|
parent_path = None
|
||||||
new_path = current_path
|
new_path = current_path
|
||||||
|
|
@ -467,11 +483,15 @@ class ParserVariable:
|
||||||
extra_keys = set(obj) - self.variable_attrs
|
extra_keys = set(obj) - self.variable_attrs
|
||||||
if not extra_keys:
|
if not extra_keys:
|
||||||
for key, value in obj.items():
|
for key, value in obj.items():
|
||||||
if isinstance(value, dict) and key != 'params' and not self.is_calculation(
|
if (
|
||||||
key,
|
isinstance(value, dict)
|
||||||
value,
|
and key != "params"
|
||||||
self.variable_calculations,
|
and not self.is_calculation(
|
||||||
False,
|
key,
|
||||||
|
value,
|
||||||
|
self.variable_calculations,
|
||||||
|
False,
|
||||||
|
)
|
||||||
):
|
):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
|
@ -628,14 +648,17 @@ class ParserVariable:
|
||||||
family_obj["type"] = obj_type = "dynamic"
|
family_obj["type"] = obj_type = "dynamic"
|
||||||
if obj_type == "dynamic":
|
if obj_type == "dynamic":
|
||||||
family_is_dynamic = True
|
family_is_dynamic = True
|
||||||
parent_dynamic = path
|
|
||||||
if "{{ identifier }}" not in name:
|
if "{{ identifier }}" not in name:
|
||||||
if "variable" in family_obj:
|
if version == "1.0" and "{{ suffix }}" in name:
|
||||||
|
name = name.replace("{{ suffix }}", "{{ identifier }}")
|
||||||
|
path = path.replace("{{ suffix }}", "{{ identifier }}")
|
||||||
|
elif "variable" in family_obj:
|
||||||
name += "{{ identifier }}"
|
name += "{{ identifier }}"
|
||||||
path += "{{ identifier }}"
|
path += "{{ identifier }}"
|
||||||
else:
|
else:
|
||||||
msg = f'dynamic family name must have "{{{{ identifier }}}}" in his name for "{path}"'
|
msg = f'dynamic family name must have "{{{{ identifier }}}}" in his name for "{path}"'
|
||||||
raise DictConsistencyError(msg, 13, [filename])
|
raise DictConsistencyError(msg, 13, [filename])
|
||||||
|
parent_dynamic = path
|
||||||
if version != "1.0" and not family_obj and comment:
|
if version != "1.0" and not family_obj and comment:
|
||||||
family_obj["description"] = comment
|
family_obj["description"] = comment
|
||||||
self.add_family(
|
self.add_family(
|
||||||
|
|
@ -1095,6 +1118,8 @@ class ParserVariable:
|
||||||
"type": "any",
|
"type": "any",
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
|
if version == "1.0" and val["type"] == "suffix":
|
||||||
|
val["type"] = "identifier"
|
||||||
param_typ = val["type"]
|
param_typ = val["type"]
|
||||||
val["key"] = key
|
val["key"] = key
|
||||||
val["path"] = path
|
val["path"] = path
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
from gettext import translation
|
from gettext import translation
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
t = translation('rougail', str(Path(__file__).parent / 'locale'), fallback=True)
|
t = translation("rougail", str(Path(__file__).parent / "locale"), fallback=True)
|
||||||
|
|
||||||
_ = t.gettext
|
_ = t.gettext
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -687,6 +687,7 @@ CALCULATION_TYPES = {
|
||||||
"variable": VariableCalculation,
|
"variable": VariableCalculation,
|
||||||
"information": InformationCalculation,
|
"information": InformationCalculation,
|
||||||
"identifier": IdentifierCalculation,
|
"identifier": IdentifierCalculation,
|
||||||
|
"suffix": IdentifierCalculation,
|
||||||
"index": IndexCalculation,
|
"index": IndexCalculation,
|
||||||
}
|
}
|
||||||
CALCULATION_PROPERTY_TYPES = {
|
CALCULATION_PROPERTY_TYPES = {
|
||||||
|
|
|
||||||
|
|
@ -64,12 +64,14 @@ class Annotator(Walk):
|
||||||
for letter in alternative_name:
|
for letter in alternative_name:
|
||||||
all_letters += letter
|
all_letters += letter
|
||||||
if all_letters == "h":
|
if all_letters == "h":
|
||||||
msg = _('alternative_name "{0}" conflict with "--help"').format(alternative_name)
|
msg = _('alternative_name "{0}" conflict with "--help"').format(
|
||||||
|
alternative_name
|
||||||
|
)
|
||||||
raise DictConsistencyError(msg, 202, variable.xmlfiles)
|
raise DictConsistencyError(msg, 202, variable.xmlfiles)
|
||||||
if all_letters in self.alternative_names:
|
if all_letters in self.alternative_names:
|
||||||
msg = _(
|
msg = _('conflict alternative_name "{0}": "{1}" and "{2}"').format(
|
||||||
'conflict alternative_name "{0}": "{1}" and "{2}"'
|
alternative_name, variable_path, self.alternative_names[all_letters]
|
||||||
).format(alternative_name, variable_path, self.alternative_names[all_letters])
|
)
|
||||||
raise DictConsistencyError(msg, 202, variable.xmlfiles)
|
raise DictConsistencyError(msg, 202, variable.xmlfiles)
|
||||||
|
|
||||||
self.alternative_names[alternative_name] = variable_path
|
self.alternative_names[alternative_name] = variable_path
|
||||||
|
|
|
||||||
|
|
@ -114,9 +114,9 @@ def get_jinja_variable_to_param(
|
||||||
for g in parsed_content.find_all(Getattr):
|
for g in parsed_content.find_all(Getattr):
|
||||||
variables.add(recurse_getattr(g))
|
variables.add(recurse_getattr(g))
|
||||||
except TemplateSyntaxError as err:
|
except TemplateSyntaxError as err:
|
||||||
msg = _(
|
msg = _('error in jinja "{0}" for the variable "{1}": {2}').format(
|
||||||
'error in jinja "{0}" for the variable "{1}": {2}'
|
jinja_text, current_path, err
|
||||||
).format(jinja_text, current_path, err)
|
)
|
||||||
raise DictConsistencyError(msg, 39, xmlfiles) from err
|
raise DictConsistencyError(msg, 39, xmlfiles) from err
|
||||||
variables = list(variables)
|
variables = list(variables)
|
||||||
variables.sort(reverse=True)
|
variables.sort(reverse=True)
|
||||||
|
|
|
||||||
|
|
@ -31,3 +31,10 @@ var5:
|
||||||
type: boolean
|
type: boolean
|
||||||
test:
|
test:
|
||||||
- false
|
- false
|
||||||
|
|
||||||
|
var6:
|
||||||
|
description: the sixth variable
|
||||||
|
multi: true
|
||||||
|
test:
|
||||||
|
- test1
|
||||||
|
- test2
|
||||||
|
|
|
||||||
|
|
@ -18,5 +18,9 @@
|
||||||
"rougail.var5": {
|
"rougail.var5": {
|
||||||
"owner": "default",
|
"owner": "default",
|
||||||
"value": true
|
"value": true
|
||||||
|
},
|
||||||
|
"rougail.var6": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,6 @@
|
||||||
"rougail.var2": "value",
|
"rougail.var2": "value",
|
||||||
"rougail.var3": null,
|
"rougail.var3": null,
|
||||||
"rougail.var4": null,
|
"rougail.var4": null,
|
||||||
"rougail.var5": true
|
"rougail.var5": true,
|
||||||
|
"rougail.var6": []
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,5 +18,9 @@
|
||||||
"rougail.var5": {
|
"rougail.var5": {
|
||||||
"owner": "default",
|
"owner": "default",
|
||||||
"value": true
|
"value": true
|
||||||
|
},
|
||||||
|
"rougail.var6": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
["rougail.var1", "rougail.var3"]
|
["rougail.var1", "rougail.var3", "rougail.var6"]
|
||||||
|
|
@ -15,5 +15,6 @@ option_3 = StrOption(name="var2", doc="the second variable", default="value", pr
|
||||||
option_4 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
option_4 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
||||||
option_5 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')})
|
option_5 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')})
|
||||||
option_6 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)})
|
option_6 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)})
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3, option_4, option_5, option_6], properties=frozenset({"basic"}))
|
option_7 = StrOption(name="var6", doc="the sixth variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
||||||
|
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3, option_4, option_5, option_6, option_7], properties=frozenset({"basic"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,15 @@ option_4 = StrOption(name="var2", doc="the second variable", default="value", pr
|
||||||
option_5 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
option_5 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
||||||
option_6 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')})
|
option_6 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')})
|
||||||
option_7 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)})
|
option_7 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)})
|
||||||
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5, option_6, option_7], properties=frozenset({"basic"}))
|
option_8 = StrOption(name="var6", doc="the sixth variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5, option_6, option_7, option_8], properties=frozenset({"basic"}))
|
||||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
option_10 = StrOption(name="var1", doc="the first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test',)})
|
option_11 = StrOption(name="var1", doc="the first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test',)})
|
||||||
option_11 = StrOption(name="var2", doc="the second variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string', 'test': ('test',)})
|
option_12 = StrOption(name="var2", doc="the second variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string', 'test': ('test',)})
|
||||||
option_12 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
option_13 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
||||||
option_13 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')})
|
option_14 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')})
|
||||||
option_14 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)})
|
option_15 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)})
|
||||||
optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_10, option_11, option_12, option_13, option_14], properties=frozenset({"basic"}))
|
option_16 = StrOption(name="var6", doc="the sixth variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
||||||
optiondescription_8 = OptionDescription(name="2", doc="2", children=[optiondescription_9], properties=frozenset({"basic"}))
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_11, option_12, option_13, option_14, option_15, option_16], properties=frozenset({"basic"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_8])
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_9])
|
||||||
|
|
|
||||||
|
|
@ -11,4 +11,5 @@ option_2 = StrOption(name="var2", doc="the second variable", default="value", pr
|
||||||
option_3 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
option_3 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
||||||
option_4 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')})
|
option_4 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')})
|
||||||
option_5 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)})
|
option_5 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)})
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2, option_3, option_4, option_5])
|
option_6 = StrOption(name="var6", doc="the sixth variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2, option_3, option_4, option_5, option_6])
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
---
|
---
|
||||||
version: '1.1'
|
version: '1.1'
|
||||||
|
|
||||||
var: # A suffix variable
|
var: # A suffix variable
|
||||||
- val1
|
- val1
|
||||||
- val2
|
- val2
|
||||||
|
|
||||||
"dyn{{ identifier }}":
|
"dyn{{ identifier }}":
|
||||||
description: A dynamic family
|
description: A dynamic family
|
||||||
dynamic:
|
dynamic:
|
||||||
|
|
|
||||||
0
tests/dictionaries/60_0family_dynamic_test/__init__.py
Normal file
0
tests/dictionaries/60_0family_dynamic_test/__init__.py
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
---
|
||||||
|
version: '1.1'
|
||||||
|
|
||||||
|
var:
|
||||||
|
description: A suffix variable
|
||||||
|
multi: true
|
||||||
|
test:
|
||||||
|
- val1
|
||||||
|
- val2
|
||||||
|
|
||||||
|
"dyn{{ identifier }}":
|
||||||
|
description: A dynamic family
|
||||||
|
dynamic:
|
||||||
|
variable: _.var
|
||||||
|
|
||||||
|
var: # A dynamic variable
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"rougail.var": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": [
|
||||||
|
"val1",
|
||||||
|
"val2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"rougail.dynval1.var": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
"rougail.dynval2.var": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"rougail.var": [
|
||||||
|
"val1",
|
||||||
|
"val2"
|
||||||
|
],
|
||||||
|
"rougail.dynval1.var": null,
|
||||||
|
"rougail.dynval2.var": null
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"rougail.var": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": [
|
||||||
|
"val1",
|
||||||
|
"val2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"rougail.dynval1.var": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
"rougail.dynval2.var": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
["rougail.dynval1.var", "rougail.dynval2.var"]
|
||||||
17
tests/dictionaries/60_0family_dynamic_test/tiramisu/base.py
Normal file
17
tests/dictionaries/60_0family_dynamic_test/tiramisu/base.py
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_2 = StrOption(name="var", doc="A suffix variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="var", doc="A dynamic variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
optiondescription_3 = ConvertDynOptionDescription(name="dyn{{ identifier }}", doc="A dynamic family", identifiers=Calculation(func['calc_value'], Params((ParamOption(option_2)))), children=[option_4], properties=frozenset({"basic"}), informations={'dynamic_variable': 'rougail.var'})
|
||||||
|
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, optiondescription_3], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
||||||
23
tests/dictionaries/60_0family_dynamic_test/tiramisu/multi.py
Normal file
23
tests/dictionaries/60_0family_dynamic_test/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="var", doc="A suffix variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_5 = StrOption(name="var", doc="A dynamic variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
optiondescription_4 = ConvertDynOptionDescription(name="dyn{{ identifier }}", doc="A dynamic family", identifiers=Calculation(func['calc_value'], Params((ParamOption(option_3)))), children=[option_5], properties=frozenset({"basic"}), informations={'dynamic_variable': '1.rougail.var'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, optiondescription_4], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_8 = StrOption(name="var", doc="A suffix variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_10 = StrOption(name="var", doc="A dynamic variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
optiondescription_9 = ConvertDynOptionDescription(name="dyn{{ identifier }}", doc="A dynamic family", identifiers=Calculation(func['calc_value'], Params((ParamOption(option_8)))), children=[option_10], properties=frozenset({"basic"}), informations={'dynamic_variable': '2.rougail.var'})
|
||||||
|
optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_8, optiondescription_9], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_6 = OptionDescription(name="2", doc="2", children=[optiondescription_7], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_6])
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_1 = StrOption(name="var", doc="A suffix variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_3 = StrOption(name="var", doc="A dynamic variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = ConvertDynOptionDescription(name="dyn{{ identifier }}", doc="A dynamic family", identifiers=Calculation(func['calc_value'], Params((ParamOption(option_1)))), children=[option_3], properties=frozenset({"basic"}), informations={'dynamic_variable': 'var'})
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, optiondescription_2])
|
||||||
Loading…
Reference in a new issue