Compare commits

...

13 commits

30 changed files with 312 additions and 107 deletions

View file

@ -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)
### Feat

View file

@ -5,7 +5,7 @@
msgid ""
msgstr ""
"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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -15,103 +15,103 @@ msgstr ""
"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}"
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}"
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}"
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"
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}\""
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}\""
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}\""
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}\""
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"
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"
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"
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"
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}"
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"
msgstr ""
#: src/rougail/convert.py:462
#: src/rougail/convert.py:475
msgid "unknown type {0} for {1}"
msgstr ""
#: src/rougail/convert.py:1323
#: src/rougail/convert.py:1345
msgid "duplicate dictionary file name {0}"
msgstr ""
#: src/rougail/convert.py:1370
#: src/rougail/convert.py:1392
msgid "Cannot execute annotate multiple time"
msgstr ""
#: src/rougail/error.py:70
#: src/rougail/error.py:67
msgid "{0} in {1}"
msgstr ""
#: src/rougail/structural_commandline/annotator.py:70
#: src/rougail/structural_commandline/annotator.py:67
msgid "alternative_name \"{0}\" conflict with \"--help\""
msgstr ""
#: src/rougail/structural_commandline/annotator.py:73
#: src/rougail/structural_commandline/annotator.py:72
msgid "conflict alternative_name \"{0}\": \"{1}\" and \"{2}\""
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"
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}\""
msgstr ""
#: src/rougail/update/update.py:741
#: src/rougail/update/update.py:738
msgid "not a XML file: {0}"
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 _"
msgstr ""
#: src/rougail/utils.py:120
#: src/rougail/utils.py:117
msgid "error in jinja \"{0}\" for the variable \"{1}\": {2}"
msgstr ""

View file

