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_netmask_address_eth0'] = "{% if not _.netmask_address_eth0 | valid_in_network(_.network_address_eth0) %}\n{{ _.netmask_address_eth0 }} is not a netmask for network {{ _.network_address_eth0 }}\n{% endif %}\n"
option_1 = NetworkOption(name="network_address_eth0", doc="Network address", properties=frozenset({"basic", "mandatory"}), informations={'type': 'network'})
option_2 = NetmaskOption(name="netmask_address_eth0", doc="Netmask address", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_netmask_address_eth0"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '_': ParamValue({}), '_.netmask_address_eth0': ParamSelfOption(whole=False), '_.network_address_eth0': ParamOption(option_1)}))], properties=frozenset({"basic", "mandatory"}), informations={'type': 'netmask'})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])
