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('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_rougail.ip_address'] = "{% if not _.ip_address | valid_in_network(_.network_address_eth0) %}\n{{ _.ip_address }} is not in network {{ _.network_address_eth0 }}\n{% endif %}\n"
option_2 = IPOption(name="network_address_eth0", doc="Network address", cidr=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'cidr'})
option_3 = IPOption(name="ip_address", doc="an IP", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.ip_address"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '_.ip_address': ParamSelfOption(whole=False), '_.network_address_eth0': ParamOption(option_2)}))], allow_reserved=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'ip'})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3], properties=frozenset({"basic"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