@ -4,12 +4,10 @@ requires = ["flit_core >=3.8.0,<4"]
[project]
name = "rougail"
version = "1.1.0rc0"
authors = [
{name = "Emmanuel Garette", email = "gnunux@gnunux.info"},
]
description = "A consistency handling system that was initially designed in the configuration management"
version = "1.1.1"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
readme = "README.md"
description = "A consistency handling system that was initially designed in the configuration management"
requires-python = ">=3.8"
classifiers = [
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
@ -29,12 +27,9 @@ dependencies = [
"ruamel.yaml ~= 0.18.6",
"pydantic ~= 2.9.2",
"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]
dev = [
"pylint ~= 3.0.3",
@ -42,9 +37,14 @@ dev = [
"lxml ~= 5.2.2"
]
[project.urls]
Home = "https://forge.cloud.silique.fr/stove/rougail"
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "$version"
version_scheme = "pep440"
version_provider = "pep621"
update_changelog_on_bump = true
changelog_merge_prerelease = true

View file

@ -37,16 +37,23 @@ def get_level(module):
return module.level
def get_annotators(annotators, module_name):
annotators[module_name] = []
def get_annotators(annotators, module_name, file_name=None):
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():
path = str(pathobj)
if not path.endswith(".py") or path.endswith("__.py"):
continue
if file_name is not None and not path.endswith(full_file_name):
continue
module = load_modules(module_name, path)
if "Annotator" not in dir(module):
continue
annotators[module_name].append(module.Annotator)
annotators[_module_name].append(module.Annotator)
class SpaceAnnotator: # pylint: disable=R0903
@ -66,7 +73,7 @@ class SpaceAnnotator: # pylint: disable=R0903
get_annotators(ANNOTATORS, extra_annotator)
for plugin in objectspace.plugins:
try:
get_annotators(ANNOTATORS, f"rougail.{plugin}.annotator")
get_annotators(ANNOTATORS, f"rougail.{plugin}", "annotator")
except ModuleNotFoundError:
pass
annotators = ANNOTATORS["rougail.annotator"].copy()

View file

@ -259,5 +259,9 @@ class Annotator(Walk): # pylint: disable=R0903
if value not in choices:
msg = _(
'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)

View file

@ -403,7 +403,7 @@ suffix:
disabled:
variable: upgrade"""
for process in processes:
if processes[process] or process == 'output':
if processes[process]:
objects = processes[process]
rougail_process += """
{NAME}:
@ -435,20 +435,30 @@ suffix:
rougail_process += """ {% if _.output == 'NAME' %}
Cannot load user data for NAME output
{% endif %}
""".replace("NAME", hidden_output)
""".replace(
"NAME", hidden_output
)
elif objects:
rougail_process += " default: {DEFAULT}".format(
DEFAULT=objects[0]["name"]
)
else:
if process == 'output':
prop = 'hidden'
else:
prop = 'disabled'
rougail_process += """
{NAME}:
description: Select for {NAME}
hidden: true
mandatory: false
{PROP}: true
multi: true
default: ["You haven't installed \\\"{NAME}\\\" package for rougail"]
validators:
- jinja: Please install a rougail-{NAME}-* package.
""".format(
NAME=normalize_family(process),
PROP=prop,
)
rougail_options += rougail_process
convert = FakeRougailConvert(add_extra_options)

View file

@ -162,45 +162,61 @@ class Paths:
path = get_realpath(path, identifier_path)
dynamic = None
# version 1.0
if (
version == "1.0"
and not path in self._data
and "{{ identifier }}" not in path
):
new_path = None
current_path = None
for name in path.split("."):
parent_path = current_path
if current_path:
current_path += "." + name
else:
current_path = name
if current_path in self._data:
if new_path:
new_path += "." + name
if version == "1.0":
if not path in self._data and "{{ suffix }}" not in path:
new_path = None
current_path = None
identifiers = []
for name in path.split("."):
parent_path = current_path
if current_path:
current_path += "." + name
else:
new_path = name
continue
for dynamic_path in self._dynamics:
if "." in dynamic_path:
parent_dynamic, name_dynamic = dynamic_path.rsplit(".", 1)
else:
parent_dynamic = None
name_dynamic = dynamic_path
if (
parent_dynamic == parent_path
and name_dynamic.endswith("{{ identifier }}")
and name == name_dynamic.replace("{{ identifier }}", "")
):
new_path += "." + name_dynamic
current_path = name
if current_path in self._data:
if new_path:
new_path += "." + name
else:
new_path = name
continue
for dynamic_path in self._dynamics:
if "." in dynamic_path:
parent_dynamic, name_dynamic = dynamic_path.rsplit(".", 1)
else:
parent_dynamic = None
name_dynamic = dynamic_path
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
else:
if new_path:
new_path += "." + name
else:
new_path = name
path = new_path
if version != "1.0" and not path in self._data:
if new_path:
new_path += "." + name
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
parent_path = None
new_path = current_path
@ -467,11 +483,15 @@ class ParserVariable:
extra_keys = set(obj) - self.variable_attrs
if not extra_keys:
for key, value in obj.items():
if isinstance(value, dict) and key != 'params' and not self.is_calculation(
key,
value,
self.variable_calculations,
False,
if (
isinstance(value, dict)
and key != "params"
and not self.is_calculation(
key,
value,
self.variable_calculations,
False,
)
):
break
else:
@ -628,14 +648,17 @@ class ParserVariable:
family_obj["type"] = obj_type = "dynamic"
if obj_type == "dynamic":
family_is_dynamic = True
parent_dynamic = path
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 }}"
path += "{{ identifier }}"
else:
msg = f'dynamic family name must have "{{{{ identifier }}}}" in his name for "{path}"'
raise DictConsistencyError(msg, 13, [filename])
parent_dynamic = path
if version != "1.0" and not family_obj and comment:
family_obj["description"] = comment
self.add_family(
@ -1095,6 +1118,8 @@ class ParserVariable:
"type": "any",
}
else:
if version == "1.0" and val["type"] == "suffix":
val["type"] = "identifier"
param_typ = val["type"]
val["key"] = key
val["path"] = path

View file

@ -27,6 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
from gettext import translation
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

View file

@ -687,6 +687,7 @@ CALCULATION_TYPES = {
"variable": VariableCalculation,
"information": InformationCalculation,
"identifier": IdentifierCalculation,
"suffix": IdentifierCalculation,
"index": IndexCalculation,
}
CALCULATION_PROPERTY_TYPES = {

View file

@ -64,12 +64,14 @@ class Annotator(Walk):
for letter in alternative_name:
all_letters += letter
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)
if all_letters in self.alternative_names:
msg = _(
'conflict alternative_name "{0}": "{1}" and "{2}"'
).format(alternative_name, variable_path, self.alternative_names[all_letters])
msg = _('conflict alternative_name "{0}": "{1}" and "{2}"').format(
alternative_name, variable_path, self.alternative_names[all_letters]
)
raise DictConsistencyError(msg, 202, variable.xmlfiles)
self.alternative_names[alternative_name] = variable_path

View file

@ -114,9 +114,9 @@ def get_jinja_variable_to_param(
for g in parsed_content.find_all(Getattr):
variables.add(recurse_getattr(g))
except TemplateSyntaxError as err:
msg = _(
'error in jinja "{0}" for the variable "{1}": {2}'
).format(jinja_text, current_path, err)
msg = _('error in jinja "{0}" for the variable "{1}": {2}').format(
jinja_text, current_path, err
)
raise DictConsistencyError(msg, 39, xmlfiles) from err
variables = list(variables)
variables.sort(reverse=True)

View file

@ -31,3 +31,10 @@ var5:
type: boolean
test:
- false
var6:
description: the sixth variable
multi: true
test:
- test1
- test2

View file

@ -18,5 +18,9 @@
"rougail.var5": {
"owner": "default",
"value": true
},
"rougail.var6": {
"owner": "default",
"value": []
}
}

View file

@ -3,5 +3,6 @@
"rougail.var2": "value",
"rougail.var3": null,
"rougail.var4": null,
"rougail.var5": true
"rougail.var5": true,
"rougail.var6": []
}

View file

@ -18,5 +18,9 @@
"rougail.var5": {
"owner": "default",
"value": true
},
"rougail.var6": {
"owner": "default",
"value": []
}
}

View file

@ -1 +1 @@
["rougail.var1", "rougail.var3"]
["rougail.var1", "rougail.var3", "rougail.var6"]

View file

@ -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_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,)})
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])

View file

@ -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_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,)})
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"}))
option_10 = 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="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 = 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"}))
optiondescription_8 = OptionDescription(name="2", doc="2", children=[optiondescription_9], properties=frozenset({"basic"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_8])
option_11 = StrOption(name="var1", doc="the first variable", properties=frozenset({"basic", "mandatory"}), 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_13 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
option_14 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')})
option_15 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)})
option_16 = StrOption(name="var6", doc="the sixth variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
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"}))
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])

View file

@ -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_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_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])

View file

@ -1,8 +1,10 @@
---
version: '1.1'
var: # A suffix variable
- val1
- val2
"dyn{{ identifier }}":
description: A dynamic family
dynamic:

View 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

View file

@ -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
}
}

View file

@ -0,0 +1,8 @@
{
"rougail.var": [
"val1",
"val2"
],
"rougail.dynval1.var": null,
"rougail.dynval2.var": null
}

View file

@ -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
}
}

View file

@ -0,0 +1 @@
["rougail.dynval1.var", "rougail.dynval2.var"]

View 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])

View 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])

View file

@ -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])