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['default_1.rougail.dyn_{{ suffix }}.varname'] = "{% for val in rougail.varname %}\nt{{ val }}\n{% endfor %}\n" dict_env['default_1.rougail.dyn_{{ suffix }}.dyn_{{ suffix }}.q_vardyn'] = "{{ s1 }}-{{ s2 }}\n" dict_env['default_2.rougail.dyn_{{ suffix }}.varname'] = "{% for val in rougail.varname %}\nt{{ val }}\n{% endfor %}\n" dict_env['default_2.rougail.dyn_{{ suffix }}.dyn_{{ suffix }}.q_vardyn'] = "{{ s1 }}-{{ s2 }}\n" option_3 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) option_5 = StrOption(name="varname", doc="varname", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.dyn_{{ suffix }}.varname"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(True), 'rougail.varname': ParamOption(option_3)})), properties=frozenset({"mandatory", "notempty", "standard"})) option_7 = StrOption(name="vardyn", doc="vardyn", default=Calculation(func['calc_value'], Params((ParamSuffix()))), properties=frozenset({"mandatory", "standard"})) option_8 = StrOption(name="p_vardyn", doc="p_vardyn", default=Calculation(func['calc_value'], Params((ParamSuffix(suffix_index=0)))), properties=frozenset({"mandatory", "standard"})) option_9 = StrOption(name="q_vardyn", doc="q_vardyn", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.dyn_{{ suffix }}.dyn_{{ suffix }}.q_vardyn"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 's1': ParamSuffix(suffix_index=0), 's2': ParamSuffix(suffix_index=1)})), properties=frozenset({"mandatory", "standard"})) optiondescription_6 = ConvertDynOptionDescription(name="dyn_{{ suffix }}", doc="dyn_{{ suffix }}", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_5, notraisepropertyerror=True)), kwargs={'allow_none': ParamValue(True)})), children=[option_7, option_8, option_9], properties=frozenset({"standard"})) optiondescription_4 = ConvertDynOptionDescription(name="dyn_{{ suffix }}", doc="dyn_{{ suffix }}", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_3, notraisepropertyerror=True)), kwargs={'allow_none': ParamValue(True)})), children=[option_5, optiondescription_6], properties=frozenset({"standard"})) optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3, optiondescription_4], properties=frozenset({"standard"})) optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"})) option_12 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"})) option_14 = StrOption(name="varname", doc="varname", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.dyn_{{ suffix }}.varname"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(True), 'rougail.varname': ParamOption(option_12)})), properties=frozenset({"mandatory", "notempty", "standard"})) option_16 = StrOption(name="vardyn", doc="vardyn", default=Calculation(func['calc_value'], Params((ParamSuffix()))), properties=frozenset({"mandatory", "standard"})) option_17 = StrOption(name="p_vardyn", doc="p_vardyn", default=Calculation(func['calc_value'], Params((ParamSuffix(suffix_index=0)))), properties=frozenset({"mandatory", "standard"})) option_18 = StrOption(name="q_vardyn", doc="q_vardyn", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.dyn_{{ suffix }}.dyn_{{ suffix }}.q_vardyn"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), 's1': ParamSuffix(suffix_index=0), 's2': ParamSuffix(suffix_index=1)})), properties=frozenset({"mandatory", "standard"})) optiondescription_15 = ConvertDynOptionDescription(name="dyn_{{ suffix }}", doc="dyn_{{ suffix }}", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_14, notraisepropertyerror=True)), kwargs={'allow_none': ParamValue(True)})), children=[option_16, option_17, option_18], properties=frozenset({"standard"})) optiondescription_13 = ConvertDynOptionDescription(name="dyn_{{ suffix }}", doc="dyn_{{ suffix }}", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_12, notraisepropertyerror=True)), kwargs={'allow_none': ParamValue(True)})), children=[option_14, optiondescription_15], properties=frozenset({"standard"})) optiondescription_11 = OptionDescription(name="rougail", doc="rougail", children=[option_12, optiondescription_13], properties=frozenset({"standard"})) optiondescription_10 = OptionDescription(name="2", doc="2", children=[optiondescription_11], properties=frozenset({"standard"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_10])