rougail/tests/dictionaries/10load_disabled_if_in_twice/tiramisu/base.py

15 lines
1.9 KiB
Python
Raw Normal View History

2023-10-12 08:17:30 +02:00
from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
2024-06-19 17:36:18 +02:00
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py')
2023-10-12 08:17:30 +02:00
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['disabled_rougail.my_var2'] = "{% if my_var1 is not defined %}\nmy_var1 is undefined!\n{% elif my_var1 == \"no\" %}\nmy_var1 is no\n{% endif %}\n"
dict_env['disabled_rougail.my_var3'] = "{% if my_var2 is not defined %}\nmy_var2 is undefined!\n{% elif my_var2 == \"no\" %}\nmy_var2 is no\n{% endif %}\n"
option_2 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"mandatory", "standard"}))
option_3 = StrOption(name="my_var2", doc="my_var2", default="no", properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled")), kwargs={'__internal_jinja': ParamValue("disabled_rougail.my_var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'my_var1': ParamOption(option_2, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}))
option_4 = StrOption(name="my_var3", doc="my_var3", default="no", properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled")), kwargs={'__internal_jinja': ParamValue("disabled_rougail.my_var3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'my_var2': ParamOption(option_3, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}))
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3, option_4], properties=frozenset({"standard"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])