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_rougail.general.int'] = "{% if _.int == int2 %}\nint and int2 must be different\n{% endif %}\n"
dict_env['validators_rougail.general.int_0'] = "{% if int3 is defined and _.int == int3 %}\nint and int3 must be different\n{% endif %}\n"
option_4 = IntOption(name="int2", doc="a second integer", default=1, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml'], 'type': 'integer'})
option_3 = IntOption(name="int", doc="a first integer", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.general.int"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.general.int"), 'int2': ParamOption(option_4), 'description': ParamValue(None), '_.int': ParamSelfOption(whole=False)})), Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.general.int_0"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.general.int"), 'description': ParamValue(None), '_.int': ParamSelfOption(whole=False)}))], properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml'], 'type': 'integer', 'test': (5,)})
optiondescription_2 = OptionDescription(name="general", doc="a family", children=[option_3, option_4], properties=frozenset({"basic"}), informations={'ymlfiles': ['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml']})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[optiondescription_2], properties=frozenset({"basic"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
