fix: if no description, generate negative_description too
This commit is contained in:
parent
7b9d7ce419
commit
df2fcb467f
56 changed files with 923 additions and 13 deletions
|
@ -1,7 +1,7 @@
|
|||
"""Annotate to add specify attribute for tiramisu-cmdline
|
||||
|
||||
Silique (https://www.silique.fr)
|
||||
Copyright (C) 2024
|
||||
Copyright (C) 2024-2025
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by the
|
||||
|
@ -91,6 +91,9 @@ class Annotator(Walk):
|
|||
def manage_negative_description(self, variable) -> None:
|
||||
if not variable.negative_description:
|
||||
if variable.type == "boolean" and not self.objectspace.add_extra_options:
|
||||
if variable.name == variable.description:
|
||||
variable.negative_description = variable.name
|
||||
else:
|
||||
raise DictConsistencyError(
|
||||
_(
|
||||
'negative_description is mandatory for boolean variable, but "{0}" hasn\'t'
|
||||
|
@ -98,8 +101,7 @@ class Annotator(Walk):
|
|||
200,
|
||||
variable.xmlfiles,
|
||||
)
|
||||
return
|
||||
if variable.type != "boolean":
|
||||
elif variable.type != "boolean":
|
||||
raise DictConsistencyError(
|
||||
_(
|
||||
'negative_description is only available for boolean variable, but "{0}" is "{1}"'
|
||||
|
@ -107,6 +109,7 @@ class Annotator(Walk):
|
|||
201,
|
||||
variable.xmlfiles,
|
||||
)
|
||||
if variable.negative_description:
|
||||
self.objectspace.informations.add(
|
||||
variable.path, "negative_description", variable.negative_description
|
||||
)
|
||||
|
|
8
tests/default_option_params/structure/00-test.yml
Normal file
8
tests/default_option_params/structure/00-test.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
version: 1.1
|
||||
|
||||
file:
|
||||
type: unix_filename
|
||||
params:
|
||||
allow_relative: true
|
||||
default:
|
||||
test/unknown_file
|
10
tests/dictionaries/00_6secret/makedict/after.json
Normal file
10
tests/dictionaries/00_6secret/makedict/after.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"rougail.secret1": {
|
||||
"owner": "default",
|
||||
"value": null
|
||||
},
|
||||
"rougail.secret2": {
|
||||
"owner": "default",
|
||||
"value": "value"
|
||||
}
|
||||
}
|
4
tests/dictionaries/00_6secret/makedict/base.json
Normal file
4
tests/dictionaries/00_6secret/makedict/base.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"rougail.secret1": null,
|
||||
"rougail.secret2": "value"
|
||||
}
|
10
tests/dictionaries/00_6secret/makedict/before.json
Normal file
10
tests/dictionaries/00_6secret/makedict/before.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"rougail.secret1": {
|
||||
"owner": "default",
|
||||
"value": null
|
||||
},
|
||||
"rougail.secret2": {
|
||||
"owner": "default",
|
||||
"value": "value"
|
||||
}
|
||||
}
|
1
tests/dictionaries/00_6secret/makedict/mandatory.json
Normal file
1
tests/dictionaries/00_6secret/makedict/mandatory.json
Normal file
|
@ -0,0 +1 @@
|
|||
["rougail.secret1"]
|
16
tests/dictionaries/00_6secret/tiramisu/base.py
Normal file
16
tests/dictionaries/00_6secret/tiramisu/base.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
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('../rougail-tests/funcs/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 = PasswordOption(name="secret1", doc="the first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'secret'})
|
||||
option_3 = PasswordOption(name="secret2", doc="the second variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'secret'})
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3], properties=frozenset({"basic"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
11
tests/dictionaries/00_6secret/tiramisu/no_namespace.py
Normal file
11
tests/dictionaries/00_6secret/tiramisu/no_namespace.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
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('../rougail-tests/funcs/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_1 = PasswordOption(name="secret1", doc="the first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'secret'})
|
||||
option_2 = PasswordOption(name="secret2", doc="the second variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'secret'})
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"rougail.condition": {
|
||||
"owner": "default",
|
||||
"value": "no"
|
||||
},
|
||||
"rougail.variable1": {
|
||||
"owner": "default",
|
||||
"value": []
|
||||
},
|
||||
"rougail.variable2": {
|
||||
"owner": "default",
|
||||
"value": []
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"rougail.condition": "no",
|
||||
"rougail.variable1": [],
|
||||
"rougail.variable2": []
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"rougail.condition": {
|
||||
"owner": "default",
|
||||
"value": "no"
|
||||
},
|
||||
"rougail.variable1": {
|
||||
"owner": "default",
|
||||
"value": []
|
||||
},
|
||||
"rougail.variable2": {
|
||||
"owner": "default",
|
||||
"value": []
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
["rougail.variable1", "rougail.variable2"]
|
|
@ -0,0 +1,19 @@
|
|||
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('../rougail-tests/funcs/test.py')
|
||||
try:
|
||||
groups.namespace
|
||||
except:
|
||||
groups.addgroup('namespace')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
dict_env['disabled_rougail.variable1'] = "{% if _.condition == \"yes\" %}\ncondition is yes\n{% endif %}\n"
|
||||
dict_env['disabled_rougail.variable2'] = "{% if _.condition == \"yes\" %}\ncondition is yes\n{% endif %}\n"
|
||||
option_2 = StrOption(name="condition", doc="a conditional variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_3 = StrOption(name="variable1", doc="a first variable", multi=True, properties=frozenset({"basic", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("disabled")), kwargs={'__internal_jinja': ParamValue("disabled_rougail.variable1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5disabled_calculation_multi/rougail/00-base.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("rougail.variable1"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.condition': ParamOption(option_2, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'type': 'string'})
|
||||
option_4 = StrOption(name="variable2", doc="a second variable", multi=True, properties=frozenset({"basic", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("disabled")), kwargs={'__internal_jinja': ParamValue("disabled_rougail.variable2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5disabled_calculation_multi/rougail/00-base.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("rougail.variable2"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.condition': ParamOption(option_2, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'type': 'string'})
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3, option_4], properties=frozenset({"basic"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"rougail.condition": {
|
||||
"owner": "default",
|
||||
"value": false
|
||||
},
|
||||
"rougail.variable": {
|
||||
"owner": "default",
|
||||
"value": []
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"rougail.condition": false,
|
||||
"rougail.variable": []
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"rougail.condition": {
|
||||
"owner": "default",
|
||||
"value": false
|
||||
},
|
||||
"rougail.variable": {
|
||||
"owner": "default",
|
||||
"value": []
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
["rougail.variable"]
|
|
@ -0,0 +1,16 @@
|
|||
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('../rougail-tests/funcs/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 = BoolOption(name="condition", doc="a condition", default=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||
option_3 = StrOption(name="variable", doc="a variable", multi=True, properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((ParamValue("disabled"), ParamOption(option_2)), kwargs={'__internal_multi': ParamValue(True), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'type': 'string'})
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3], properties=frozenset({"basic"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
@ -0,0 +1,11 @@
|
|||
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('../rougail-tests/funcs/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_1 = BoolOption(name="condition", doc="a condition", default=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||
option_2 = StrOption(name="variable", doc="a variable", multi=True, properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((ParamValue("disabled"), ParamOption(option_1)), kwargs={'__internal_multi': ParamValue(True), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'type': 'string'})
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"rougail.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower1": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val11",
|
||||
"val11"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower2": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val21",
|
||||
"val21"
|
||||
]
|
||||
},
|
||||
"rougail.calculate": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"val11"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"rougail.leader.leader": [
|
||||
{
|
||||
"rougail.leader.leader": "value1",
|
||||
"rougail.leader.follower1": "val11",
|
||||
"rougail.leader.follower2": "val21"
|
||||
},
|
||||
{
|
||||
"rougail.leader.leader": "value2",
|
||||
"rougail.leader.follower1": "val11",
|
||||
"rougail.leader.follower2": "val21"
|
||||
}
|
||||
],
|
||||
"rougail.calculate": [
|
||||
"val11"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"rougail.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower1": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val11",
|
||||
"val11"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower2": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val21",
|
||||
"val21"
|
||||
]
|
||||
},
|
||||
"rougail.calculate": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"val11"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
|
@ -0,0 +1,20 @@
|
|||
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('../rougail-tests/funcs/test.py')
|
||||
try:
|
||||
groups.namespace
|
||||
except:
|
||||
groups.addgroup('namespace')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
dict_env['default_rougail.calculate'] = "{{ _.leader.follower1[0] }}"
|
||||
option_3 = StrOption(name="leader", doc="a leader", multi=True, default=["value1", "value2"], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_4 = StrOption(name="follower1", doc="a follower", multi=True, default_multi="val11", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_5 = StrOption(name="follower2", doc="an other follower", multi=True, default_multi="val21", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_2 = Leadership(name="leader", doc="a leadership", children=[option_3, option_4, option_5], properties=frozenset({"standard"}))
|
||||
option_6 = StrOption(name="calculate", doc="a calculated variable", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_rougail.calculate"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['../rougail-tests/structures/40_9leadership-calculation-outside-follower-first/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("rougail.calculate"), '_.leader.follower1': ParamOption(option_4, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "notunique", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[optiondescription_2, option_6], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
@ -0,0 +1,15 @@
|
|||
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('../rougail-tests/funcs/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
dict_env['default_calculate'] = "{{ _.leader.follower1[0] }}"
|
||||
option_2 = StrOption(name="leader", doc="a leader", multi=True, default=["value1", "value2"], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_3 = StrOption(name="follower1", doc="a follower", multi=True, default_multi="val11", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_4 = StrOption(name="follower2", doc="an other follower", multi=True, default_multi="val21", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_1 = Leadership(name="leader", doc="a leadership", children=[option_2, option_3, option_4], properties=frozenset({"standard"}))
|
||||
option_5 = StrOption(name="calculate", doc="a calculated variable", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_calculate"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['../rougail-tests/structures/40_9leadership-calculation-outside-follower-first/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("calculate"), '_.leader.follower1': ParamOption(option_3, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "notunique", "standard"}), informations={'type': 'string'})
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, option_5])
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"rougail.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower1": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val11",
|
||||
"val11"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower2": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val21",
|
||||
"val21"
|
||||
]
|
||||
},
|
||||
"rougail.calculate": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"val11"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"rougail.leader.leader": [
|
||||
{
|
||||
"rougail.leader.leader": "value1",
|
||||
"rougail.leader.follower1": "val11",
|
||||
"rougail.leader.follower2": "val21"
|
||||
},
|
||||
{
|
||||
"rougail.leader.leader": "value2",
|
||||
"rougail.leader.follower1": "val11",
|
||||
"rougail.leader.follower2": "val21"
|
||||
}
|
||||
],
|
||||
"rougail.calculate": [
|
||||
"val11"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"rougail.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower1": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val11",
|
||||
"val11"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower2": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val21",
|
||||
"val21"
|
||||
]
|
||||
},
|
||||
"rougail.calculate": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"val11"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
|
@ -0,0 +1,20 @@
|
|||
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('../rougail-tests/funcs/test.py')
|
||||
try:
|
||||
groups.namespace
|
||||
except:
|
||||
groups.addgroup('namespace')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
dict_env['default_rougail.calculate'] = "{{ _.leader.follower1[-1] }}"
|
||||
option_3 = StrOption(name="leader", doc="a leader", multi=True, default=["value1", "value2"], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_4 = StrOption(name="follower1", doc="a follower", multi=True, default_multi="val11", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_5 = StrOption(name="follower2", doc="an other follower", multi=True, default_multi="val21", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_2 = Leadership(name="leader", doc="a leadership", children=[option_3, option_4, option_5], properties=frozenset({"standard"}))
|
||||
option_6 = StrOption(name="calculate", doc="a calculated variable", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_rougail.calculate"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['../rougail-tests/structures/40_9leadership-calculation-outside-follower-last/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("rougail.calculate"), '_.leader.follower1': ParamOption(option_4, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "notunique", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[optiondescription_2, option_6], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
@ -0,0 +1,15 @@
|
|||
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('../rougail-tests/funcs/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
dict_env['default_calculate'] = "{{ _.leader.follower1[-1] }}"
|
||||
option_2 = StrOption(name="leader", doc="a leader", multi=True, default=["value1", "value2"], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_3 = StrOption(name="follower1", doc="a follower", multi=True, default_multi="val11", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_4 = StrOption(name="follower2", doc="an other follower", multi=True, default_multi="val21", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_1 = Leadership(name="leader", doc="a leadership", children=[option_2, option_3, option_4], properties=frozenset({"standard"}))
|
||||
option_5 = StrOption(name="calculate", doc="a calculated variable", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_calculate"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['../rougail-tests/structures/40_9leadership-calculation-outside-follower-last/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("calculate"), '_.leader.follower1': ParamOption(option_3, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "notunique", "standard"}), informations={'type': 'string'})
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, option_5])
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"rougail.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower1": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val11",
|
||||
"val11"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower2": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val21",
|
||||
"val21"
|
||||
]
|
||||
},
|
||||
"rougail.calculate": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"val11",
|
||||
"val11"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"rougail.leader.leader": [
|
||||
{
|
||||
"rougail.leader.leader": "value1",
|
||||
"rougail.leader.follower1": "val11",
|
||||
"rougail.leader.follower2": "val21"
|
||||
},
|
||||
{
|
||||
"rougail.leader.leader": "value2",
|
||||
"rougail.leader.follower1": "val11",
|
||||
"rougail.leader.follower2": "val21"
|
||||
}
|
||||
],
|
||||
"rougail.calculate": [
|
||||
"val11",
|
||||
"val11"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"rougail.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower1": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val11",
|
||||
"val11"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower2": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val21",
|
||||
"val21"
|
||||
]
|
||||
},
|
||||
"rougail.calculate": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"val11",
|
||||
"val11"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
|
@ -0,0 +1,19 @@
|
|||
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('../rougail-tests/funcs/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="leader", doc="a leader", multi=True, default=["value1", "value2"], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_4 = StrOption(name="follower1", doc="a follower", multi=True, default_multi="val11", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_5 = StrOption(name="follower2", doc="an other follower", multi=True, default_multi="val21", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_2 = Leadership(name="leader", doc="a leadership", children=[option_3, option_4, option_5], properties=frozenset({"standard"}))
|
||||
option_6 = StrOption(name="calculate", doc="a calculated variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_4)), kwargs={'__internal_multi': ParamValue(True)})), properties=frozenset({"mandatory", "notunique", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[optiondescription_2, option_6], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
@ -0,0 +1,14 @@
|
|||
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('../rougail-tests/funcs/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_2 = StrOption(name="leader", doc="a leader", multi=True, default=["value1", "value2"], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_3 = StrOption(name="follower1", doc="a follower", multi=True, default_multi="val11", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_4 = StrOption(name="follower2", doc="an other follower", multi=True, default_multi="val21", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_1 = Leadership(name="leader", doc="a leadership", children=[option_2, option_3, option_4], properties=frozenset({"standard"}))
|
||||
option_5 = StrOption(name="calculate", doc="a calculated variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_3)), kwargs={'__internal_multi': ParamValue(True)})), properties=frozenset({"mandatory", "notunique", "standard"}), informations={'type': 'string'})
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, option_5])
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"rougail.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower1": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val11",
|
||||
"val11"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower2": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val21",
|
||||
"val21"
|
||||
]
|
||||
},
|
||||
"rougail.calculate": {
|
||||
"owner": "default",
|
||||
"value": "value1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"rougail.leader.leader": [
|
||||
{
|
||||
"rougail.leader.leader": "value1",
|
||||
"rougail.leader.follower1": "val11",
|
||||
"rougail.leader.follower2": "val21"
|
||||
},
|
||||
{
|
||||
"rougail.leader.leader": "value2",
|
||||
"rougail.leader.follower1": "val11",
|
||||
"rougail.leader.follower2": "val21"
|
||||
}
|
||||
],
|
||||
"rougail.calculate": "value1"
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"rougail.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower1": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val11",
|
||||
"val11"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower2": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val21",
|
||||
"val21"
|
||||
]
|
||||
},
|
||||
"rougail.calculate": {
|
||||
"owner": "default",
|
||||
"value": "value1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
|
@ -0,0 +1,20 @@
|
|||
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('../rougail-tests/funcs/test.py')
|
||||
try:
|
||||
groups.namespace
|
||||
except:
|
||||
groups.addgroup('namespace')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
dict_env['default_rougail.calculate'] = "{{ _.leader.leader[0] }}"
|
||||
option_3 = StrOption(name="leader", doc="a leader", multi=True, default=["value1", "value2"], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_4 = StrOption(name="follower1", doc="a follower", multi=True, default_multi="val11", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_5 = StrOption(name="follower2", doc="an other follower", multi=True, default_multi="val21", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_2 = Leadership(name="leader", doc="a leadership", children=[option_3, option_4, option_5], properties=frozenset({"standard"}))
|
||||
option_6 = StrOption(name="calculate", doc="a calculated variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_rougail.calculate"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/40_9leadership-calculation-outside-leader-first/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("rougail.calculate"), '_.leader.leader': ParamOption(option_3, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[optiondescription_2, option_6], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
@ -0,0 +1,15 @@
|
|||
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('../rougail-tests/funcs/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
dict_env['default_calculate'] = "{{ _.leader.leader[0] }}"
|
||||
option_2 = StrOption(name="leader", doc="a leader", multi=True, default=["value1", "value2"], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_3 = StrOption(name="follower1", doc="a follower", multi=True, default_multi="val11", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_4 = StrOption(name="follower2", doc="an other follower", multi=True, default_multi="val21", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_1 = Leadership(name="leader", doc="a leadership", children=[option_2, option_3, option_4], properties=frozenset({"standard"}))
|
||||
option_5 = StrOption(name="calculate", doc="a calculated variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_calculate"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/40_9leadership-calculation-outside-leader-first/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("calculate"), '_.leader.leader': ParamOption(option_2, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, option_5])
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"rougail.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower1": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val11",
|
||||
"val11"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower2": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val21",
|
||||
"val21"
|
||||
]
|
||||
},
|
||||
"rougail.calculate": {
|
||||
"owner": "default",
|
||||
"value": "value2"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"rougail.leader.leader": [
|
||||
{
|
||||
"rougail.leader.leader": "value1",
|
||||
"rougail.leader.follower1": "val11",
|
||||
"rougail.leader.follower2": "val21"
|
||||
},
|
||||
{
|
||||
"rougail.leader.leader": "value2",
|
||||
"rougail.leader.follower1": "val11",
|
||||
"rougail.leader.follower2": "val21"
|
||||
}
|
||||
],
|
||||
"rougail.calculate": "value2"
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"rougail.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower1": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val11",
|
||||
"val11"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower2": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val21",
|
||||
"val21"
|
||||
]
|
||||
},
|
||||
"rougail.calculate": {
|
||||
"owner": "default",
|
||||
"value": "value2"
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
|
@ -0,0 +1,20 @@
|
|||
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('../rougail-tests/funcs/test.py')
|
||||
try:
|
||||
groups.namespace
|
||||
except:
|
||||
groups.addgroup('namespace')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
dict_env['default_rougail.calculate'] = "{{ _.leader.leader[-1] }}"
|
||||
option_3 = StrOption(name="leader", doc="a leader", multi=True, default=["value1", "value2"], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_4 = StrOption(name="follower1", doc="a follower", multi=True, default_multi="val11", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_5 = StrOption(name="follower2", doc="an other follower", multi=True, default_multi="val21", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_2 = Leadership(name="leader", doc="a leadership", children=[option_3, option_4, option_5], properties=frozenset({"standard"}))
|
||||
option_6 = StrOption(name="calculate", doc="a calculated variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_rougail.calculate"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/40_9leadership-calculation-outside-leader-last/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("rougail.calculate"), '_.leader.leader': ParamOption(option_3, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[optiondescription_2, option_6], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
@ -0,0 +1,15 @@
|
|||
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('../rougail-tests/funcs/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
dict_env['default_calculate'] = "{{ _.leader.leader[-1] }}"
|
||||
option_2 = StrOption(name="leader", doc="a leader", multi=True, default=["value1", "value2"], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_3 = StrOption(name="follower1", doc="a follower", multi=True, default_multi="val11", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_4 = StrOption(name="follower2", doc="an other follower", multi=True, default_multi="val21", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_1 = Leadership(name="leader", doc="a leadership", children=[option_2, option_3, option_4], properties=frozenset({"standard"}))
|
||||
option_5 = StrOption(name="calculate", doc="a calculated variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_calculate"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/40_9leadership-calculation-outside-leader-last/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("calculate"), '_.leader.leader': ParamOption(option_2, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, option_5])
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"rougail.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower1": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val11",
|
||||
"val11"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower2": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val21",
|
||||
"val21"
|
||||
]
|
||||
},
|
||||
"rougail.calculate": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"rougail.leader.leader": [
|
||||
{
|
||||
"rougail.leader.leader": "value1",
|
||||
"rougail.leader.follower1": "val11",
|
||||
"rougail.leader.follower2": "val21"
|
||||
},
|
||||
{
|
||||
"rougail.leader.leader": "value2",
|
||||
"rougail.leader.follower1": "val11",
|
||||
"rougail.leader.follower2": "val21"
|
||||
}
|
||||
],
|
||||
"rougail.calculate": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"rougail.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower1": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val11",
|
||||
"val11"
|
||||
]
|
||||
},
|
||||
"rougail.leader.follower2": {
|
||||
"owner": [
|
||||
"default",
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
"val21",
|
||||
"val21"
|
||||
]
|
||||
},
|
||||
"rougail.calculate": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
|
@ -0,0 +1,19 @@
|
|||
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('../rougail-tests/funcs/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="leader", doc="a leader", multi=True, default=["value1", "value2"], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_4 = StrOption(name="follower1", doc="a follower", multi=True, default_multi="val11", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_5 = StrOption(name="follower2", doc="an other follower", multi=True, default_multi="val21", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_2 = Leadership(name="leader", doc="a leadership", children=[option_3, option_4, option_5], properties=frozenset({"standard"}))
|
||||
option_6 = StrOption(name="calculate", doc="a calculated variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_3)), kwargs={'__internal_multi': ParamValue(True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[optiondescription_2, option_6], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
@ -0,0 +1,14 @@
|
|||
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('../rougail-tests/funcs/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_2 = StrOption(name="leader", doc="a leader", multi=True, default=["value1", "value2"], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_3 = StrOption(name="follower1", doc="a follower", multi=True, default_multi="val11", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_4 = StrOption(name="follower2", doc="an other follower", multi=True, default_multi="val21", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
optiondescription_1 = Leadership(name="leader", doc="a leadership", children=[option_2, option_3, option_4], properties=frozenset({"standard"}))
|
||||
option_5 = StrOption(name="calculate", doc="a calculated variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_2)), kwargs={'__internal_multi': ParamValue(True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, option_5])
|
|
@ -56,3 +56,17 @@ def test_personalize_annotate_twice():
|
|||
with raises(DictConsistencyError) as err:
|
||||
eolobj.converted.annotate()
|
||||
assert err.value.errno == 85
|
||||
|
||||
|
||||
def test_option_params():
|
||||
RougailConfig['dictionaries_dir'] = ['tests/default_option_params/structure']
|
||||
RougailConfig["default_params.unix_filename.test_existence"] = True
|
||||
eolobj = Rougail()
|
||||
with raises(ValueError):
|
||||
eolobj.get_config()
|
||||
eolobj = Rougail()
|
||||
with raises(ValueError):
|
||||
eolobj.get_config()
|
||||
RougailConfig["default_params.unix_filename.test_existence"] = False
|
||||
eolobj = Rougail()
|
||||
eolobj.get_config()
|
||||
|
|
Loading…
Reference in a new issue