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['validators_var1'] = "{% if var | length != 3 %}3 values needed, but there are {{ var | length }}{% endif %}"
dict_env['validators_var2'] = "{% if var | length < 1 %}a minimum of 1 values are needed, but there are {{ var | length }}{% endif %}"
dict_env['validators_var2_0'] = "{% if var | length > 4 %}a maximum of 4 values are needed, but there are {{ var | length }}{% endif %}"
option_1 = StrOption(name="var1", doc="the variable", multi=True, default=["val1", "val2", "val3"], default_multi="val1", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var1"), 'var': ParamSelfOption(whole=True), 'description': ParamValue(None)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml'], 'type': 'string'})
option_2 = StrOption(name="var2", doc="the variable", multi=True, default=["val4", "val5"], default_multi="val4", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var2"), 'var': ParamSelfOption(whole=True), 'description': ParamValue(None)})), Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var2_0"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var2"), 'var': ParamSelfOption(whole=True), 'description': ParamValue(None)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml'], 'type': 'string'})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])
