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

22 lines
3.6 KiB
Python

from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
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")
dict_env['disabled_1.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_1.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"
dict_env['disabled_2.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_2.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_3 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"mandatory", "standard"}))
option_4 = 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_1.rougail.my_var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'my_var1': ParamOption(option_3, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}))
option_5 = 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_1.rougail.my_var3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'my_var2': ParamOption(option_4, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}))
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3, option_4, option_5], properties=frozenset({"standard"}))
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
option_8 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"mandatory", "standard"}))
option_9 = 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_2.rougail.my_var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'my_var1': ParamOption(option_8, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}))
option_10 = 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_2.rougail.my_var3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 'my_var2': ParamOption(option_9, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}))
optiondescription_7 = OptionDescription(name="rougail", doc="rougail", children=[option_8, option_9, option_10], properties=frozenset({"standard"}))
optiondescription_6 = OptionDescription(name="2", doc="2", children=[optiondescription_7], properties=frozenset({"standard"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_6])