refactor(src/rougail/convert/): split the file
This commit is contained in:
parent
b0f250df86
commit
2f9f263ae0
91 changed files with 1674 additions and 1478 deletions
|
|
@ -26,6 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
from tiramisu.error import display_list
|
||||||
from rougail.i18n import _
|
from rougail.i18n import _
|
||||||
from rougail.error import DictConsistencyError
|
from rougail.error import DictConsistencyError
|
||||||
from rougail.annotator.variable import Walk
|
from rougail.annotator.variable import Walk
|
||||||
|
|
@ -58,67 +59,35 @@ class Annotator(Walk):
|
||||||
objectspace,
|
objectspace,
|
||||||
*args,
|
*args,
|
||||||
):
|
):
|
||||||
self.mode_auto = []
|
if not objectspace.paths:
|
||||||
self.objectspace = objectspace
|
|
||||||
if not self.objectspace.paths:
|
|
||||||
return
|
return
|
||||||
self.check_leadership()
|
self.objectspace = objectspace
|
||||||
|
self.mode_auto = []
|
||||||
self.remove_empty_families()
|
self.remove_empty_families()
|
||||||
self.family_description()
|
self.check_leadership()
|
||||||
if self.objectspace.modes_level:
|
self.families_description()
|
||||||
self.modes = {
|
self.set_modes()
|
||||||
name: Mode(idx) for idx, name in enumerate(self.objectspace.modes_level)
|
|
||||||
}
|
|
||||||
self.default_variable_mode = self.objectspace.default_variable_mode
|
|
||||||
self.default_family_mode = self.objectspace.default_family_mode
|
|
||||||
self.change_modes()
|
|
||||||
else:
|
|
||||||
for family in self.get_families():
|
|
||||||
self.valid_mode(family)
|
|
||||||
for variable in self.get_variables():
|
|
||||||
self.valid_mode(variable)
|
|
||||||
self.convert_help()
|
self.convert_help()
|
||||||
|
|
||||||
|
def remove_empty_families(self) -> None:
|
||||||
|
"""Remove all families without any variable"""
|
||||||
|
for family in reversed(list(self.get_families())):
|
||||||
|
path = family.path
|
||||||
|
if not self.objectspace.parents[path]:
|
||||||
|
self.objectspace.del_family(path)
|
||||||
|
|
||||||
def check_leadership(self) -> None:
|
def check_leadership(self) -> None:
|
||||||
"""No subfamily in a leadership"""
|
"""No subfamily in a leadership"""
|
||||||
for family in self.get_families():
|
for family in self.get_families():
|
||||||
if family.type != "leadership":
|
if family.type != "leadership":
|
||||||
continue
|
continue
|
||||||
for variable_path in self.objectspace.parents[family.path]:
|
for variable_path in self.objectspace.parents[family.path]:
|
||||||
variable = self.objectspace.paths[variable_path]
|
if variable_path in self.objectspace.families:
|
||||||
if variable.type in self.objectspace.family_types:
|
variable = self.objectspace.paths[variable_path]
|
||||||
msg = f'the leadership "{family.path}" cannot have the { variable.type } "{ variable.path}"'
|
msg = f'the leadership "{family.path}" cannot have the "{variable.type}" "{variable.path}"'
|
||||||
raise DictConsistencyError(msg, 24, variable.xmlfiles)
|
raise DictConsistencyError(msg, 24, variable.xmlfiles)
|
||||||
|
|
||||||
def remove_empty_families(self) -> None:
|
def families_description(self) -> None:
|
||||||
"""Remove all families without any variable"""
|
|
||||||
removed_families = []
|
|
||||||
for family in self.get_families():
|
|
||||||
if isinstance(family, self.objectspace.family) and not self._has_variable(
|
|
||||||
family.path
|
|
||||||
):
|
|
||||||
if (
|
|
||||||
self.objectspace.paths.default_namespace is None
|
|
||||||
or "." in family.path
|
|
||||||
):
|
|
||||||
removed_families.append(family.path)
|
|
||||||
removed_families.reverse()
|
|
||||||
for family in removed_families:
|
|
||||||
self.objectspace.del_family(family)
|
|
||||||
|
|
||||||
def _has_variable(
|
|
||||||
self,
|
|
||||||
family: str,
|
|
||||||
) -> bool:
|
|
||||||
for variable in self.objectspace.parents[family]:
|
|
||||||
if variable in self.objectspace.families:
|
|
||||||
if self._has_variable(variable):
|
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def family_description(self) -> None:
|
|
||||||
for family in self.get_families():
|
for family in self.get_families():
|
||||||
if not family.description:
|
if not family.description:
|
||||||
family.description = family.name
|
family.description = family.name
|
||||||
|
|
@ -144,28 +113,45 @@ class Annotator(Walk):
|
||||||
if family.xmlfiles:
|
if family.xmlfiles:
|
||||||
self.objectspace.informations.add(family.path, "ymlfiles", family.xmlfiles)
|
self.objectspace.informations.add(family.path, "ymlfiles", family.xmlfiles)
|
||||||
|
|
||||||
def change_modes(self):
|
def set_modes(self):
|
||||||
"""change the mode of variables"""
|
if self.objectspace.modes_level:
|
||||||
modes_level = self.objectspace.modes_level
|
self.configure_modes()
|
||||||
default_variable_mode = self.default_variable_mode
|
self.change_modes()
|
||||||
if default_variable_mode not in modes_level:
|
else:
|
||||||
|
self.modes = {}
|
||||||
|
for family in self.get_families():
|
||||||
|
self.valid_mode(family)
|
||||||
|
for variable in self.get_variables():
|
||||||
|
self.valid_mode(variable)
|
||||||
|
|
||||||
|
def configure_modes(self):
|
||||||
|
modes = self.modes = {
|
||||||
|
name: Mode(idx) for idx, name in enumerate(self.objectspace.modes_level)
|
||||||
|
}
|
||||||
|
default_variable_mode = self.default_variable_mode = self.objectspace.default_variable_mode
|
||||||
|
default_family_mode = self.default_family_mode = self.objectspace.default_family_mode
|
||||||
|
list_modes = list(modes)
|
||||||
|
if default_variable_mode not in list_modes:
|
||||||
msg = _(
|
msg = _(
|
||||||
'default variable mode "{0}" is not a valid mode, valid modes are {1}'
|
'default variable mode "{0}" is not a valid mode, valid modes are {1}'
|
||||||
).format(default_variable_mode, modes_level)
|
).format(default_variable_mode, display_list(list_modes, add_quote=True))
|
||||||
raise DictConsistencyError(msg, 72, None)
|
raise DictConsistencyError(msg, 72, None)
|
||||||
default_family_mode = self.default_family_mode
|
if default_family_mode not in list_modes:
|
||||||
if default_family_mode not in modes_level:
|
|
||||||
msg = _(
|
msg = _(
|
||||||
'default family mode "{0}" is not a valid mode, valid modes are {1}'
|
'default family mode "{0}" is not a valid mode, valid modes are {1}'
|
||||||
).format(default_family_mode, modes_level)
|
).format(default_family_mode, display_list(list_modes, add_quote=True))
|
||||||
raise DictConsistencyError(msg, 73, None)
|
raise DictConsistencyError(msg, 73, None)
|
||||||
|
self.lower_mode = list_modes[0]
|
||||||
|
self.higher_mode = list_modes[-1]
|
||||||
|
|
||||||
|
def change_modes(self):
|
||||||
|
"""change the mode of variables and families"""
|
||||||
families = list(self.get_families())
|
families = list(self.get_families())
|
||||||
for family in families:
|
for family in families:
|
||||||
self.valid_mode(family)
|
self.valid_mode(family)
|
||||||
self._set_default_mode(family)
|
self.set_default_mode(family)
|
||||||
families.reverse()
|
for family in reversed(families):
|
||||||
for family in families:
|
self.change_family_mode(family)
|
||||||
self._change_family_mode(family)
|
|
||||||
if self.objectspace.paths.default_namespace is None:
|
if self.objectspace.paths.default_namespace is None:
|
||||||
for variable_path in self.objectspace.parents["."]:
|
for variable_path in self.objectspace.parents["."]:
|
||||||
variable = self.objectspace.paths[variable_path]
|
variable = self.objectspace.paths[variable_path]
|
||||||
|
|
@ -174,7 +160,8 @@ class Annotator(Walk):
|
||||||
or variable_path in self.objectspace.families
|
or variable_path in self.objectspace.families
|
||||||
):
|
):
|
||||||
continue
|
continue
|
||||||
self._set_default_mode_variable(
|
self.valid_mode(variable)
|
||||||
|
self.set_default_mode_variable(
|
||||||
variable,
|
variable,
|
||||||
self.default_variable_mode,
|
self.default_variable_mode,
|
||||||
check_level=False,
|
check_level=False,
|
||||||
|
|
@ -184,55 +171,55 @@ class Annotator(Walk):
|
||||||
self,
|
self,
|
||||||
obj,
|
obj,
|
||||||
) -> None:
|
) -> None:
|
||||||
modes_level = self.objectspace.modes_level
|
if not self.modes:
|
||||||
if self._has_mode(obj) and obj.mode not in modes_level:
|
if self.has_mode(obj):
|
||||||
if modes_level:
|
|
||||||
msg = _(
|
msg = _(
|
||||||
'mode "{0}" for "{1}" is not a valid mode, valid modes are {2}'
|
'mode "{0}" for "{1}" is not a valid mode, valid modes are {2}'
|
||||||
).format(obj.mode, obj.name, modes_level)
|
).format(obj.mode, obj.name, display_list(list(self.modes), add_quote=True))
|
||||||
else:
|
raise DictConsistencyError(msg, 71, obj.xmlfiles)
|
||||||
msg = _(
|
elif self.has_mode(obj) and obj.mode not in self.modes:
|
||||||
'mode "{0}" for "{1}" is not a valid mode, no modes are available'
|
msg = _(
|
||||||
).format(obj.mode, obj.name)
|
'mode "{0}" for "{1}" is not a valid mode, no modes are available'
|
||||||
|
).format(obj.mode, obj.name)
|
||||||
raise DictConsistencyError(msg, 71, obj.xmlfiles)
|
raise DictConsistencyError(msg, 71, obj.xmlfiles)
|
||||||
|
|
||||||
def _set_default_mode(
|
def set_default_mode(
|
||||||
self,
|
self,
|
||||||
family: "self.objectspace.family",
|
family: "self.objectspace.family",
|
||||||
) -> None:
|
) -> None:
|
||||||
children = self.objectspace.parents[family.path]
|
if self.has_mode(family):
|
||||||
if not children:
|
|
||||||
return
|
|
||||||
if self._has_mode(family):
|
|
||||||
family_mode = family.mode
|
family_mode = family.mode
|
||||||
else:
|
else:
|
||||||
family_mode = None
|
family_mode = None
|
||||||
leader = None
|
is_leadership = family.type == "leadership"
|
||||||
for variable_path in children:
|
if is_leadership:
|
||||||
variable = self.objectspace.paths[variable_path]
|
leader = None
|
||||||
if variable.type == "symlink":
|
for child_path in self.objectspace.parents[family.path]:
|
||||||
|
child = self.objectspace.paths[child_path]
|
||||||
|
if child.type == "symlink":
|
||||||
continue
|
continue
|
||||||
if leader is None and family.type == "leadership":
|
if is_leadership and leader is None:
|
||||||
leader = variable
|
leader = child
|
||||||
leader_mode = leader.mode
|
leader_mode = leader.mode
|
||||||
if variable_path in self.objectspace.families:
|
if child_path in self.objectspace.families:
|
||||||
# set default mode a subfamily
|
# set default mode a subfamily
|
||||||
if family_mode and not self._has_mode(variable):
|
if family_mode and not self.has_mode(child):
|
||||||
self._set_auto_mode(variable, family_mode)
|
self.set_auto_mode(child, family_mode)
|
||||||
else:
|
else:
|
||||||
# set default mode to a variable
|
# set default mode to a variable
|
||||||
self.valid_mode(variable)
|
self.valid_mode(child)
|
||||||
if leader:
|
if is_leadership and leader:
|
||||||
self._set_default_mode_leader(leader, variable)
|
self.set_default_mode_leader(leader, child)
|
||||||
self._set_default_mode_variable(variable, family_mode)
|
self.set_default_mode_variable(child, family_mode)
|
||||||
if leader and leader_mode is not None:
|
if is_leadership and leader_mode is not None:
|
||||||
# here because follower can change leader mode
|
# here because follower can change leadership mode
|
||||||
self._set_auto_mode(family, leader_mode)
|
self.set_auto_mode(family, leader_mode)
|
||||||
|
|
||||||
def _has_mode(self, obj) -> bool:
|
def has_mode(self, obj) -> bool:
|
||||||
|
# the mode is set in the structural file
|
||||||
return obj.mode and not obj.path in self.mode_auto
|
return obj.mode and not obj.path in self.mode_auto
|
||||||
|
|
||||||
def _set_default_mode_variable(
|
def set_default_mode_variable(
|
||||||
self,
|
self,
|
||||||
variable: "self.objectspace.variable",
|
variable: "self.objectspace.variable",
|
||||||
family_mode: Optional[str],
|
family_mode: Optional[str],
|
||||||
|
|
@ -240,16 +227,16 @@ class Annotator(Walk):
|
||||||
) -> None:
|
) -> None:
|
||||||
# auto_save variable is set to 'basic' mode
|
# auto_save variable is set to 'basic' mode
|
||||||
# if its mode is not defined by the user
|
# if its mode is not defined by the user
|
||||||
if not self._has_mode(variable) and variable.auto_save is True:
|
if not self.has_mode(variable) and variable.auto_save is True:
|
||||||
variable.mode = self.objectspace.modes_level[0]
|
variable.mode = self.lower_mode
|
||||||
# mandatory variable without value is a basic variable
|
# mandatory variable without value is a basic variable
|
||||||
elif (
|
elif (
|
||||||
not self._has_mode(variable)
|
not self.has_mode(variable)
|
||||||
and variable.mandatory is True
|
and variable.mandatory is True
|
||||||
and variable.default is None
|
and variable.default is None
|
||||||
and variable.path not in self.objectspace.default_multi
|
and variable.path not in self.objectspace.default_multi
|
||||||
):
|
):
|
||||||
variable_mode = self.objectspace.modes_level[0]
|
variable_mode = self.lower_mode
|
||||||
if (
|
if (
|
||||||
check_level
|
check_level
|
||||||
and family_mode
|
and family_mode
|
||||||
|
|
@ -261,18 +248,19 @@ class Annotator(Walk):
|
||||||
raise DictConsistencyError(msg, 36, variable.xmlfiles)
|
raise DictConsistencyError(msg, 36, variable.xmlfiles)
|
||||||
|
|
||||||
variable.mode = variable_mode
|
variable.mode = variable_mode
|
||||||
elif family_mode and not self._has_mode(variable):
|
elif family_mode and not self.has_mode(variable):
|
||||||
self._set_auto_mode(variable, family_mode)
|
self.set_auto_mode(variable, family_mode)
|
||||||
|
|
||||||
def _set_auto_mode(
|
def set_auto_mode(
|
||||||
self,
|
self,
|
||||||
obj,
|
obj,
|
||||||
mode: str,
|
mode: str,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
# This mode is set automaticly
|
||||||
obj.mode = mode
|
obj.mode = mode
|
||||||
self.mode_auto.append(obj.path)
|
self.mode_auto.append(obj.path)
|
||||||
|
|
||||||
def _set_default_mode_leader(
|
def set_default_mode_leader(
|
||||||
self,
|
self,
|
||||||
leader: "self.objectspace.variable",
|
leader: "self.objectspace.variable",
|
||||||
follower: "self.objectspace.variable",
|
follower: "self.objectspace.variable",
|
||||||
|
|
@ -280,26 +268,26 @@ class Annotator(Walk):
|
||||||
if leader == follower:
|
if leader == follower:
|
||||||
# it's a leader
|
# it's a leader
|
||||||
if not leader.mode:
|
if not leader.mode:
|
||||||
self._set_auto_mode(leader, self.default_variable_mode)
|
self.set_auto_mode(leader, self.default_variable_mode)
|
||||||
return
|
return
|
||||||
if self._has_mode(follower):
|
if self.has_mode(follower):
|
||||||
follower_mode = follower.mode
|
follower_mode = follower.mode
|
||||||
else:
|
else:
|
||||||
follower_mode = self.default_variable_mode
|
follower_mode = self.default_variable_mode
|
||||||
if self.modes[leader.mode] > self.modes[follower_mode]:
|
if self.modes[leader.mode] > self.modes[follower_mode]:
|
||||||
if self._has_mode(follower) and not self._has_mode(leader):
|
if self.has_mode(follower) and not self.has_mode(leader):
|
||||||
# if follower has mode but not the leader
|
# if follower has mode but not the leader
|
||||||
self._set_auto_mode(leader, follower_mode)
|
self.set_auto_mode(leader, follower_mode)
|
||||||
else:
|
else:
|
||||||
# leader's mode is minimum level
|
# leader's mode is minimum level
|
||||||
if self._has_mode(follower):
|
if self.has_mode(follower):
|
||||||
msg = _(
|
msg = _(
|
||||||
'the follower "{0}" is in "{1}" mode but leader have the higher mode "{2}"'
|
'the follower "{0}" is in "{1}" mode but leader have the higher mode "{2}"'
|
||||||
).format(follower.name, follower_mode, leader.mode)
|
).format(follower.name, follower_mode, leader.mode)
|
||||||
raise DictConsistencyError(msg, 63, follower.xmlfiles)
|
raise DictConsistencyError(msg, 63, follower.xmlfiles)
|
||||||
self._set_auto_mode(follower, leader.mode)
|
self.set_auto_mode(follower, leader.mode)
|
||||||
|
|
||||||
def _change_family_mode(
|
def change_family_mode(
|
||||||
self,
|
self,
|
||||||
family: "self.objectspace.family",
|
family: "self.objectspace.family",
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
@ -307,31 +295,29 @@ class Annotator(Walk):
|
||||||
family_mode = family.mode
|
family_mode = family.mode
|
||||||
else:
|
else:
|
||||||
family_mode = self.default_family_mode
|
family_mode = self.default_family_mode
|
||||||
min_variable_mode = self.objectspace.modes_level[-1]
|
min_variable_mode = self.higher_mode
|
||||||
# change variable mode, but not if variables are not in a family
|
|
||||||
is_leadership = family.type == "leadership"
|
is_leadership = family.type == "leadership"
|
||||||
if family.path in self.objectspace.parents:
|
for child_path in self.objectspace.parents[family.path]:
|
||||||
for variable_path in self.objectspace.parents[family.path]:
|
child = self.objectspace.paths[child_path]
|
||||||
variable = self.objectspace.paths[variable_path]
|
if child.type == "symlink":
|
||||||
if variable.type == "symlink":
|
continue
|
||||||
continue
|
if child_path in self.objectspace.families:
|
||||||
if variable_path in self.objectspace.families:
|
if not child.mode:
|
||||||
if not variable.mode:
|
child.mode = self.default_family_mode
|
||||||
variable.mode = self.default_family_mode
|
else:
|
||||||
else:
|
self.change_variable_mode(child, family_mode, is_leadership)
|
||||||
self._change_variable_mode(variable, family_mode, is_leadership)
|
if self.modes[min_variable_mode] > self.modes[child.mode]:
|
||||||
if self.modes[min_variable_mode] > self.modes[variable.mode]:
|
min_variable_mode = child.mode
|
||||||
min_variable_mode = variable.mode
|
|
||||||
if not family.mode:
|
if not family.mode:
|
||||||
# set the lower variable mode to family
|
# set the lower variable mode to family
|
||||||
self._set_auto_mode(family, min_variable_mode)
|
self.set_auto_mode(family, min_variable_mode)
|
||||||
if self.modes[family.mode] < self.modes[min_variable_mode]:
|
if self.modes[family.mode] < self.modes[min_variable_mode]:
|
||||||
msg = _(
|
msg = _(
|
||||||
'the family "{0}" is in "{1}" mode but variables and families inside have the higher modes "{2}"'
|
'the family "{0}" is in "{1}" mode but variables and families inside have the higher modes "{2}"'
|
||||||
).format(family.name, family.mode, min_variable_mode)
|
).format(family.name, family.mode, min_variable_mode)
|
||||||
raise DictConsistencyError(msg, 62, family.xmlfiles)
|
raise DictConsistencyError(msg, 62, family.xmlfiles)
|
||||||
|
|
||||||
def _change_variable_mode(
|
def change_variable_mode(
|
||||||
self,
|
self,
|
||||||
variable,
|
variable,
|
||||||
family_mode: str,
|
family_mode: str,
|
||||||
|
|
@ -343,12 +329,12 @@ class Annotator(Walk):
|
||||||
variable_mode = self.default_variable_mode
|
variable_mode = self.default_variable_mode
|
||||||
# none basic variable in high level family has to be in high level
|
# none basic variable in high level family has to be in high level
|
||||||
if not is_follower and self.modes[variable_mode] < self.modes[family_mode]:
|
if not is_follower and self.modes[variable_mode] < self.modes[family_mode]:
|
||||||
if self._has_mode(variable):
|
if self.has_mode(variable):
|
||||||
msg = _(
|
msg = _(
|
||||||
'the variable "{0}" is in "{1}" mode but family has the higher family mode "{2}"'
|
'the variable "{0}" is in "{1}" mode but family has the higher family mode "{2}"'
|
||||||
).format(variable.path, variable_mode, family_mode)
|
).format(variable.path, variable_mode, family_mode)
|
||||||
raise DictConsistencyError(msg, 61, variable.xmlfiles)
|
raise DictConsistencyError(msg, 61, variable.xmlfiles)
|
||||||
self._set_auto_mode(variable, family_mode)
|
self.set_auto_mode(variable, family_mode)
|
||||||
if not variable.mode:
|
if not variable.mode:
|
||||||
variable.mode = variable_mode
|
variable.mode = variable_mode
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||||
variable.default.get_variable(self.objectspace, variable.path)
|
variable.default.get_variable(self.objectspace, variable.path)
|
||||||
)
|
)
|
||||||
if calculated_variable is not None:
|
if calculated_variable is not None:
|
||||||
self._default_variable_copy_informations(
|
variable = self._default_variable_copy_informations(
|
||||||
variable, calculated_variable
|
variable, calculated_variable
|
||||||
)
|
)
|
||||||
self._convert_variable(variable)
|
self._convert_variable(variable)
|
||||||
|
|
@ -210,12 +210,12 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||||
# variable has no type
|
# variable has no type
|
||||||
if variable.type is not None:
|
if variable.type is not None:
|
||||||
return
|
return
|
||||||
# choice type inference from the `choices` attribute
|
## choice type inference from the `choices` attribute
|
||||||
if variable.choices is not None:
|
#if variable.choices is not None:
|
||||||
variable.type = "choice"
|
# variable.type = "choice"
|
||||||
elif variable.regexp is not None:
|
#elif variable.regexp is not None:
|
||||||
variable.type = "regexp"
|
# variable.type = "regexp"
|
||||||
elif variable.default not in [None, []]:
|
if variable.default not in [None, []]:
|
||||||
if isinstance(variable.default, list):
|
if isinstance(variable.default, list):
|
||||||
tested_value = variable.default[0]
|
tested_value = variable.default[0]
|
||||||
else:
|
else:
|
||||||
|
|
@ -274,7 +274,14 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||||
calculated_variable,
|
calculated_variable,
|
||||||
) -> None:
|
) -> None:
|
||||||
# copy type and params
|
# copy type and params
|
||||||
variable.type = calculated_variable.type
|
calculated_type = calculated_variable.__class__
|
||||||
|
if variable.__class__ == calculated_type:
|
||||||
|
variable.type = calculated_variable.type
|
||||||
|
else:
|
||||||
|
data = dict(variable)
|
||||||
|
data["type"] = calculated_variable.type
|
||||||
|
variable = calculated_type(**data)
|
||||||
|
self.objectspace.paths.replace(data["path"], variable)
|
||||||
if variable.params is None and calculated_variable.params is not None:
|
if variable.params is None and calculated_variable.params is not None:
|
||||||
variable.params = calculated_variable.params
|
variable.params = calculated_variable.params
|
||||||
if variable.type == "choice" and variable.choices is None:
|
if variable.type == "choice" and variable.choices is None:
|
||||||
|
|
@ -287,6 +294,7 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||||
)
|
)
|
||||||
if variable.type == "regexp" and variable.regexp is None:
|
if variable.type == "regexp" and variable.regexp is None:
|
||||||
variable.regexp = calculated_variable.regexp
|
variable.regexp = calculated_variable.regexp
|
||||||
|
return variable
|
||||||
|
|
||||||
def _convert_variable(
|
def _convert_variable(
|
||||||
self,
|
self,
|
||||||
|
|
@ -306,11 +314,11 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||||
self.objectspace.multis[variable.path] = "submulti"
|
self.objectspace.multis[variable.path] = "submulti"
|
||||||
elif variable.multi:
|
elif variable.multi:
|
||||||
self.objectspace.multis[variable.path] = True
|
self.objectspace.multis[variable.path] = True
|
||||||
if variable.regexp is not None and variable.type != "regexp":
|
# if variable.regexp is not None and variable.type != "regexp":
|
||||||
msg = _(
|
# msg = _(
|
||||||
'the variable "{0}" has regexp attribut but has not the "regexp" type'
|
# 'the variable "{0}" has regexp attribut but has not the "regexp" type'
|
||||||
).format(variable.path)
|
# ).format(variable.path)
|
||||||
raise DictConsistencyError(msg, 37, variable.xmlfiles)
|
# raise DictConsistencyError(msg, 37, variable.xmlfiles)
|
||||||
if variable.mandatory is None:
|
if variable.mandatory is None:
|
||||||
variable.mandatory = True
|
variable.mandatory = True
|
||||||
|
|
||||||
|
|
@ -346,14 +354,10 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||||
|
|
||||||
def verify_choices(self):
|
def verify_choices(self):
|
||||||
for variable in self.get_variables():
|
for variable in self.get_variables():
|
||||||
if variable.type is None and variable.choices:
|
# FIXME
|
||||||
# choice type inference from the `choices` attribute
|
# if variable.type is None and variable.choices:
|
||||||
variable.type = "choice"
|
# # choice type inference from the `choices` attribute
|
||||||
if variable.choices is not None and variable.type != "choice":
|
# variable.type = "choice"
|
||||||
msg = _(
|
|
||||||
'the variable "{0}" has choices attribut but has not the "choice" type'
|
|
||||||
).format(variable.path)
|
|
||||||
raise DictConsistencyError(msg, 11, variable.xmlfiles)
|
|
||||||
if variable.type != "choice":
|
if variable.type != "choice":
|
||||||
continue
|
continue
|
||||||
if variable.default is None:
|
if variable.default is None:
|
||||||
|
|
|
||||||
|
|
@ -435,7 +435,7 @@ secret_manager: # {_("The secret manager")}
|
||||||
"output": [],
|
"output": [],
|
||||||
}
|
}
|
||||||
processes_tr = {"structural": _("structural"),
|
processes_tr = {"structural": _("structural"),
|
||||||
"user data": _("user datas"),
|
"user data": _("user data"),
|
||||||
"output": _("output"),
|
"output": _("output"),
|
||||||
}
|
}
|
||||||
processes_empty = []
|
processes_empty = []
|
||||||
|
|
@ -469,10 +469,9 @@ secret_manager: # {_("The secret manager")}
|
||||||
for obj in objects:
|
for obj in objects:
|
||||||
rougail_process += f" - {obj['name']}\n"
|
rougail_process += f" - {obj['name']}\n"
|
||||||
if process == "structural":
|
if process == "structural":
|
||||||
rougail_process += """ commandline: false
|
rougail_process += """ multi: true
|
||||||
multi: true
|
|
||||||
default:
|
default:
|
||||||
- directory
|
- directory
|
||||||
"""
|
"""
|
||||||
elif process == "user data":
|
elif process == "user data":
|
||||||
rougail_process += """ multi: true
|
rougail_process += """ multi: true
|
||||||
|
|
@ -590,7 +589,7 @@ def _rougail_config(
|
||||||
options = obj["options"]
|
options = obj["options"]
|
||||||
for option in options:
|
for option in options:
|
||||||
convert.parse_root_file(
|
convert.parse_root_file(
|
||||||
[f'rougail.config.{obj["name"]}'],
|
[f'rougail.{obj["process"].replace(" ", "_")}_{obj["name"]}.config'],
|
||||||
"",
|
"",
|
||||||
"1.1",
|
"1.1",
|
||||||
YAML().load(option),
|
YAML().load(option),
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ class Rougail(UserData):
|
||||||
self.load_from_tiramisu_cache = load_from_tiramisu_cache and Path(self.rougailconfig["tiramisu_cache"]).is_file()
|
self.load_from_tiramisu_cache = load_from_tiramisu_cache and Path(self.rougailconfig["tiramisu_cache"]).is_file()
|
||||||
types = rougail_type(self.rougailconfig)
|
types = rougail_type(self.rougailconfig)
|
||||||
if not self.load_from_tiramisu_cache:
|
if not self.load_from_tiramisu_cache:
|
||||||
self.converted = RougailConvert(self.rougailconfig, *types)
|
self.converted = RougailConvert(self.rougailconfig, **types)
|
||||||
self.config = None
|
self.config = None
|
||||||
|
|
||||||
def get_root_option(self):
|
def get_root_option(self):
|
||||||
|
|
|
||||||
687
src/rougail/convert/collect.py
Normal file
687
src/rougail/convert/collect.py
Normal file
|
|
@ -0,0 +1,687 @@
|
||||||
|
"""Takes a bunch of Rougail YAML dispatched in differents folders
|
||||||
|
as an input and outputs a Tiramisu's file.
|
||||||
|
|
||||||
|
Silique (https://www.silique.fr)
|
||||||
|
Copyright (C) 2026
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||||
|
details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
"""
|
||||||
|
import logging
|
||||||
|
from warnings import warn
|
||||||
|
from pydantic import ValidationError
|
||||||
|
from copy import deepcopy
|
||||||
|
from typing import (
|
||||||
|
Any,
|
||||||
|
Iterator,
|
||||||
|
Literal,
|
||||||
|
Optional,
|
||||||
|
)
|
||||||
|
from tiramisu.error import display_list
|
||||||
|
from .object_model import (
|
||||||
|
CALCULATION_TYPES,
|
||||||
|
CALCULATION_PROPERTY_TYPES,
|
||||||
|
PROPERTY_ATTRIBUTE,
|
||||||
|
PARAM_TYPES,
|
||||||
|
AnyParam,
|
||||||
|
)
|
||||||
|
from ..i18n import _
|
||||||
|
from ..error import DictConsistencyError
|
||||||
|
|
||||||
|
|
||||||
|
class CollectFamily:
|
||||||
|
def family_collect(self) -> None:
|
||||||
|
if self.parameters is None:
|
||||||
|
self.parameters = {}
|
||||||
|
if self.user_type == "dynamic":
|
||||||
|
# FIXME code here only for support 1.0 dynamic flavor
|
||||||
|
# DictConsistencyError should be place in annotation
|
||||||
|
if "{{ identifier }}" not in self.name:
|
||||||
|
if "{{ suffix }}" in self.name:
|
||||||
|
self.name = self.name.replace("{{ suffix }}", "{{ identifier }}")
|
||||||
|
self.path = self.path.replace("{{ suffix }}", "{{ identifier }}")
|
||||||
|
elif "variable" in self.parameters:
|
||||||
|
self.name += "{{ identifier }}"
|
||||||
|
self.path += "{{ identifier }}"
|
||||||
|
else:
|
||||||
|
msg = f'dynamic family name must have "{{{{ identifier }}}}" in his name for "{self.path}"'
|
||||||
|
raise DictConsistencyError(msg, 13, self.sources)
|
||||||
|
if self.version == "1.0":
|
||||||
|
if "variable" not in self.parameters:
|
||||||
|
raise DictConsistencyError(
|
||||||
|
f'dynamic family must have "variable" attribute for "{self.path}"',
|
||||||
|
101,
|
||||||
|
self.sources,
|
||||||
|
)
|
||||||
|
if "dynamic" in self.parameters:
|
||||||
|
raise DictConsistencyError(
|
||||||
|
'variable and dynamic cannot be set together in the dynamic family "{self.path}"',
|
||||||
|
100,
|
||||||
|
self.sources,
|
||||||
|
)
|
||||||
|
self.parameters["dynamic"] = {
|
||||||
|
"type": "variable",
|
||||||
|
"variable": self.parameters["variable"],
|
||||||
|
"propertyerror": False,
|
||||||
|
"allow_none": True,
|
||||||
|
}
|
||||||
|
del self.parameters["variable"]
|
||||||
|
if "variable" in self.parameters:
|
||||||
|
self.parameters["dynamic"] = {
|
||||||
|
"type": "variable",
|
||||||
|
"variable": self.parameters["variable"],
|
||||||
|
"propertyerror": False,
|
||||||
|
"allow_none": True,
|
||||||
|
}
|
||||||
|
del self.parameters["variable"]
|
||||||
|
if self.version != "1.0":
|
||||||
|
warning = f'"variable" attribute in dynamic family "{self.path}" is depreciated in {display_list(self.sources)}'
|
||||||
|
warn(
|
||||||
|
warning,
|
||||||
|
DeprecationWarning,
|
||||||
|
stacklevel=2,
|
||||||
|
)
|
||||||
|
self.object = self.objectspace.family_objects[0]
|
||||||
|
else:
|
||||||
|
self.object = self.objectspace.family_objects[-1]
|
||||||
|
self.split_param_family_children()
|
||||||
|
|
||||||
|
def split_param_family_children(
|
||||||
|
self,
|
||||||
|
) -> None:
|
||||||
|
"""Family declaration mix variable object and family attributes
|
||||||
|
Here we separate attribute (which is the correct self.parameters content and variable declaration
|
||||||
|
"""
|
||||||
|
new_parameters = {}
|
||||||
|
children = self.parameters
|
||||||
|
# when an attribute starts with "_", the variable name without this "_" is a variable
|
||||||
|
sub_variables = [key[1:] for key in self.parameters if key.startswith('_') and key[1:] in self.parameters]
|
||||||
|
# and known variables
|
||||||
|
if self.path in self.objectspace.paths:
|
||||||
|
sub_variables.extend([p.rsplit('.', 1)[-1] for p in self.objectspace.parents[self.path]])
|
||||||
|
attributes = self.object["attrs"]
|
||||||
|
attributes_types = self.object["attributes_types"]
|
||||||
|
if self.types:
|
||||||
|
types_children = list(self.types.children)
|
||||||
|
else:
|
||||||
|
types_children = []
|
||||||
|
for key, value in list(children.items()):
|
||||||
|
if not isinstance(key, str):
|
||||||
|
raise DictConsistencyError(
|
||||||
|
f'the key "{key}" is not in string format for family {self.path}',
|
||||||
|
103,
|
||||||
|
self.sources,
|
||||||
|
)
|
||||||
|
if key.startswith("_"):
|
||||||
|
# if key starts with _, it's an attribute
|
||||||
|
if key == "_type" and self.types:
|
||||||
|
children.pop(key)
|
||||||
|
else:
|
||||||
|
new_parameters[key[1:]] = children.pop(key)
|
||||||
|
elif key in types_children or \
|
||||||
|
key not in attributes or \
|
||||||
|
key in sub_variables or \
|
||||||
|
not self.parameter_is_an_attributes(key, value, attributes_types):
|
||||||
|
if key == "type" and self.types and key not in types_children:
|
||||||
|
children.pop(key)
|
||||||
|
else:
|
||||||
|
new_parameters[key] = children.pop(key)
|
||||||
|
if self.version != "1.0" and not new_parameters and self.comment:
|
||||||
|
new_parameters["description"] = self.comment
|
||||||
|
self.children = children
|
||||||
|
self.parameters = new_parameters
|
||||||
|
|
||||||
|
|
||||||
|
class CollectVariable:
|
||||||
|
def variable_collect(self) -> None:
|
||||||
|
obj = self.parameters
|
||||||
|
if self.version == "1.0" or isinstance(obj, dict):
|
||||||
|
if obj is None:
|
||||||
|
# only with self.version to 1.0
|
||||||
|
obj = {}
|
||||||
|
self.parameters = obj
|
||||||
|
self.parse_type_params()
|
||||||
|
self.parse_secret_manager()
|
||||||
|
if not self.check_no_extra_keys:
|
||||||
|
extra_attrs = set(obj) - self.object["attrs"]
|
||||||
|
if extra_attrs:
|
||||||
|
raise DictConsistencyError(
|
||||||
|
f'"{self.path}" is not a valid variable, there are additional '
|
||||||
|
f'attributes: "{", ".join(extra_attrs)}"',
|
||||||
|
65,
|
||||||
|
self.sources,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self.parameters = {"default": obj}
|
||||||
|
if self.comment:
|
||||||
|
self.parameters["description"] = self.comment
|
||||||
|
|
||||||
|
def parse_type_params(self):
|
||||||
|
"""Parse variable params"""
|
||||||
|
if "params" not in self.parameters:
|
||||||
|
return
|
||||||
|
params = self.parameters["params"]
|
||||||
|
if isinstance(params, list):
|
||||||
|
# the conversion has already be done (in types purpose)
|
||||||
|
for param in params:
|
||||||
|
if not isinstance(param, AnyParam):
|
||||||
|
raise DictConsistencyError(
|
||||||
|
_("params must be a dict for {0}").format(self.path),
|
||||||
|
55,
|
||||||
|
self.sources,
|
||||||
|
)
|
||||||
|
return
|
||||||
|
elif not isinstance(params, dict):
|
||||||
|
raise DictConsistencyError(
|
||||||
|
_("params must be a dict for {0}").format(self.path),
|
||||||
|
55,
|
||||||
|
self.sources,
|
||||||
|
)
|
||||||
|
new_params = []
|
||||||
|
namespace = self.objectspace.namespace
|
||||||
|
for key, val in params.items():
|
||||||
|
try:
|
||||||
|
new_params.append(
|
||||||
|
AnyParam(
|
||||||
|
key=key,
|
||||||
|
value=val,
|
||||||
|
type="any",
|
||||||
|
path=None,
|
||||||
|
attribute=None,
|
||||||
|
family_is_dynamic=None,
|
||||||
|
namespace=namespace,
|
||||||
|
xmlfiles=self.sources,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
except ValidationError as err:
|
||||||
|
raise DictConsistencyError(
|
||||||
|
_('"{0}" has an invalid "params" for {1}: {2}').format(
|
||||||
|
key, self.path, err
|
||||||
|
),
|
||||||
|
54,
|
||||||
|
self.sources,
|
||||||
|
) from err
|
||||||
|
self.parameters["params"] = new_params
|
||||||
|
|
||||||
|
def parse_secret_manager(self):
|
||||||
|
"""Parse variable secret_manager"""
|
||||||
|
if "secret_manager" not in self.parameters:
|
||||||
|
return
|
||||||
|
secret_manager = {
|
||||||
|
"type": "jinja",
|
||||||
|
"jinja": self.objectspace.secret_pattern,
|
||||||
|
"params": self.parameters["secret_manager"],
|
||||||
|
}
|
||||||
|
self.set_calculation(
|
||||||
|
"secret_manager",
|
||||||
|
secret_manager,
|
||||||
|
)
|
||||||
|
|
||||||
|
class CollectType:
|
||||||
|
"""Determine the option type
|
||||||
|
1/ self.option_type must be "variable" or "family" option type
|
||||||
|
needs to determinate if the option is a variable or a family
|
||||||
|
an option is a family if:
|
||||||
|
- user specified a know family type: family, leadership (user must set it explicitly) or dynamic)
|
||||||
|
- has a family custom type
|
||||||
|
- has "dynamic" attribute (a variable could not has dynamic attribut)
|
||||||
|
- it's already a family (so we are certainly in redefine purpose
|
||||||
|
otherwise it's a variable
|
||||||
|
2/ self.user_type must be a more specilized variable or family type defined by the user
|
||||||
|
"""
|
||||||
|
|
||||||
|
def set_option_types(self):
|
||||||
|
if isinstance(self.parameters, dict):
|
||||||
|
self.set_user_type()
|
||||||
|
self.set_dynamic_user_type()
|
||||||
|
else:
|
||||||
|
self.short_hand_variable()
|
||||||
|
self.set_user_redefined()
|
||||||
|
self.variable_in_leadership()
|
||||||
|
self.family_or_variable()
|
||||||
|
if self.user_type:
|
||||||
|
logging.info("family_or_variable: %s is a %s (%s)", self.path, self.option_type, self.user_type)
|
||||||
|
else:
|
||||||
|
logging.info("family_or_variable: %s is a %s", self.path, self.option_type)
|
||||||
|
|
||||||
|
def set_user_type(
|
||||||
|
self,
|
||||||
|
) -> None:
|
||||||
|
"""Check 'type' attributes and determine the option type"""
|
||||||
|
for type_name in ["_type", "type"]:
|
||||||
|
if type_name not in self.parameters or not isinstance(self.parameters[type_name], str):
|
||||||
|
continue
|
||||||
|
self.user_type = self.parameters[type_name]
|
||||||
|
if self.user_type in self.objectspace.custom_family_types:
|
||||||
|
self.set_custom_type(self.objectspace.custom_family_types[self.user_type])
|
||||||
|
if self.user_type is None:
|
||||||
|
self.object = self.objectspace.family_objects[-1]
|
||||||
|
else:
|
||||||
|
self.set_object_user_type_family()
|
||||||
|
break
|
||||||
|
elif self.user_type in self.objectspace.custom_variable_types:
|
||||||
|
self.set_custom_type(self.objectspace.custom_variable_types[self.user_type])
|
||||||
|
if self.user_type is None:
|
||||||
|
self.object = self.objectspace.variable_objects[0]
|
||||||
|
else:
|
||||||
|
self.set_object_user_type_variable()
|
||||||
|
break
|
||||||
|
self.object = None
|
||||||
|
self.set_object_user_type_family()
|
||||||
|
if not self.object:
|
||||||
|
self.set_object_user_type_variable()
|
||||||
|
if not self.object:
|
||||||
|
msg = _('cannot determine the type of the {0} "{1}"').format(self.user_type, self.path)
|
||||||
|
raise DictConsistencyError(msg, 43, self.sources)
|
||||||
|
break
|
||||||
|
|
||||||
|
def set_custom_type(self, custom: dict) -> None:
|
||||||
|
if self.path in self.objectspace.paths:
|
||||||
|
msg = f'cannot redefine "{self.path}" object to a custom type'
|
||||||
|
raise DictConsistencyError(msg, 64, self.sources)
|
||||||
|
self.types = custom
|
||||||
|
self.types.name = self.name
|
||||||
|
self.types.path = self.path
|
||||||
|
self.types.namespace = self.namespace
|
||||||
|
self.option_type = self.types.option_type
|
||||||
|
self.user_type = self.types.user_type
|
||||||
|
self.sources = self.types.sources + self.sources
|
||||||
|
self.object = self.types.object
|
||||||
|
if self.option_type == "variable" and "type" in self.parameters:
|
||||||
|
self.parameters.pop("type")
|
||||||
|
|
||||||
|
def set_object_user_type_family(self):
|
||||||
|
for obj in self.objectspace.family_objects:
|
||||||
|
if self.user_type in obj["types"]:
|
||||||
|
self.option_type = "family"
|
||||||
|
self.object = obj
|
||||||
|
return
|
||||||
|
|
||||||
|
def set_object_user_type_variable(self):
|
||||||
|
for obj in self.objectspace.variable_objects:
|
||||||
|
if self.user_type in obj["types"]:
|
||||||
|
self.option_type = "variable"
|
||||||
|
self.object = obj
|
||||||
|
return
|
||||||
|
|
||||||
|
def set_dynamic_user_type(self) -> None:
|
||||||
|
if self.user_type:
|
||||||
|
return
|
||||||
|
for type_name in ["_dynamic", "dynamic"]:
|
||||||
|
if type_name in self.parameters and isinstance(self.parameters[type_name], (list, dict)):
|
||||||
|
self.user_type = "dynamic"
|
||||||
|
self.option_type = "family"
|
||||||
|
break
|
||||||
|
|
||||||
|
def set_user_redefined(self) -> None:
|
||||||
|
if self.path not in self.objectspace.paths:
|
||||||
|
return
|
||||||
|
# it's already a variable or a family
|
||||||
|
old_option_type = self.option_type if self.user_type else None
|
||||||
|
self.option_type = "family" if self.path in self.objectspace.families else "variable"
|
||||||
|
if old_option_type and self.option_type != old_option_type:
|
||||||
|
msg = f'the {old_option_type} "{self.path}" is redefine as a {self.option_type}, which is not allowed'
|
||||||
|
raise DictConsistencyError(msg, 11, self.sources)
|
||||||
|
if self.user_type:
|
||||||
|
return
|
||||||
|
self.user_type = self.objectspace.paths[self.path].type
|
||||||
|
if self.option_type == "family":
|
||||||
|
for obj in self.objectspace.family_objects:
|
||||||
|
if self.user_type in obj["types"]:
|
||||||
|
self.object = obj
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
self.object = self.objectspace.variable_objects[0]
|
||||||
|
else:
|
||||||
|
for obj in self.objectspace.variable_objects:
|
||||||
|
if self.user_type in obj["types"]:
|
||||||
|
self.object = obj
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
self.object = self.objectspace.variable_objects[-1]
|
||||||
|
|
||||||
|
def short_hand_variable(self):
|
||||||
|
if self.option_type:
|
||||||
|
return
|
||||||
|
# it's something like: "my_variable:" or "my_variable: True"
|
||||||
|
self.option_type = "variable"
|
||||||
|
self.object = self.objectspace.variable_objects[0]
|
||||||
|
|
||||||
|
def variable_in_leadership(self):
|
||||||
|
# in a leadership there have only variables
|
||||||
|
if not self.option_type and self.family_is_leadership:
|
||||||
|
self.option_type = "variable"
|
||||||
|
if not self.find_variable_object():
|
||||||
|
msg = f'"{self.path}" seems to be a family, which is not allowed in a family'
|
||||||
|
raise DictConsistencyError(msg, 17, self.sources)
|
||||||
|
|
||||||
|
def family_or_variable(
|
||||||
|
self,
|
||||||
|
) -> Literal["variable", "family"]:
|
||||||
|
"""check if all attributes are attributes of a variable"""
|
||||||
|
if self.option_type:
|
||||||
|
return
|
||||||
|
if not self.find_variable_object():
|
||||||
|
self.option_type = "family"
|
||||||
|
|
||||||
|
def find_variable_object(self) -> bool:
|
||||||
|
attrs = set(self.parameters)
|
||||||
|
for variable in self.objectspace.variable_objects:
|
||||||
|
if not attrs - variable["attrs"] and self.check_variable_parameters(variable):
|
||||||
|
self.option_type = "variable"
|
||||||
|
self.check_no_extra_keys = True
|
||||||
|
self.object = variable
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def check_variable_parameters(self, variable):
|
||||||
|
attributes_types = variable["attributes_types"]
|
||||||
|
attrs = variable["attrs"]
|
||||||
|
for key, value in list(self.parameters.items()):
|
||||||
|
if key not in attrs:
|
||||||
|
return False
|
||||||
|
if not self.parameter_is_an_attributes(key, value, attributes_types):
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
def parameter_is_an_attributes(self, key: str, value: Any, attributes_types: dict) -> bool:
|
||||||
|
if value is None:
|
||||||
|
return True
|
||||||
|
if key in attributes_types["literals"] and value in attributes_types["literals"][key]:
|
||||||
|
return True
|
||||||
|
for k, typ in [("strings", str), ("booleans", bool), ("integers", int), ("floats", float)]:
|
||||||
|
if key in attributes_types[k] and isinstance(value, typ):
|
||||||
|
return True
|
||||||
|
if isinstance(value, dict):
|
||||||
|
if key in attributes_types["calculation"]:
|
||||||
|
return self.is_calculation(key, value, attributes_types=attributes_types)
|
||||||
|
if key in attributes_types["params"]:
|
||||||
|
return True
|
||||||
|
if isinstance(value, list):
|
||||||
|
current_value = value.copy()
|
||||||
|
for k, typ in [("strings", str), ("booleans", bool), ("integers", int), ("floats", float)]:
|
||||||
|
if key in attributes_types["lists"][k]:
|
||||||
|
for idx, val in reversed(list(enumerate(current_value))):
|
||||||
|
if val is not None and not isinstance(val, typ):
|
||||||
|
continue
|
||||||
|
del current_value[idx]
|
||||||
|
if not current_value:
|
||||||
|
return True
|
||||||
|
if key in attributes_types["lists"]["calculation"]:
|
||||||
|
for val in current_value:
|
||||||
|
if isinstance(val, dict) and not self.is_calculation(key, val, inside_list=True, attributes_types=attributes_types):
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
class Collect(CollectType, CollectFamily, CollectVariable):
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
objectspace: "ParserVariable",
|
||||||
|
name: str,
|
||||||
|
subpath: Optional[str],
|
||||||
|
parameters: dict,
|
||||||
|
comment: Optional[str],
|
||||||
|
parent_option: Optional[Collect],
|
||||||
|
) -> None:
|
||||||
|
self.sources_types = None
|
||||||
|
self.types = None
|
||||||
|
self.name = name
|
||||||
|
if not subpath:
|
||||||
|
path = name
|
||||||
|
else:
|
||||||
|
path = f"{subpath}.{name}"
|
||||||
|
if name.startswith("_"):
|
||||||
|
msg = f'the variable or family "{self.path}" is incorrect, it must not starts with "_" character'
|
||||||
|
raise DictConsistencyError(msg, 16, obj["sources"])
|
||||||
|
self.path = path
|
||||||
|
self.subpath = subpath
|
||||||
|
self.parameters = parameters
|
||||||
|
self.comment = comment
|
||||||
|
self.objectspace = objectspace
|
||||||
|
self.namespace = objectspace.namespace
|
||||||
|
self.sources = objectspace.sources.copy()
|
||||||
|
self.user_type = None
|
||||||
|
self.option_type = None
|
||||||
|
if parent_option is not None and parent_option.types is not None and self.name in parent_option.types.children:
|
||||||
|
self.set_custom_type(parent_option.types.children[self.name])
|
||||||
|
self.check_no_extra_keys = False
|
||||||
|
if path in objectspace.paths:
|
||||||
|
for source in reversed(self.objectspace.paths[path].xmlfiles):
|
||||||
|
self.sources.insert(0, source)
|
||||||
|
if parent_option:
|
||||||
|
self.family_is_leadership = parent_option.user_type == "leadership"
|
||||||
|
self.family_is_dynamic = parent_option.family_is_dynamic
|
||||||
|
self.parent_dynamic = parent_option.parent_dynamic
|
||||||
|
else:
|
||||||
|
self.family_is_leadership = False
|
||||||
|
self.family_is_dynamic = False
|
||||||
|
self.parent_dynamic = None
|
||||||
|
self.version = self.objectspace.version
|
||||||
|
self.set_option_types()
|
||||||
|
if self.user_type == "dynamic":
|
||||||
|
self.family_is_dynamic = True
|
||||||
|
self.parent_dynamic = subpath
|
||||||
|
if self.option_type == "family":
|
||||||
|
self.family_collect()
|
||||||
|
else:
|
||||||
|
self.variable_collect()
|
||||||
|
self.convert_calculated_parameters()
|
||||||
|
self.exists = self.is_exists()
|
||||||
|
self.redefine = self.is_redefine()
|
||||||
|
|
||||||
|
def convert_calculated_parameters(
|
||||||
|
self,
|
||||||
|
):
|
||||||
|
"""Parse option attributes and convert calculation"""
|
||||||
|
obj = self.parameters
|
||||||
|
for key, value in obj.items():
|
||||||
|
if self.is_calculation(
|
||||||
|
key,
|
||||||
|
value,
|
||||||
|
):
|
||||||
|
try:
|
||||||
|
self.set_calculation(
|
||||||
|
key,
|
||||||
|
value,
|
||||||
|
)
|
||||||
|
except ValidationError as err:
|
||||||
|
raise DictConsistencyError(
|
||||||
|
_('the {0} "{1}" has an invalid "{2}": {3}').format(self.option_type, self.path, key, err),
|
||||||
|
84,
|
||||||
|
self.sources,
|
||||||
|
) from err
|
||||||
|
continue
|
||||||
|
if not isinstance(value, list):
|
||||||
|
continue
|
||||||
|
for idx, val in enumerate(value):
|
||||||
|
if not self.is_calculation(
|
||||||
|
key,
|
||||||
|
val,
|
||||||
|
inside_list=True,
|
||||||
|
):
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
self.set_calculation(
|
||||||
|
key,
|
||||||
|
val,
|
||||||
|
inside_list=True,
|
||||||
|
index=idx,
|
||||||
|
)
|
||||||
|
except ValidationError as err:
|
||||||
|
raise Exception(
|
||||||
|
f'the {option.type} "{option.path}" in "{display_list(option.sources)}" has an invalid "{key}" '
|
||||||
|
f"at index {idx}: {err}"
|
||||||
|
) from err
|
||||||
|
|
||||||
|
def is_dict(self, key: str, value: Any, *, attributes_types: Optional[dict]=None) -> bool:
|
||||||
|
"""it's a dict, so it's a new variables!"""
|
||||||
|
return isinstance(value, dict) and not self.is_calculation(key, value, attributes_types=attributes_types)
|
||||||
|
|
||||||
|
def is_calculation(
|
||||||
|
self,
|
||||||
|
attribute: str,
|
||||||
|
value: dict,
|
||||||
|
*,
|
||||||
|
attributes_types: Optional[dict]=None,
|
||||||
|
inside_list: bool=False,
|
||||||
|
):
|
||||||
|
"""Check if it's a calculation"""
|
||||||
|
if not isinstance(value, dict):
|
||||||
|
return False
|
||||||
|
if attributes_types is None:
|
||||||
|
attributes_types = self.object["attributes_types"]
|
||||||
|
if inside_list:
|
||||||
|
attributes_types = attributes_types["lists"]["calculation"]
|
||||||
|
else:
|
||||||
|
attributes_types = attributes_types["calculation"]
|
||||||
|
if attribute not in attributes_types:
|
||||||
|
return False
|
||||||
|
return self.manage_calculation_type(value)
|
||||||
|
|
||||||
|
def manage_calculation_type(self, value) -> bool:
|
||||||
|
"""Return true if the dict type is a calculation
|
||||||
|
If user set the type, it's easy, we just have to check if it's a known calculation type
|
||||||
|
Otherwise if we have an attribute with a known calculation type, we assume that is de calculation type
|
||||||
|
"""
|
||||||
|
if "type" in value:
|
||||||
|
return value["type"] in CALCULATION_TYPES
|
||||||
|
# auto set type
|
||||||
|
typ = set(CALCULATION_TYPES) & set(value)
|
||||||
|
# XXX variable could have identifier
|
||||||
|
if typ == {"variable", "identifier"}:
|
||||||
|
typ = {"variable"}
|
||||||
|
# XXX variable is also set to information
|
||||||
|
if typ == {"variable", "information"}:
|
||||||
|
typ = {"information"}
|
||||||
|
if len(typ) == 1:
|
||||||
|
value["type"] = typ.pop()
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def set_calculation(
|
||||||
|
self,
|
||||||
|
attribute: str,
|
||||||
|
value: dict,
|
||||||
|
*,
|
||||||
|
obj: Optional[dict] = None,
|
||||||
|
inside_list: bool = False,
|
||||||
|
index: int = None,
|
||||||
|
):
|
||||||
|
"""This variable is a calculation"""
|
||||||
|
if obj is None:
|
||||||
|
obj = self.parameters
|
||||||
|
calculation_object = value.copy()
|
||||||
|
typ = calculation_object.pop("type")
|
||||||
|
namespace = self.objectspace.namespace
|
||||||
|
|
||||||
|
calculation_object["attribute_name"] = attribute
|
||||||
|
calculation_object["inside_list"] = inside_list
|
||||||
|
calculation_object["version"] = self.version
|
||||||
|
calculation_object["namespace"] = namespace
|
||||||
|
calculation_object["xmlfiles"] = self.sources
|
||||||
|
#
|
||||||
|
self.set_identifier_calculation_in_default_attribut(attribute, calculation_object, inside_list, index)
|
||||||
|
self.set_params_calculation(calculation_object, attribute)
|
||||||
|
#
|
||||||
|
return_type = calculation_object.get("return_type")
|
||||||
|
if return_type and return_type not in self.objectspace.variable_objects[0]["types"]:
|
||||||
|
raise Exception(
|
||||||
|
f'unknown "return_type" in {attribute} of variable "{self.path}"'
|
||||||
|
)
|
||||||
|
#
|
||||||
|
if typ == "identifier" and not self.family_is_dynamic:
|
||||||
|
msg = f'identifier calculation for "{attribute}" in "{self.path}" cannot be set variable is not in dynamic family'
|
||||||
|
raise DictConsistencyError(msg, 53, self.sources)
|
||||||
|
if attribute in PROPERTY_ATTRIBUTE:
|
||||||
|
calc = CALCULATION_PROPERTY_TYPES[typ](**calculation_object)
|
||||||
|
else:
|
||||||
|
calc = CALCULATION_TYPES[typ](**calculation_object)
|
||||||
|
if index is None:
|
||||||
|
obj[attribute] = calc
|
||||||
|
else:
|
||||||
|
obj[attribute][index] = calc
|
||||||
|
|
||||||
|
def set_identifier_calculation_in_default_attribut(self, attribute: str, calculation_object: dict, inside_list: bool, index: Optional[int]) -> None:
|
||||||
|
if attribute != "default" or "identifier" not in calculation_object:
|
||||||
|
return
|
||||||
|
identifier = calculation_object["identifier"]
|
||||||
|
if self.is_calculation(
|
||||||
|
"identifier",
|
||||||
|
identifier,
|
||||||
|
attributes_types=self.objectspace.variable_objects[0]["attributes_types"],
|
||||||
|
inside_list=inside_list,
|
||||||
|
):
|
||||||
|
self.set_calculation("identifier", identifier, obj=calculation_object, inside_list=inside_list, index=index)
|
||||||
|
|
||||||
|
def set_params_calculation(self, calculation_object: dict, attribute: str) -> None:
|
||||||
|
if "params" not in calculation_object:
|
||||||
|
return
|
||||||
|
params = []
|
||||||
|
for key, value in calculation_object["params"].items():
|
||||||
|
if isinstance(value, dict) and "type" not in value:
|
||||||
|
self.set_param_type(value)
|
||||||
|
if not isinstance(value, dict) or "type" not in value:
|
||||||
|
param_typ = "any"
|
||||||
|
value = {
|
||||||
|
"value": value,
|
||||||
|
"type": "any",
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
if self.version == "1.0" and value["type"] == "suffix":
|
||||||
|
value["type"] = "identifier"
|
||||||
|
param_typ = value["type"]
|
||||||
|
value["key"] = key
|
||||||
|
value["path"] = self.path
|
||||||
|
value["family_is_dynamic"] = self.family_is_dynamic
|
||||||
|
value["attribute"] = attribute
|
||||||
|
value["namespace"] = self.objectspace.namespace
|
||||||
|
value["xmlfiles"] = self.sources
|
||||||
|
if param_typ not in PARAM_TYPES:
|
||||||
|
raise DictConsistencyError(
|
||||||
|
f'unknown type "{param_typ}" for "{self.path}"',
|
||||||
|
52,
|
||||||
|
self.sources,
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
params.append(PARAM_TYPES[param_typ](**value))
|
||||||
|
except ValidationError as err:
|
||||||
|
raise DictConsistencyError(
|
||||||
|
f'"{attribute}" has an invalid "{key}" for "{self.path}": {err}',
|
||||||
|
29,
|
||||||
|
self.sources,
|
||||||
|
) from err
|
||||||
|
calculation_object["params"] = params
|
||||||
|
|
||||||
|
def set_param_type(self, val):
|
||||||
|
# auto set type
|
||||||
|
param_typ = set(CALCULATION_TYPES) & set(val)
|
||||||
|
# XXX variable is also set to information
|
||||||
|
if param_typ == {"variable", "information"}:
|
||||||
|
param_typ = {"information"}
|
||||||
|
if len(param_typ) == 1:
|
||||||
|
val["type"] = list(param_typ)[0]
|
||||||
|
|
||||||
|
def is_redefine(self):
|
||||||
|
if self.path in self.objectspace.paths and self.option_type == "family" and not self.parameters:
|
||||||
|
# allow loading family with no attribute loaded
|
||||||
|
return True
|
||||||
|
if self.types:
|
||||||
|
return True
|
||||||
|
return self.parameters.pop("redefine", False) or (self.types and list(self.parameters) in [[], ["default"]])
|
||||||
|
|
||||||
|
def is_exists(self):
|
||||||
|
if self.version == "1.0" and self.option_type == "family":
|
||||||
|
return None
|
||||||
|
return self.parameters.pop("exists", None)
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -134,12 +134,12 @@ class VariableParam(Param):
|
||||||
).format(param["variable"], attribute_name, path)
|
).format(param["variable"], attribute_name, path)
|
||||||
raise DictConsistencyError(msg, 22, xmlfiles)
|
raise DictConsistencyError(msg, 22, xmlfiles)
|
||||||
return None
|
return None
|
||||||
if isinstance(variable, objectspace.family):
|
if isinstance(variable, objectspace.family_objects[-1]["object"]):
|
||||||
msg = _(
|
msg = _(
|
||||||
'the variable "{0}" is in fact a family in attribute "{1}" for "{2}"'
|
'the variable "{0}" is in fact a family in attribute "{1}" for "{2}"'
|
||||||
).format(variable["name"], attribute_name, path)
|
).format(variable["name"], attribute_name, path)
|
||||||
raise DictConsistencyError(msg, 42, xmlfiles)
|
raise DictConsistencyError(msg, 42, xmlfiles)
|
||||||
if not isinstance(variable, objectspace.variable):
|
if not isinstance(variable, objectspace.variable_objects[0]["object"]):
|
||||||
msg = _('unknown object "{0}" in attribute "{1}" for "{2}"').format(
|
msg = _('unknown object "{0}" in attribute "{1}" for "{2}"').format(
|
||||||
variable, attribute_name, path
|
variable, attribute_name, path
|
||||||
)
|
)
|
||||||
|
|
@ -253,6 +253,7 @@ class Calculation(BaseModel):
|
||||||
ori_path: Optional[StrictStr] = None
|
ori_path: Optional[StrictStr] = None
|
||||||
default_values: Any = None
|
default_values: Any = None
|
||||||
namespace: Optional[StrictStr]
|
namespace: Optional[StrictStr]
|
||||||
|
# FIXME warnings is not available for Properties!
|
||||||
warnings: Optional[bool] = None
|
warnings: Optional[bool] = None
|
||||||
description: Optional[StrictStr] = None
|
description: Optional[StrictStr] = None
|
||||||
xmlfiles: List[StrictStr]
|
xmlfiles: List[StrictStr]
|
||||||
|
|
@ -493,6 +494,7 @@ class _VariableCalculation(Calculation):
|
||||||
propertyerror: bool = True,
|
propertyerror: bool = True,
|
||||||
allow_none: bool = False
|
allow_none: bool = False
|
||||||
optional: bool = False
|
optional: bool = False
|
||||||
|
# FIXME identifier is not available for Properties!
|
||||||
identifier: Optional[Calculation] = None
|
identifier: Optional[Calculation] = None
|
||||||
|
|
||||||
def get_variable(
|
def get_variable(
|
||||||
|
|
@ -520,7 +522,7 @@ class _VariableCalculation(Calculation):
|
||||||
self.namespace,
|
self.namespace,
|
||||||
self.xmlfiles,
|
self.xmlfiles,
|
||||||
)
|
)
|
||||||
if variable and not isinstance(variable, objectspace.variable):
|
if variable and not isinstance(variable, objectspace.variable_objects[0]["object"]):
|
||||||
if isinstance(variable, objectspace.family):
|
if isinstance(variable, objectspace.family):
|
||||||
msg = _(
|
msg = _(
|
||||||
'a variable "{0}" is needs in attribute "{1}" for "{2}" but it\'s a family'
|
'a variable "{0}" is needs in attribute "{1}" for "{2}" but it\'s a family'
|
||||||
|
|
@ -1057,7 +1059,7 @@ class Family(BaseModel):
|
||||||
help: Optional[StrictStr] = None
|
help: Optional[StrictStr] = None
|
||||||
mode: Optional[StrictStr] = None
|
mode: Optional[StrictStr] = None
|
||||||
# validation
|
# validation
|
||||||
type: Literal["family", "leadership", "dynamic"] = "family"
|
type: Literal["family", "leadership"] = "family"
|
||||||
# properties
|
# properties
|
||||||
hidden: Union[bool, Calculation] = False
|
hidden: Union[bool, Calculation] = False
|
||||||
disabled: Union[bool, Calculation] = False
|
disabled: Union[bool, Calculation] = False
|
||||||
|
|
@ -1070,7 +1072,8 @@ class Family(BaseModel):
|
||||||
model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True)
|
model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True)
|
||||||
|
|
||||||
|
|
||||||
class Dynamic(Family):
|
class Dynamic(BaseModel):
|
||||||
|
type: Literal["dynamic"] = "dynamic"
|
||||||
# None only for format 1.0
|
# None only for format 1.0
|
||||||
variable: StrictStr = None
|
variable: StrictStr = None
|
||||||
dynamic: Union[List[Union[StrictStr, Calculation]], Calculation]
|
dynamic: Union[List[Union[StrictStr, Calculation]], Calculation]
|
||||||
|
|
@ -1082,17 +1085,16 @@ class Variable(BaseModel):
|
||||||
description: Optional[StrictStr] = None
|
description: Optional[StrictStr] = None
|
||||||
help: Optional[StrictStr] = None
|
help: Optional[StrictStr] = None
|
||||||
mode: Optional[StrictStr] = None
|
mode: Optional[StrictStr] = None
|
||||||
tags: Optional[list] = None
|
tags: Optional[List[StrictStr]] = None
|
||||||
examples: Optional[list] = None
|
examples: Optional[List[BASETYPE]] = None
|
||||||
test: Optional[list] = None
|
test: Optional[List[BASETYPE]] = None
|
||||||
# validations
|
# validations
|
||||||
## type will be set dynamically in `annotator/value.py`, default is None
|
## type will be set dynamically in `annotator/value.py`, default is None
|
||||||
type: StrictStr = None
|
type: StrictStr = None
|
||||||
params: Optional[List[Param]] = None
|
params: Optional[List[Param]] = None
|
||||||
regexp: Optional[StrictStr] = None
|
|
||||||
choices: Optional[Union[List[BASETYPE_CALC], Calculation]] = None
|
|
||||||
multi: Optional[bool] = None
|
multi: Optional[bool] = None
|
||||||
validators: Optional[List[Calculation]] = None
|
validators: Optional[List[Calculation]] = None
|
||||||
|
# FIXME: warnings markes sense? if so, please document it
|
||||||
warnings: bool = False
|
warnings: bool = False
|
||||||
# value
|
# value
|
||||||
default: Union[List[BASETYPE_CALC], BASETYPE_CALC] = None
|
default: Union[List[BASETYPE_CALC], BASETYPE_CALC] = None
|
||||||
|
|
@ -1100,6 +1102,7 @@ class Variable(BaseModel):
|
||||||
# properties
|
# properties
|
||||||
auto_save: bool = False
|
auto_save: bool = False
|
||||||
mandatory: Union[None, bool, Calculation] = None
|
mandatory: Union[None, bool, Calculation] = None
|
||||||
|
# FIXME: terme empty is not appropriate
|
||||||
empty: Union[None, bool, Calculation] = True
|
empty: Union[None, bool, Calculation] = True
|
||||||
unique: Optional[bool] = None
|
unique: Optional[bool] = None
|
||||||
hidden: Union[bool, Calculation] = False
|
hidden: Union[bool, Calculation] = False
|
||||||
|
|
@ -1114,6 +1117,16 @@ class Variable(BaseModel):
|
||||||
model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True)
|
model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True)
|
||||||
|
|
||||||
|
|
||||||
|
class Choices(BaseModel):
|
||||||
|
type: Literal["choice"] = "choice"
|
||||||
|
choices: Optional[Union[List[BASETYPE_CALC], Calculation]] = None
|
||||||
|
|
||||||
|
|
||||||
|
class Regexp(BaseModel):
|
||||||
|
type: Literal["regexp"] = "regexp"
|
||||||
|
regexp: Optional[StrictStr] = None
|
||||||
|
|
||||||
|
|
||||||
class SymLink(BaseModel):
|
class SymLink(BaseModel):
|
||||||
type: Literal["symlink"] = "symlink"
|
type: Literal["symlink"] = "symlink"
|
||||||
name: StrictStr
|
name: StrictStr
|
||||||
|
|
|
||||||
|
|
@ -50,16 +50,15 @@ class Paths:
|
||||||
|
|
||||||
def add(
|
def add(
|
||||||
self,
|
self,
|
||||||
path: str,
|
option: "Collect",
|
||||||
data: Any,
|
data: Any,
|
||||||
is_dynamic: bool,
|
|
||||||
dynamic: str,
|
|
||||||
*,
|
*,
|
||||||
force: bool = False,
|
force: bool = False,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
path = option.path
|
||||||
self._data[path] = data
|
self._data[path] = data
|
||||||
if not force and is_dynamic:
|
if not force and option.family_is_dynamic:
|
||||||
self._dynamics[path] = dynamic
|
self._dynamics[path] = option.parent_dynamic
|
||||||
|
|
||||||
def get_full_path(
|
def get_full_path(
|
||||||
self,
|
self,
|
||||||
|
|
@ -242,3 +241,6 @@ class Paths:
|
||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
return self._data.values()
|
return self._data.values()
|
||||||
|
|
||||||
|
def replace(self, path, variable):
|
||||||
|
self._data[path] = variable
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,7 @@ class Common:
|
||||||
def populate_attrib(self):
|
def populate_attrib(self):
|
||||||
"""Populate attributes"""
|
"""Populate attributes"""
|
||||||
keys = {"name": self.convert_str(self.elt.name)}
|
keys = {"name": self.convert_str(self.elt.name)}
|
||||||
if hasattr(self.elt, "description") and self.elt.description:
|
if self.elt.type != "symlink":
|
||||||
keys["doc"] = self.convert_str(self.elt.description)
|
keys["doc"] = self.convert_str(self.elt.description)
|
||||||
self._populate_attrib(keys)
|
self._populate_attrib(keys)
|
||||||
if self.elt.path in self.objectspace.properties:
|
if self.elt.path in self.objectspace.properties:
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
from rougail.annotator.variable import Walk
|
from rougail.annotator.variable import Walk
|
||||||
from rougail.utils import _
|
from rougail.utils import _
|
||||||
from rougail.error import DictConsistencyError
|
from rougail.error import DictConsistencyError
|
||||||
|
from rougail.convert.collect import Collect
|
||||||
|
|
||||||
|
|
||||||
class Annotator(Walk):
|
class Annotator(Walk):
|
||||||
|
|
@ -76,17 +77,22 @@ class Annotator(Walk):
|
||||||
|
|
||||||
self.alternative_names[alternative_name] = variable_path
|
self.alternative_names[alternative_name] = variable_path
|
||||||
if "." not in variable_path:
|
if "." not in variable_path:
|
||||||
path = alternative_name
|
subpath = None
|
||||||
else:
|
else:
|
||||||
path = variable_path.rsplit(".", 1)[0] + "." + alternative_name
|
subpath = variable_path.rsplit(".", 1)[0]
|
||||||
self.objectspace.version = variable.version
|
self.objectspace.version = variable.version
|
||||||
self.objectspace.add_variable(
|
# FIXME dynamic_family peut etre == true ??
|
||||||
|
# FIXME objectspace ? zut peut avoir une version différente !!
|
||||||
|
option = Collect(
|
||||||
|
self.objectspace,
|
||||||
alternative_name,
|
alternative_name,
|
||||||
path,
|
subpath,
|
||||||
{"type": "symlink", "opt": variable},
|
{"type": "symlink", "opt": variable},
|
||||||
variable.xmlfiles,
|
None,
|
||||||
False,
|
None,
|
||||||
False,
|
)
|
||||||
|
self.objectspace.add_variable(
|
||||||
|
option,
|
||||||
False,
|
False,
|
||||||
False,
|
False,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ from pathlib import Path
|
||||||
|
|
||||||
from ruamel.yaml import YAML
|
from ruamel.yaml import YAML
|
||||||
|
|
||||||
from ..tiramisu import normalize_family
|
|
||||||
from ..convert.path import Paths
|
from ..convert.path import Paths
|
||||||
from ..error import DictConsistencyError
|
from ..error import DictConsistencyError
|
||||||
from ..i18n import _
|
from ..i18n import _
|
||||||
|
|
@ -36,29 +35,26 @@ class Walker:
|
||||||
"""Parse directories content"""
|
"""Parse directories content"""
|
||||||
self.convert = convert
|
self.convert = convert
|
||||||
self.yaml = YAML()
|
self.yaml = YAML()
|
||||||
|
self.sort_structural_files_all = True
|
||||||
|
self.walk()
|
||||||
|
|
||||||
|
def walk(self) -> None:
|
||||||
rougailconfig = self.convert.rougailconfig
|
rougailconfig = self.convert.rougailconfig
|
||||||
self.sort_structural_files_all = rougailconfig["sort_structural_files_all"]
|
self.sort_structural_files_all = rougailconfig["sort_structural_files_all"]
|
||||||
if rougailconfig["main_namespace"]:
|
if rougailconfig["main_namespace"]:
|
||||||
self.convert.paths = Paths(
|
|
||||||
rougailconfig["main_namespace"],
|
|
||||||
rougailconfig["isolated_namespace"],
|
|
||||||
)
|
|
||||||
self.load_with_extra(
|
self.load_with_extra(
|
||||||
rougailconfig["extra_namespaces"],
|
rougailconfig["extra_namespaces"],
|
||||||
rougailconfig["main_namespace"],
|
rougailconfig["main_namespace"],
|
||||||
rougailconfig["main_structural_directories"],
|
rougailconfig["main_structural_directories"],
|
||||||
|
rougailconfig["isolated_namespace"],
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.convert.namespace = None
|
self.convert.namespace = None
|
||||||
namespace_path = ""
|
for filename in self.get_sorted_filenames(
|
||||||
if namespace_path in self.convert.parents:
|
|
||||||
raise Exception("pfff")
|
|
||||||
for filename in self.get_sorted_filename(
|
|
||||||
rougailconfig["main_structural_directories"]
|
rougailconfig["main_structural_directories"]
|
||||||
):
|
):
|
||||||
self.parse_variable_file(
|
self.parse_variable_file(
|
||||||
filename,
|
filename,
|
||||||
namespace_path,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def load_with_extra(
|
def load_with_extra(
|
||||||
|
|
@ -66,38 +62,25 @@ class Walker:
|
||||||
extra_structures: dict,
|
extra_structures: dict,
|
||||||
main_namespace: Optional[str] = None,
|
main_namespace: Optional[str] = None,
|
||||||
main_structures: Optional[List[str]] = None,
|
main_structures: Optional[List[str]] = None,
|
||||||
|
isolated_namespace: bool = True,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.convert.has_namespace = True
|
directory_dict = chain(
|
||||||
if main_namespace:
|
(
|
||||||
directory_dict = chain(
|
|
||||||
(
|
(
|
||||||
(
|
main_namespace,
|
||||||
main_namespace,
|
main_structures,
|
||||||
main_structures,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
extra_structures.items(),
|
),
|
||||||
)
|
extra_structures.items(),
|
||||||
else:
|
)
|
||||||
directory_dict = extra_structures.items()
|
for namespace, directories in directory_dict:
|
||||||
for namespace, extra_dirs in directory_dict:
|
self.convert.create_namespace(namespace, isolated_namespace)
|
||||||
# if namespace is None:
|
for filename in self.get_sorted_filenames(directories):
|
||||||
# self.convert.namespace = namespace
|
|
||||||
# else:
|
|
||||||
self.convert.namespace = normalize_family(namespace)
|
|
||||||
namespace_path = self.convert.namespace
|
|
||||||
if namespace_path in self.convert.parents:
|
|
||||||
raise Exception("pfff")
|
|
||||||
for idx, filename in enumerate(self.get_sorted_filename(extra_dirs)):
|
|
||||||
if not idx:
|
|
||||||
# create only for the first file
|
|
||||||
self.convert.create_namespace(namespace, namespace_path)
|
|
||||||
self.parse_variable_file(
|
self.parse_variable_file(
|
||||||
filename,
|
filename,
|
||||||
namespace_path,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_sorted_filename(
|
def get_sorted_filenames(
|
||||||
self,
|
self,
|
||||||
directories: Union[str, List[str]],
|
directories: Union[str, List[str]],
|
||||||
) -> Iterator[str]:
|
) -> Iterator[str]:
|
||||||
|
|
@ -116,11 +99,13 @@ class Walker:
|
||||||
for file_path in directory.iterdir():
|
for file_path in directory.iterdir():
|
||||||
self.get_filename(file_path, filenames)
|
self.get_filename(file_path, filenames)
|
||||||
if not self.sort_structural_files_all:
|
if not self.sort_structural_files_all:
|
||||||
for filename in sorted(filenames):
|
yield from self._get_sorted_filenames(filenames)
|
||||||
yield filenames[filename]
|
|
||||||
if self.sort_structural_files_all:
|
if self.sort_structural_files_all:
|
||||||
for filename in sorted(filenames):
|
yield from self._get_sorted_filenames(filenames)
|
||||||
yield filenames[filename]
|
|
||||||
|
def _get_sorted_filenames(self, filenames):
|
||||||
|
for filename in sorted(filenames):
|
||||||
|
yield filenames[filename]
|
||||||
|
|
||||||
def get_filename(self, file_path, filenames: List[str]) -> None:
|
def get_filename(self, file_path, filenames: List[str]) -> None:
|
||||||
if file_path.suffix not in [".yml", ".yaml"]:
|
if file_path.suffix not in [".yml", ".yaml"]:
|
||||||
|
|
@ -136,7 +121,6 @@ class Walker:
|
||||||
def parse_variable_file(
|
def parse_variable_file(
|
||||||
self,
|
self,
|
||||||
filename: str,
|
filename: str,
|
||||||
path: str,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Parse file"""
|
"""Parse file"""
|
||||||
with open(filename, encoding="utf8") as file_fh:
|
with open(filename, encoding="utf8") as file_fh:
|
||||||
|
|
@ -149,7 +133,7 @@ class Walker:
|
||||||
)
|
)
|
||||||
self.convert.parse_root_file(
|
self.convert.parse_root_file(
|
||||||
[filename],
|
[filename],
|
||||||
path,
|
self.convert.namespace,
|
||||||
version,
|
version,
|
||||||
objects,
|
objects,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -37,25 +37,17 @@ class Walker:
|
||||||
self.yaml = YAML()
|
self.yaml = YAML()
|
||||||
rougailconfig = self.convert.rougailconfig
|
rougailconfig = self.convert.rougailconfig
|
||||||
if rougailconfig["main_namespace"]:
|
if rougailconfig["main_namespace"]:
|
||||||
self.convert.has_namespace = True
|
|
||||||
self.convert.paths = Paths(
|
|
||||||
rougailconfig["main_namespace"],
|
|
||||||
rougailconfig["isolated_namespace"],
|
|
||||||
)
|
|
||||||
self.load_with_extra(
|
self.load_with_extra(
|
||||||
rougailconfig["extra_namespaces"],
|
rougailconfig["extra_namespaces"],
|
||||||
rougailconfig["main_namespace"],
|
rougailconfig["main_namespace"],
|
||||||
rougailconfig["main_structural_strings"],
|
rougailconfig["main_structural_strings"],
|
||||||
|
rougailconfig["isolated_namespace"],
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.convert.namespace = None
|
self.convert.namespace = None
|
||||||
namespace_path = ""
|
|
||||||
if namespace_path in self.convert.parents:
|
|
||||||
raise Exception("pfff")
|
|
||||||
for string in rougailconfig["main_structural_strings"]:
|
for string in rougailconfig["main_structural_strings"]:
|
||||||
self.parse_variable(
|
self.parse_variable(
|
||||||
string,
|
string,
|
||||||
namespace_path,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def load_with_extra(
|
def load_with_extra(
|
||||||
|
|
@ -63,6 +55,7 @@ class Walker:
|
||||||
extra_structures: dict,
|
extra_structures: dict,
|
||||||
main_namespace: str,
|
main_namespace: str,
|
||||||
main_strings: Optional[List[str]] = None,
|
main_strings: Optional[List[str]] = None,
|
||||||
|
isolated_namespace: bool = True,
|
||||||
) -> None:
|
) -> None:
|
||||||
directory_dict = chain(
|
directory_dict = chain(
|
||||||
(
|
(
|
||||||
|
|
@ -75,26 +68,22 @@ class Walker:
|
||||||
)
|
)
|
||||||
for namespace, extra_objects in directory_dict:
|
for namespace, extra_objects in directory_dict:
|
||||||
namespace_path = normalize_family(namespace)
|
namespace_path = normalize_family(namespace)
|
||||||
if namespace_path in self.convert.parents:
|
|
||||||
raise Exception("pfff")
|
|
||||||
self.convert.namespace = namespace_path
|
|
||||||
for idx, string in enumerate(extra_objects):
|
for idx, string in enumerate(extra_objects):
|
||||||
if not idx:
|
if not idx:
|
||||||
# create only for the first file
|
# create only for the first file
|
||||||
self.convert.create_namespace(namespace, namespace_path)
|
self.convert.create_namespace(namespace, isolated_namespace)
|
||||||
self.parse_variable(
|
self.parse_variable(
|
||||||
string,
|
string,
|
||||||
namespace_path,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def parse_variable(
|
def parse_variable(
|
||||||
self,
|
self,
|
||||||
string: str,
|
string: str,
|
||||||
path: str,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
objects = self.yaml.load(string)
|
objects = self.yaml.load(string)
|
||||||
if objects is None:
|
if objects is None:
|
||||||
return
|
return
|
||||||
|
path = self.convert.namespace
|
||||||
if path:
|
if path:
|
||||||
name = f'yaml file for {path}'
|
name = f'yaml file for {path}'
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,7 @@ CONVERT_OPTION = {
|
||||||
#
|
#
|
||||||
"symlink": dict(opttype="SymLinkOption"),
|
"symlink": dict(opttype="SymLinkOption"),
|
||||||
}
|
}
|
||||||
|
# only version 1.1
|
||||||
RENAME_TYPE = {"number": "integer"}
|
RENAME_TYPE = {"number": "integer"}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -411,15 +412,15 @@ def jinja_to_function(
|
||||||
for v in value:
|
for v in value:
|
||||||
if isinstance(v, PropertiesOptionError):
|
if isinstance(v, PropertiesOptionError):
|
||||||
v = JinjaError(v)
|
v = JinjaError(v)
|
||||||
if v is None:
|
# if v is None:
|
||||||
v = ''
|
# v = ''
|
||||||
val.append(v)
|
val.append(v)
|
||||||
value = val
|
value = val
|
||||||
else:
|
else:
|
||||||
if isinstance(value, PropertiesOptionError):
|
if isinstance(value, PropertiesOptionError):
|
||||||
value = JinjaError(value)
|
value = JinjaError(value)
|
||||||
if value is None:
|
# if value is None:
|
||||||
value = ''
|
# value = ''
|
||||||
if "." in key:
|
if "." in key:
|
||||||
c_kw = kw
|
c_kw = kw
|
||||||
path, var = key.rsplit(".", 1)
|
path, var = key.rsplit(".", 1)
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,11 @@ class TypeRougailConvert(StaticRougailConvert):
|
||||||
})
|
})
|
||||||
self.default_structural_format_version = default_structural_format_version
|
self.default_structural_format_version = default_structural_format_version
|
||||||
self.secret_pattern = secret_pattern
|
self.secret_pattern = secret_pattern
|
||||||
|
self.loaded_custom_types = {}
|
||||||
|
|
||||||
def load_config(self) -> None:
|
def load_config(self) -> None:
|
||||||
super().load_config()
|
super().load_config()
|
||||||
self.add_extra_options = self.add_extra_options
|
# self.add_extra_options = self.add_extra_options
|
||||||
self.sort_structural_files_all = False
|
self.sort_structural_files_all = False
|
||||||
self.structurals = ["directory"]
|
self.structurals = ["directory"]
|
||||||
|
|
||||||
|
|
@ -45,32 +45,33 @@ class TypeRougailConvert(StaticRougailConvert):
|
||||||
def rougail_type(rougailconfig):
|
def rougail_type(rougailconfig):
|
||||||
types = rougailconfig["types"]
|
types = rougailconfig["types"]
|
||||||
if not types:
|
if not types:
|
||||||
return {}, {}
|
return {"custom_variable_types": {}, "custom_family_types": {}}
|
||||||
convert = TypeRougailConvert(types, rougailconfig["secret_manager.pattern"], rougailconfig["default_structural_format_version"])
|
convert = TypeRougailConvert(types,
|
||||||
|
rougailconfig["secret_manager.pattern"],
|
||||||
|
rougailconfig["default_structural_format_version"],
|
||||||
|
)
|
||||||
convert.init()
|
convert.init()
|
||||||
convert.parse_directories()
|
convert.parse_directories()
|
||||||
return ({typ: to_dict_variable(convert.paths[typ]) for typ in convert.variables},
|
loaded_custom_types_keys = list(convert.loaded_custom_types)
|
||||||
{typ: to_dict_family(typ, convert.paths, convert.parents, convert.families) for typ in convert.families},
|
loaded_custom_types_keys.sort()
|
||||||
)
|
for path in loaded_custom_types_keys:
|
||||||
|
if "." not in path:
|
||||||
|
continue
|
||||||
def to_dict_variable(obj, with_files=True):
|
current = None
|
||||||
if with_files:
|
*spath, name = path.split(".")
|
||||||
keys = ['name', 'path']
|
for subpath in spath:
|
||||||
else:
|
if not current:
|
||||||
keys = ['name', 'path', 'xmlfiles']
|
current = convert.loaded_custom_types[subpath]
|
||||||
return {key: value for key, value in dict(obj).items() if key not in keys and value is not None}
|
else:
|
||||||
|
current = current.children[subpath]
|
||||||
|
current.children[name] = convert.loaded_custom_types.pop(path)
|
||||||
def to_dict_family(family_name, paths, parents, families, root=True):
|
custom_variable_types = {}
|
||||||
ret = to_dict_variable(paths[family_name], root)
|
custom_family_types = {}
|
||||||
for variable_path in parents[family_name]:
|
for typ, data in convert.loaded_custom_types.items():
|
||||||
variable = paths[variable_path]
|
if data.option_type == 'variable':
|
||||||
variable_name = variable.name
|
custom_variable_types[typ] = data
|
||||||
if variable_path in families:
|
|
||||||
if variable_name in ret:
|
|
||||||
ret["_" + variable_name] = ret.pop(variable_name)
|
|
||||||
ret[variable_name] = to_dict_family(variable.path, paths, parents, families, False)
|
|
||||||
else:
|
else:
|
||||||
ret[variable_name] = to_dict_variable(variable, False)
|
custom_family_types[typ] = data
|
||||||
return ret
|
return {"custom_variable_types": custom_variable_types,
|
||||||
|
"custom_family_types": custom_family_types,
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,4 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[], properties=frozenset({"advanced"}))
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,4 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[], properties=frozenset({"advanced"}))
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,4 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[], properties=frozenset({"advanced"}))
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"rougail.variable": {
|
"rougail.variable": {
|
||||||
"owner": "default",
|
"owner": "default",
|
||||||
"value": "string_1_True_"
|
"value": "string_1_True_None"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"rougail.variable": "string_1_True_"
|
"rougail.variable": "string_1_True_None"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"rougail.variable": {
|
"rougail.variable": {
|
||||||
"owner": "default",
|
"owner": "default",
|
||||||
"value": "string_1_True_"
|
"value": "string_1_True_None"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"rougail.variable": "string_1_True_"
|
"rougail.variable": "string_1_True_None"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,6 @@ ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
dict_env['disabled_rougail.family'] = "true\n"
|
dict_env['disabled_rougail.family'] = "true\n"
|
||||||
option_3 = StrOption(name="var1", doc="var1", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/16_2family_redefine_calculation/rougail/00-base.yml'], 'type': 'string'})
|
option_3 = StrOption(name="var1", doc="var1", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/16_2family_redefine_calculation/rougail/00-base.yml'], 'type': 'string'})
|
||||||
optiondescription_2 = OptionDescription(name="family", doc="family", children=[option_3], properties=frozenset({"basic", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue(None)), kwargs={'__internal_jinja': ParamValue("disabled_rougail.family"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/16_2family_redefine_calculation/rougail/01-base.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("rougail.family"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['../rougail-tests/structures/16_2family_redefine_calculation/rougail/00-base.yml', '../rougail-tests/structures/16_2family_redefine_calculation/rougail/01-base.yml']})
|
optiondescription_2 = OptionDescription(name="family", doc="family", children=[option_3], properties=frozenset({"basic", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue(None)), kwargs={'__internal_jinja': ParamValue("disabled_rougail.family"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/16_2family_redefine_calculation/rougail/00-base.yml', '../rougail-tests/structures/16_2family_redefine_calculation/rougail/01-base.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("rougail.family"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['../rougail-tests/structures/16_2family_redefine_calculation/rougail/00-base.yml', '../rougail-tests/structures/16_2family_redefine_calculation/rougail/01-base.yml']})
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[optiondescription_2], properties=frozenset({"basic"}))
|
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])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
||||||
|
|
|
||||||
|
|
@ -12,5 +12,5 @@ ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
dict_env['disabled_family'] = "true\n"
|
dict_env['disabled_family'] = "true\n"
|
||||||
option_2 = StrOption(name="var1", doc="var1", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/16_2family_redefine_calculation/rougail/00-base.yml'], 'type': 'string'})
|
option_2 = StrOption(name="var1", doc="var1", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/16_2family_redefine_calculation/rougail/00-base.yml'], 'type': 'string'})
|
||||||
optiondescription_1 = OptionDescription(name="family", doc="family", children=[option_2], properties=frozenset({"basic", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue(None)), kwargs={'__internal_jinja': ParamValue("disabled_family"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/16_2family_redefine_calculation/rougail/01-base.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("family"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['../rougail-tests/structures/16_2family_redefine_calculation/rougail/00-base.yml', '../rougail-tests/structures/16_2family_redefine_calculation/rougail/01-base.yml']})
|
optiondescription_1 = OptionDescription(name="family", doc="family", children=[option_2], properties=frozenset({"basic", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue(None)), kwargs={'__internal_jinja': ParamValue("disabled_family"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/16_2family_redefine_calculation/rougail/00-base.yml', '../rougail-tests/structures/16_2family_redefine_calculation/rougail/01-base.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("family"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['../rougail-tests/structures/16_2family_redefine_calculation/rougail/00-base.yml', '../rougail-tests/structures/16_2family_redefine_calculation/rougail/01-base.yml']})
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,6 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
dict_env['default_rougail.variable'] = "yes"
|
dict_env['default_rougail.variable'] = "yes"
|
||||||
option_2 = StrOption(name="variable", doc="a variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_rougail.variable"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/16_5redefine_calculation/rougail/01-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("rougail.variable")})), properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/16_5redefine_calculation/rougail/00-base.yml', '../rougail-tests/structures/16_5redefine_calculation/rougail/01-base.yml'], 'type': 'string'})
|
option_2 = StrOption(name="variable", doc="a variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_rougail.variable"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/16_5redefine_calculation/rougail/00-base.yml', '../rougail-tests/structures/16_5redefine_calculation/rougail/01-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("rougail.variable")})), properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/16_5redefine_calculation/rougail/00-base.yml', '../rougail-tests/structures/16_5redefine_calculation/rougail/01-base.yml'], 'type': 'string'})
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2], properties=frozenset({"standard"}))
|
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2], properties=frozenset({"standard"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
||||||
|
|
|
||||||
|
|
@ -11,5 +11,5 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
dict_env['default_variable'] = "yes"
|
dict_env['default_variable'] = "yes"
|
||||||
option_1 = StrOption(name="variable", doc="a variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_variable"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/16_5redefine_calculation/rougail/01-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("variable")})), properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/16_5redefine_calculation/rougail/00-base.yml', '../rougail-tests/structures/16_5redefine_calculation/rougail/01-base.yml'], 'type': 'string'})
|
option_1 = StrOption(name="variable", doc="a variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_variable"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/16_5redefine_calculation/rougail/00-base.yml', '../rougail-tests/structures/16_5redefine_calculation/rougail/01-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("variable")})), properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/16_5redefine_calculation/rougail/00-base.yml', '../rougail-tests/structures/16_5redefine_calculation/rougail/01-base.yml'], 'type': 'string'})
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,4 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[], properties=frozenset({"advanced"}))
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,6 @@ ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_3 = StrOption(name="variable1", doc="a variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml'], 'type': 'string'})
|
option_3 = StrOption(name="variable1", doc="a variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml'], 'type': 'string'})
|
||||||
optiondescription_2 = OptionDescription(name="family1", doc="new description", children=[option_3], properties=frozenset({"basic"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml', '../rougail-tests/structures/16_6exists_redefine_family/rougail/01-base.yml']})
|
optiondescription_2 = OptionDescription(name="family1", doc="new description", children=[option_3], properties=frozenset({"basic"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml', '../rougail-tests/structures/16_6exists_redefine_family/rougail/01-base.yml']})
|
||||||
option_5 = StrOption(name="variable2", doc="a second variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml'], 'type': 'string'})
|
option_5 = StrOption(name="variable2", doc="a second variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml'], 'type': 'string'})
|
||||||
optiondescription_4 = OptionDescription(name="family2", doc="a second family", children=[option_5], properties=frozenset({"basic"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml', '../rougail-tests/structures/16_6exists_redefine_family/rougail/01-base.yml']})
|
optiondescription_4 = OptionDescription(name="family2", doc="a second family", children=[option_5], properties=frozenset({"basic"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml']})
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[optiondescription_2, optiondescription_4], properties=frozenset({"basic"}))
|
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[optiondescription_2, optiondescription_4], properties=frozenset({"basic"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
||||||
|
|
|
||||||
|
|
@ -13,5 +13,5 @@ ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_2 = StrOption(name="variable1", doc="a variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml'], 'type': 'string'})
|
option_2 = StrOption(name="variable1", doc="a variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml'], 'type': 'string'})
|
||||||
optiondescription_1 = OptionDescription(name="family1", doc="new description", children=[option_2], properties=frozenset({"basic"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml', '../rougail-tests/structures/16_6exists_redefine_family/rougail/01-base.yml']})
|
optiondescription_1 = OptionDescription(name="family1", doc="new description", children=[option_2], properties=frozenset({"basic"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml', '../rougail-tests/structures/16_6exists_redefine_family/rougail/01-base.yml']})
|
||||||
option_4 = StrOption(name="variable2", doc="a second variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml'], 'type': 'string'})
|
option_4 = StrOption(name="variable2", doc="a second variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml'], 'type': 'string'})
|
||||||
optiondescription_3 = OptionDescription(name="family2", doc="a second family", children=[option_4], properties=frozenset({"basic"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml', '../rougail-tests/structures/16_6exists_redefine_family/rougail/01-base.yml']})
|
optiondescription_3 = OptionDescription(name="family2", doc="a second family", children=[option_4], properties=frozenset({"basic"}), informations={'ymlfiles': ['../rougail-tests/structures/16_6exists_redefine_family/rougail/00-base.yml']})
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_3])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_3])
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,4 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[], properties=frozenset({"advanced"}))
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,6 @@ ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
dict_env['validators_rougail.var3'] = "{% if _.var3 == _.var2 %}\nvar3 must be different than var2\n{% endif %}\n"
|
dict_env['validators_rougail.var3'] = "{% if _.var3 == _.var2 %}\nvar3 must be different than var2\n{% endif %}\n"
|
||||||
option_2 = StrOption(name="var1", doc="a first variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml'], 'type': 'string'})
|
option_2 = StrOption(name="var1", doc="a first variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml'], 'type': 'string'})
|
||||||
option_3 = StrOption(name="var2", doc="a second variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml'], 'type': 'string'})
|
option_3 = StrOption(name="var2", doc="a second variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml'], 'type': 'string'})
|
||||||
option_4 = StrOption(name="var3", doc="a third variable", default="yes", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var3"), 'description': ParamValue(None), '_.var3': ParamSelfOption(whole=False), '_.var2': ParamOption(option_3, notraisepropertyerror=True)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml', '../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml'], 'type': 'string', 'test': ('yes',)})
|
option_4 = StrOption(name="var3", doc="a third variable", default="yes", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml', '../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var3"), 'description': ParamValue(None), '_.var3': ParamSelfOption(whole=False), '_.var2': ParamOption(option_3, notraisepropertyerror=True)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml', '../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml'], 'type': 'string', 'test': ('yes',)})
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3, option_4], properties=frozenset({"standard"}))
|
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3, option_4], properties=frozenset({"standard"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
||||||
|
|
|
||||||
|
|
@ -13,5 +13,5 @@ ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
dict_env['validators_var3'] = "{% if _.var3 == _.var2 %}\nvar3 must be different than var2\n{% endif %}\n"
|
dict_env['validators_var3'] = "{% if _.var3 == _.var2 %}\nvar3 must be different than var2\n{% endif %}\n"
|
||||||
option_1 = StrOption(name="var1", doc="a first variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml'], 'type': 'string'})
|
option_1 = StrOption(name="var1", doc="a first variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml'], 'type': 'string'})
|
||||||
option_2 = StrOption(name="var2", doc="a second variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml'], 'type': 'string'})
|
option_2 = StrOption(name="var2", doc="a second variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml'], 'type': 'string'})
|
||||||
option_3 = StrOption(name="var3", doc="a third variable", default="yes", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var3"), 'description': ParamValue(None), '_.var3': ParamSelfOption(whole=False), '_.var2': ParamOption(option_2, notraisepropertyerror=True)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml', '../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml'], 'type': 'string', 'test': ('yes',)})
|
option_3 = StrOption(name="var3", doc="a third variable", default="yes", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml', '../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var3"), 'description': ParamValue(None), '_.var3': ParamSelfOption(whole=False), '_.var2': ParamOption(option_2, notraisepropertyerror=True)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml', '../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml'], 'type': 'string', 'test': ('yes',)})
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2, option_3])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2, option_3])
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,4 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[], properties=frozenset({"advanced"}))
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,4 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[], properties=frozenset({"advanced"}))
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,4 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[], properties=frozenset({"advanced"}))
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
||||||
|
|
|
||||||
0
tests/errors/10_family_to_variable_redefine/errno_11
Normal file
0
tests/errors/10_family_to_variable_redefine/errno_11
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
my_variable:
|
||||||
|
default: val1
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
my_variable:
|
||||||
|
type: family
|
||||||
|
redefine: true
|
||||||
0
tests/errors/22_0calculation_family_in_leader/errno_17
Normal file
0
tests/errors/22_0calculation_family_in_leader/errno_17
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
leadership:
|
||||||
|
description: a leadership
|
||||||
|
type: leadership
|
||||||
|
|
||||||
|
leader: # a leader
|
||||||
|
- value1
|
||||||
|
- value2
|
||||||
|
|
||||||
|
follower: # a follower
|
||||||
|
|
||||||
|
a_family: # A family
|
||||||
|
|
||||||
|
new_variable: # new variable
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
version: '1.0'
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
general:
|
general:
|
||||||
mode: level1
|
mode: level1
|
||||||
|
|
||||||
my_variable:
|
my_variable:
|
||||||
mode: level2
|
mode: level2
|
||||||
|
|
||||||
my_variable1:
|
my_variable1:
|
||||||
mode: level1
|
mode: level1
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
my_variable:
|
||||||
|
mode: level2
|
||||||
|
|
||||||
|
my_variable1:
|
||||||
|
mode: level1
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
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
|
|
||||||
try:
|
|
||||||
groups.namespace
|
|
||||||
except:
|
|
||||||
groups.addgroup('namespace')
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
|
||||||
option_1 = ChoiceOption(name="proxy_mode", doc="Configure Proxy Access to the Internet", values=("No proxy", "Auto-detect proxy settings for this network", "Use system proxy settings", "Manual proxy configuration", "Automatic proxy configuration URL"), default="No proxy", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/00-proxy.yml'], 'type': 'choice'})
|
|
||||||
option_4 = DomainnameOption(name="address", doc="HTTP proxy address", type="domainname", allow_ip=True, properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_5 = PortOption(name="port", doc="HTTP proxy port", default="8080", allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_3 = OptionDescription(name="http_proxy", doc="HTTP Proxy", children=[option_4, option_5], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml']})
|
|
||||||
option_6 = BoolOption(name="use_for_https", doc="Also use this proxy for HTTPS", default=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'boolean'})
|
|
||||||
option_8 = DomainnameOption(name="address", doc="HTTPS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), type="domainname", allow_ip=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_9 = PortOption(name="port", doc="HTTPS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), allow_private=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_7 = OptionDescription(name="https_proxy", doc="HTTPS Proxy", children=[option_8, option_9], properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("hidden"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_11 = DomainnameOption(name="address", doc="SOCKS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), type="domainname", allow_ip=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_12 = PortOption(name="port", doc="SOCKS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
option_13 = ChoiceOption(name="version", doc="SOCKS host version used by proxy", values=("v4", "v5"), default="v5", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'choice'})
|
|
||||||
optiondescription_10 = OptionDescription(name="socks_proxy", doc="SOCKS Proxy", children=[option_11, option_12, option_13], properties=frozenset({"standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
optiondescription_2 = OptionDescription(name="manual", doc="Manual proxy configuration", children=[optiondescription_3, option_6, optiondescription_7, optiondescription_10], properties=frozenset({"basic", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Manual proxy configuration"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/10-manual.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_14 = URLOption(name="auto", doc="Automatic proxy configuration URL", allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Automatic proxy configuration URL"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/30-auto.yml'], 'type': 'web_address'})
|
|
||||||
option_15 = DomainnameOption(name="no_proxy", doc="Address for which proxy will be desactivated", multi=True, type="domainname", allow_ip=True, allow_cidr_network=True, allow_without_dot=True, allow_startswith_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), '__internal_multi': ParamValue(True), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/40-no_proxy.yml'], 'type': 'domainname'})
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, optiondescription_2, option_14, option_15])
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
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
|
|
||||||
try:
|
|
||||||
groups.namespace
|
|
||||||
except:
|
|
||||||
groups.addgroup('namespace')
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
|
||||||
option_1 = ChoiceOption(name="proxy_mode", doc="Configure Proxy Access to the Internet", values=("No proxy", "Auto-detect proxy settings for this network", "Use system proxy settings", "Manual proxy configuration", "Automatic proxy configuration URL"), default="No proxy", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/00-proxy.yml'], 'type': 'choice'})
|
|
||||||
option_4 = DomainnameOption(name="address", doc="HTTP proxy address", type="domainname", allow_ip=True, properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_5 = PortOption(name="port", doc="HTTP proxy port", default="8080", allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_3 = OptionDescription(name="http_proxy", doc="HTTP Proxy", children=[option_4, option_5], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml']})
|
|
||||||
option_6 = BoolOption(name="use_for_https", doc="Also use this proxy for HTTPS", default=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'boolean'})
|
|
||||||
option_8 = DomainnameOption(name="address", doc="HTTPS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), type="domainname", allow_ip=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_9 = PortOption(name="port", doc="HTTPS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), allow_private=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_7 = OptionDescription(name="https_proxy", doc="HTTPS Proxy", children=[option_8, option_9], properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("hidden"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_11 = DomainnameOption(name="address", doc="SOCKS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), type="domainname", allow_ip=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_12 = PortOption(name="port", doc="SOCKS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
option_13 = ChoiceOption(name="version", doc="SOCKS host version used by proxy", values=("v4", "v5"), default="v5", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'choice'})
|
|
||||||
optiondescription_10 = OptionDescription(name="socks_proxy", doc="SOCKS Proxy", children=[option_11, option_12, option_13], properties=frozenset({"standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
optiondescription_2 = OptionDescription(name="manual", doc="Manual proxy configuration", children=[optiondescription_3, option_6, optiondescription_7, optiondescription_10], properties=frozenset({"basic", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Manual proxy configuration"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/10-manual.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_14 = URLOption(name="auto", doc="Automatic proxy configuration URL", allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Automatic proxy configuration URL"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/30-auto.yml'], 'type': 'web_address'})
|
|
||||||
option_15 = DomainnameOption(name="no_proxy", doc="Address for which proxy will be desactivated", multi=True, type="domainname", allow_ip=True, allow_cidr_network=True, allow_without_dot=True, allow_startswith_dot=True, properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), '__internal_multi': ParamValue(True), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/40-no_proxy.yml'], 'type': 'domainname'})
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, optiondescription_2, option_14, option_15])
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
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
|
|
||||||
try:
|
|
||||||
groups.namespace
|
|
||||||
except:
|
|
||||||
groups.addgroup('namespace')
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
|
||||||
option_1 = ChoiceOption(name="proxy_mode", doc="Configure Proxy Access to the Internet", values=("No proxy", "Auto-detect proxy settings for this network", "Use system proxy settings", "Manual proxy configuration", "Automatic proxy configuration URL"), default="No proxy", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/00-proxy.yml'], 'type': 'choice'})
|
|
||||||
option_4 = DomainnameOption(name="address", doc="HTTP proxy address", type="domainname", allow_ip=True, properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_5 = PortOption(name="port", doc="HTTP proxy port", default="8080", allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_3 = OptionDescription(name="http_proxy", doc="HTTP Proxy", children=[option_4, option_5], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml']})
|
|
||||||
option_6 = BoolOption(name="use_for_https", doc="Also use this proxy for HTTPS", default=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'boolean'})
|
|
||||||
option_8 = DomainnameOption(name="address", doc="HTTPS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), type="domainname", allow_ip=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_9 = PortOption(name="port", doc="HTTPS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), allow_private=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_7 = OptionDescription(name="https_proxy", doc="HTTPS Proxy", children=[option_8, option_9], properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("hidden"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_11 = DomainnameOption(name="address", doc="SOCKS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), type="domainname", allow_ip=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_12 = PortOption(name="port", doc="SOCKS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
option_13 = ChoiceOption(name="version", doc="SOCKS host version used by proxy", values=("v4", "v5"), default="v5", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'choice'})
|
|
||||||
optiondescription_10 = OptionDescription(name="socks_proxy", doc="SOCKS Proxy", children=[option_11, option_12, option_13], properties=frozenset({"standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
optiondescription_2 = OptionDescription(name="manual", doc="Manual proxy configuration", children=[optiondescription_3, option_6, optiondescription_7, optiondescription_10], properties=frozenset({"basic", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Manual proxy configuration"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/10-manual.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_14 = URLOption(name="auto", doc="Automatic proxy configuration URL", allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Automatic proxy configuration URL"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/30-auto.yml'], 'type': 'web_address'})
|
|
||||||
option_15 = DomainnameOption(name="no_proxy", doc="Address for which proxy will be desactivated", multi=True, type="domainname", allow_ip=True, allow_cidr_network=True, allow_without_dot=True, allow_startswith_dot=True, properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), '__internal_multi': ParamValue(True), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/40-no_proxy.yml'], 'type': 'domainname', 'examples': ('.mozilla.org', '.net.nz', '192.168.1.0/24')})
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, optiondescription_2, option_14, option_15])
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
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
|
|
||||||
try:
|
|
||||||
groups.namespace
|
|
||||||
except:
|
|
||||||
groups.addgroup('namespace')
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
|
||||||
option_1 = ChoiceOption(name="proxy_mode", doc="Configure Proxy Access to the Internet", values=("No proxy", "Auto-detect proxy settings for this network", "Use system proxy settings", "Manual proxy configuration", "Automatic proxy configuration URL"), default="No proxy", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/00-proxy.yml'], 'type': 'choice'})
|
|
||||||
option_4 = DomainnameOption(name="address", doc="HTTP proxy address", type="domainname", allow_ip=True, properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_5 = PortOption(name="port", doc="HTTP proxy port", default="8080", allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_3 = OptionDescription(name="http_proxy", doc="HTTP Proxy", children=[option_4, option_5], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml']})
|
|
||||||
option_6 = BoolOption(name="use_for_https", doc="Also use this proxy for HTTPS", default=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'boolean'})
|
|
||||||
option_8 = DomainnameOption(name="address", doc="HTTPS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), type="domainname", allow_ip=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_9 = PortOption(name="port", doc="HTTPS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), allow_private=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_7 = OptionDescription(name="https_proxy", doc="HTTPS Proxy", children=[option_8, option_9], properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("hidden"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_11 = DomainnameOption(name="address", doc="SOCKS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), type="domainname", allow_ip=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_12 = PortOption(name="port", doc="SOCKS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
option_13 = ChoiceOption(name="version", doc="SOCKS host version used by proxy", values=("v4", "v5"), default="v5", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'choice'})
|
|
||||||
optiondescription_10 = OptionDescription(name="socks_proxy", doc="SOCKS Proxy", children=[option_11, option_12, option_13], properties=frozenset({"standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
optiondescription_2 = OptionDescription(name="manual", doc="Manual proxy configuration", children=[optiondescription_3, option_6, optiondescription_7, optiondescription_10], properties=frozenset({"basic", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Manual proxy configuration"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/10-manual.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_14 = URLOption(name="auto", doc="Automatic proxy configuration URL", allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Automatic proxy configuration URL"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/30-auto.yml'], 'type': 'web_address'})
|
|
||||||
option_15 = DomainnameOption(name="no_proxy", doc="Address for which proxy will be desactivated", multi=True, type="domainname", allow_ip=True, allow_cidr_network=True, allow_without_dot=True, allow_startswith_dot=True, properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), '__internal_multi': ParamValue(True), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/40-no_proxy.yml'], 'type': 'domainname', 'examples': ('.mozilla.org', '.net.nz', '192.168.1.0/24'), 'help': 'Connections to localhost, 127.0.0.1/8 and ::1 are never proxied'})
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, optiondescription_2, option_14, option_15])
|
|
||||||
|
|
@ -25,5 +25,4 @@ optiondescription_2 = OptionDescription(name="manual", doc="Manual proxy configu
|
||||||
option_14 = URLOption(name="auto", doc="Automatic proxy configuration URL", allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Automatic proxy configuration URL"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/30-auto.yml'], 'type': 'web_address'})
|
option_14 = URLOption(name="auto", doc="Automatic proxy configuration URL", allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Automatic proxy configuration URL"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/30-auto.yml'], 'type': 'web_address'})
|
||||||
option_15 = DomainnameOption(name="no_proxy", doc="Address for which proxy will be desactivated", multi=True, type="domainname", allow_ip=True, allow_cidr_network=True, allow_without_dot=True, allow_startswith_dot=True, properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), '__internal_multi': ParamValue(True), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/40-no_proxy.yml'], 'type': 'domainname', 'examples': ('.mozilla.org', '.net.nz', '192.168.1.0/24'), 'help': 'Connections to localhost, 127.0.0.1/8 and ::1 are never proxied'})
|
option_15 = DomainnameOption(name="no_proxy", doc="Address for which proxy will be desactivated", multi=True, type="domainname", allow_ip=True, allow_cidr_network=True, allow_without_dot=True, allow_startswith_dot=True, properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), '__internal_multi': ParamValue(True), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/40-no_proxy.yml'], 'type': 'domainname', 'examples': ('.mozilla.org', '.net.nz', '192.168.1.0/24'), 'help': 'Connections to localhost, 127.0.0.1/8 and ::1 are never proxied'})
|
||||||
option_16 = BoolOption(name="prompt_authentication", doc="Prompt for authentication if password is saved", default=True, properties=frozenset({"mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/50-prompt_authentication.yml'], 'type': 'boolean'})
|
option_16 = BoolOption(name="prompt_authentication", doc="Prompt for authentication if password is saved", default=True, properties=frozenset({"mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/50-prompt_authentication.yml'], 'type': 'boolean'})
|
||||||
option_17 = BoolOption(name="proxy_dns_socks5", doc="Use proxy DNS when using SOCKS v5", default=False, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/55-proxy_dns_socks5.yml'], 'type': 'boolean'})
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, optiondescription_2, option_14, option_15, option_16])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, optiondescription_2, option_14, option_15, option_16, option_17])
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
dict_env['disabled_proxy_dns_socks5'] = "{{ _.proxy_mode != \"Manual proxy configuration\" or _.manual.socks_proxy.version == 'v4' }}"
|
|
||||||
option_1 = ChoiceOption(name="proxy_mode", doc="Configure Proxy Access to the Internet", values=("No proxy", "Auto-detect proxy settings for this network", "Use system proxy settings", "Manual proxy configuration", "Automatic proxy configuration URL"), default="No proxy", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/00-proxy.yml'], 'type': 'choice'})
|
option_1 = ChoiceOption(name="proxy_mode", doc="Configure Proxy Access to the Internet", values=("No proxy", "Auto-detect proxy settings for this network", "Use system proxy settings", "Manual proxy configuration", "Automatic proxy configuration URL"), default="No proxy", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/00-proxy.yml'], 'type': 'choice'})
|
||||||
option_4 = DomainnameOption(name="address", doc="HTTP proxy address", type="domainname", allow_ip=True, properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'domainname'})
|
option_4 = DomainnameOption(name="address", doc="HTTP proxy address", type="domainname", allow_ip=True, properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'domainname'})
|
||||||
option_5 = PortOption(name="port", doc="HTTP proxy port", default="8080", allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'port'})
|
option_5 = PortOption(name="port", doc="HTTP proxy port", default="8080", allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'port'})
|
||||||
|
|
@ -18,13 +17,13 @@ option_6 = BoolOption(name="use_for_https", doc="Also use this proxy for HTTPS",
|
||||||
option_8 = DomainnameOption(name="address", doc="HTTPS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), type="domainname", allow_ip=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
option_8 = DomainnameOption(name="address", doc="HTTPS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), type="domainname", allow_ip=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
||||||
option_9 = PortOption(name="port", doc="HTTPS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), allow_private=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
option_9 = PortOption(name="port", doc="HTTPS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), allow_private=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
||||||
optiondescription_7 = OptionDescription(name="https_proxy", doc="HTTPS Proxy", children=[option_8, option_9], properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("hidden"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
optiondescription_7 = OptionDescription(name="https_proxy", doc="HTTPS Proxy", children=[option_8, option_9], properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("hidden"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
||||||
option_11 = DomainnameOption(name="address", doc="SOCKS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), type="domainname", allow_ip=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
option_11 = DomainnameOption(name="address", doc="SOCKS proxy address", type="domainname", allow_ip=True, properties=frozenset({"standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
||||||
option_12 = PortOption(name="port", doc="SOCKS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
option_12 = PortOption(name="port", doc="SOCKS proxy port", default="1080", allow_private=True, properties=frozenset({"mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_11), 'prop': ParamValue("disabled"), 'when': ParamValue(None), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
||||||
option_13 = ChoiceOption(name="version", doc="SOCKS host version used by proxy", values=("v4", "v5"), default="v5", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'choice'})
|
option_13 = ChoiceOption(name="version", doc="SOCKS host version used by proxy", values=("v4", "v5"), default="v5", properties=frozenset({"mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_11), 'prop': ParamValue("disabled"), 'when': ParamValue(None), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'choice'})
|
||||||
optiondescription_10 = OptionDescription(name="socks_proxy", doc="SOCKS Proxy", children=[option_11, option_12, option_13], properties=frozenset({"standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
optiondescription_10 = OptionDescription(name="socks_proxy", doc="SOCKS Proxy", children=[option_11, option_12, option_13], properties=frozenset({"standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
||||||
optiondescription_2 = OptionDescription(name="manual", doc="Manual proxy configuration", children=[optiondescription_3, option_6, optiondescription_7, optiondescription_10], properties=frozenset({"basic", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Manual proxy configuration"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/10-manual.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
optiondescription_2 = OptionDescription(name="manual", doc="Manual proxy configuration", children=[optiondescription_3, option_6, optiondescription_7, optiondescription_10], properties=frozenset({"basic", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Manual proxy configuration"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/10-manual.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
||||||
option_14 = URLOption(name="auto", doc="Automatic proxy configuration URL", allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Automatic proxy configuration URL"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/30-auto.yml'], 'type': 'web_address'})
|
option_14 = URLOption(name="auto", doc="Automatic proxy configuration URL", allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Automatic proxy configuration URL"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/30-auto.yml'], 'type': 'web_address'})
|
||||||
option_15 = DomainnameOption(name="no_proxy", doc="Address for which proxy will be desactivated", multi=True, type="domainname", allow_ip=True, allow_cidr_network=True, allow_without_dot=True, allow_startswith_dot=True, properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), '__internal_multi': ParamValue(True), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/40-no_proxy.yml'], 'type': 'domainname', 'examples': ('.mozilla.org', '.net.nz', '192.168.1.0/24'), 'help': 'Connections to localhost, 127.0.0.1/8 and ::1 are never proxied'})
|
option_15 = DomainnameOption(name="no_proxy", doc="Address for which proxy will be desactivated", multi=True, type="domainname", allow_ip=True, allow_cidr_network=True, allow_without_dot=True, allow_startswith_dot=True, properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), '__internal_multi': ParamValue(True), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/40-no_proxy.yml'], 'type': 'domainname', 'examples': ('.mozilla.org', '.net.nz', '192.168.1.0/24'), 'help': 'Connections to localhost, 127.0.0.1/8 and ::1 are never proxied'})
|
||||||
option_16 = BoolOption(name="prompt_authentication", doc="Prompt for authentication if password is saved", default=True, properties=frozenset({"mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/50-prompt_authentication.yml'], 'type': 'boolean'})
|
option_16 = BoolOption(name="prompt_authentication", doc="Prompt for authentication if password is saved", default=True, properties=frozenset({"mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/50-prompt_authentication.yml'], 'type': 'boolean'})
|
||||||
option_17 = BoolOption(name="proxy_dns_socks5", doc="Use proxy DNS when using SOCKS v5", default=False, properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if \"_.proxy_mode\" is not \"Manual proxy configuration\"\nor \"_.manual.socks_proxy.version\" is \"v4\"")), kwargs={'__internal_jinja': ParamValue("disabled_proxy_dns_socks5"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/firefox/55-proxy_dns_socks5.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("proxy_dns_socks5"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.proxy_mode': ParamOption(option_1, notraisepropertyerror=True), '_.manual.socks_proxy.version': ParamOption(option_13, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/55-proxy_dns_socks5.yml'], 'type': 'boolean'})
|
option_17 = BoolOption(name="proxy_dns_socks5", doc="Use proxy DNS when using SOCKS v5", default=False, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/55-proxy_dns_socks5.yml'], 'type': 'boolean'})
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, optiondescription_2, option_14, option_15, option_16, option_17])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, optiondescription_2, option_14, option_15, option_16, option_17])
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
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
|
|
||||||
try:
|
|
||||||
groups.namespace
|
|
||||||
except:
|
|
||||||
groups.addgroup('namespace')
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
|
||||||
dict_env['disabled_proxy_dns_socks5'] = "{{ _.manual.socks_proxy.version is propertyerror or _.manual.socks_proxy.version == 'v4' }}"
|
|
||||||
option_1 = ChoiceOption(name="proxy_mode", doc="Configure Proxy Access to the Internet", values=("No proxy", "Auto-detect proxy settings for this network", "Use system proxy settings", "Manual proxy configuration", "Automatic proxy configuration URL"), default="No proxy", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/00-proxy.yml'], 'type': 'choice'})
|
|
||||||
option_4 = DomainnameOption(name="address", doc="HTTP proxy address", type="domainname", allow_ip=True, properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_5 = PortOption(name="port", doc="HTTP proxy port", default="8080", allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_3 = OptionDescription(name="http_proxy", doc="HTTP Proxy", children=[option_4, option_5], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml']})
|
|
||||||
option_6 = BoolOption(name="use_for_https", doc="Also use this proxy for HTTPS", default=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'boolean'})
|
|
||||||
option_8 = DomainnameOption(name="address", doc="HTTPS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), type="domainname", allow_ip=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_9 = PortOption(name="port", doc="HTTPS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), allow_private=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_7 = OptionDescription(name="https_proxy", doc="HTTPS Proxy", children=[option_8, option_9], properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("hidden"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_11 = DomainnameOption(name="address", doc="SOCKS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), type="domainname", allow_ip=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_12 = PortOption(name="port", doc="SOCKS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
option_13 = ChoiceOption(name="version", doc="SOCKS host version used by proxy", values=("v4", "v5"), default="v5", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'choice'})
|
|
||||||
optiondescription_10 = OptionDescription(name="socks_proxy", doc="SOCKS Proxy", children=[option_11, option_12, option_13], properties=frozenset({"standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
optiondescription_2 = OptionDescription(name="manual", doc="Manual proxy configuration", children=[optiondescription_3, option_6, optiondescription_7, optiondescription_10], properties=frozenset({"basic", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Manual proxy configuration"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/10-manual.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_14 = URLOption(name="auto", doc="Automatic proxy configuration URL", allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Automatic proxy configuration URL"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/30-auto.yml'], 'type': 'web_address'})
|
|
||||||
option_15 = DomainnameOption(name="no_proxy", doc="Address for which proxy will be desactivated", multi=True, type="domainname", allow_ip=True, allow_cidr_network=True, allow_without_dot=True, allow_startswith_dot=True, properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), '__internal_multi': ParamValue(True), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/40-no_proxy.yml'], 'type': 'domainname', 'examples': ('.mozilla.org', '.net.nz', '192.168.1.0/24'), 'help': 'Connections to localhost, 127.0.0.1/8 and ::1 are never proxied'})
|
|
||||||
option_16 = BoolOption(name="prompt_authentication", doc="Prompt for authentication if password is saved", default=True, properties=frozenset({"mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/50-prompt_authentication.yml'], 'type': 'boolean'})
|
|
||||||
option_17 = BoolOption(name="proxy_dns_socks5", doc="Use proxy DNS when using SOCKS v5", default=False, properties=frozenset({"advanced", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if \"_.proxy_mode\" is not \"Manual proxy configuration\"\nor \"_.manual.socks_proxy.version\" is \"v4\"")), kwargs={'__internal_jinja': ParamValue("disabled_proxy_dns_socks5"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/firefox/55-proxy_dns_socks5.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("proxy_dns_socks5"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.manual.socks_proxy.version': ParamOption(option_13, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/55-proxy_dns_socks5.yml'], 'type': 'boolean'})
|
|
||||||
option_19 = BoolOption(name="enable_dns_over_https", doc="Enable DNS over HTTPS", default=False, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml'], 'type': 'boolean'})
|
|
||||||
option_20 = ChoiceOption(name="provider", doc="Use Provider", values=("Cloudflare", "NextDNS", "Custom"), default="Cloudflare", properties=frozenset({"mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_19), 'prop': ParamValue("disabled"), 'when': ParamValue(False), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml'], 'type': 'choice'})
|
|
||||||
optiondescription_18 = OptionDescription(name="dns_over_https", doc="DNS over HTTPS", children=[option_19, option_20], properties=frozenset({"standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml']})
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, optiondescription_2, option_14, option_15, option_16, option_17, optiondescription_18])
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
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
|
|
||||||
try:
|
|
||||||
groups.namespace
|
|
||||||
except:
|
|
||||||
groups.addgroup('namespace')
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
|
||||||
dict_env['disabled_proxy_dns_socks5'] = "{{ _.manual.socks_proxy.version is propertyerror or _.manual.socks_proxy.version == 'v4' }}"
|
|
||||||
dict_env['disabled_dns_over_https.custom_dns_url'] = "{{ _.provider is propertyerror or _.provider != 'Custom' }}"
|
|
||||||
option_1 = ChoiceOption(name="proxy_mode", doc="Configure Proxy Access to the Internet", values=("No proxy", "Auto-detect proxy settings for this network", "Use system proxy settings", "Manual proxy configuration", "Automatic proxy configuration URL"), default="No proxy", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/00-proxy.yml'], 'type': 'choice'})
|
|
||||||
option_4 = DomainnameOption(name="address", doc="HTTP proxy address", type="domainname", allow_ip=True, properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_5 = PortOption(name="port", doc="HTTP proxy port", default="8080", allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_3 = OptionDescription(name="http_proxy", doc="HTTP Proxy", children=[option_4, option_5], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml']})
|
|
||||||
option_6 = BoolOption(name="use_for_https", doc="Also use this proxy for HTTPS", default=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'boolean'})
|
|
||||||
option_8 = DomainnameOption(name="address", doc="HTTPS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), type="domainname", allow_ip=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_9 = PortOption(name="port", doc="HTTPS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), allow_private=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_7 = OptionDescription(name="https_proxy", doc="HTTPS Proxy", children=[option_8, option_9], properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("hidden"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_11 = DomainnameOption(name="address", doc="SOCKS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), type="domainname", allow_ip=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_12 = PortOption(name="port", doc="SOCKS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
option_13 = ChoiceOption(name="version", doc="SOCKS host version used by proxy", values=("v4", "v5"), default="v5", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'choice'})
|
|
||||||
optiondescription_10 = OptionDescription(name="socks_proxy", doc="SOCKS Proxy", children=[option_11, option_12, option_13], properties=frozenset({"standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
optiondescription_2 = OptionDescription(name="manual", doc="Manual proxy configuration", children=[optiondescription_3, option_6, optiondescription_7, optiondescription_10], properties=frozenset({"basic", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Manual proxy configuration"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/10-manual.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_14 = URLOption(name="auto", doc="Automatic proxy configuration URL", allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("Automatic proxy configuration URL"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/30-auto.yml'], 'type': 'web_address'})
|
|
||||||
option_15 = DomainnameOption(name="no_proxy", doc="Address for which proxy will be desactivated", multi=True, type="domainname", allow_ip=True, allow_cidr_network=True, allow_without_dot=True, allow_startswith_dot=True, properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), '__internal_multi': ParamValue(True), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/40-no_proxy.yml'], 'type': 'domainname', 'examples': ('.mozilla.org', '.net.nz', '192.168.1.0/24'), 'help': 'Connections to localhost, 127.0.0.1/8 and ::1 are never proxied'})
|
|
||||||
option_16 = BoolOption(name="prompt_authentication", doc="Prompt for authentication if password is saved", default=True, properties=frozenset({"mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_1), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/50-prompt_authentication.yml'], 'type': 'boolean'})
|
|
||||||
option_17 = BoolOption(name="proxy_dns_socks5", doc="Use proxy DNS when using SOCKS v5", default=False, properties=frozenset({"advanced", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if \"_.proxy_mode\" is not \"Manual proxy configuration\"\nor \"_.manual.socks_proxy.version\" is \"v4\"")), kwargs={'__internal_jinja': ParamValue("disabled_proxy_dns_socks5"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/firefox/55-proxy_dns_socks5.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("proxy_dns_socks5"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.manual.socks_proxy.version': ParamOption(option_13, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/55-proxy_dns_socks5.yml'], 'type': 'boolean'})
|
|
||||||
option_19 = BoolOption(name="enable_dns_over_https", doc="Enable DNS over HTTPS", default=False, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml'], 'type': 'boolean'})
|
|
||||||
option_20 = ChoiceOption(name="provider", doc="Use Provider", values=("Cloudflare", "NextDNS", "Custom"), default="Cloudflare", properties=frozenset({"mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_19), 'prop': ParamValue("disabled"), 'when': ParamValue(False), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml'], 'type': 'choice'})
|
|
||||||
option_21 = URLOption(name="custom_dns_url", doc="Custom DNS URL", allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if \"_.provider\" is not \"Custom\"")), kwargs={'__internal_jinja': ParamValue("disabled_dns_over_https.custom_dns_url"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/firefox/60-dns_over_https.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("dns_over_https.custom_dns_url"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.provider': ParamOption(option_20, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml'], 'type': 'web_address'})
|
|
||||||
optiondescription_18 = OptionDescription(name="dns_over_https", doc="DNS over HTTPS", children=[option_19, option_20, option_21], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml']})
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, optiondescription_2, option_14, option_15, option_16, option_17, optiondescription_18])
|
|
||||||
|
|
@ -34,5 +34,4 @@ option_21 = ChoiceOption(name="provider", doc="Use Provider", values=("Cloudflar
|
||||||
option_22 = URLOption(name="custom_dns_url", doc="Custom DNS URL", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_firefox.dns_over_https.custom_dns_url"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/firefox/60-dns_over_https.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("firefox.dns_over_https.custom_dns_url"), 'description': ParamValue("must starts with 'https://' only"), '_.custom_dns_url': ParamSelfOption(whole=False)}))], allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if \"_.provider\" is not \"Custom\"")), kwargs={'__internal_jinja': ParamValue("disabled_firefox.dns_over_https.custom_dns_url"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/firefox/60-dns_over_https.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("firefox.dns_over_https.custom_dns_url"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.provider': ParamOption(option_21, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml'], 'type': 'web_address'})
|
option_22 = URLOption(name="custom_dns_url", doc="Custom DNS URL", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_firefox.dns_over_https.custom_dns_url"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/firefox/60-dns_over_https.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("firefox.dns_over_https.custom_dns_url"), 'description': ParamValue("must starts with 'https://' only"), '_.custom_dns_url': ParamSelfOption(whole=False)}))], allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if \"_.provider\" is not \"Custom\"")), kwargs={'__internal_jinja': ParamValue("disabled_firefox.dns_over_https.custom_dns_url"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/firefox/60-dns_over_https.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("firefox.dns_over_https.custom_dns_url"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.provider': ParamOption(option_21, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml'], 'type': 'web_address'})
|
||||||
optiondescription_19 = OptionDescription(name="dns_over_https", doc="DNS over HTTPS", children=[option_20, option_21, option_22], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml']})
|
optiondescription_19 = OptionDescription(name="dns_over_https", doc="DNS over HTTPS", children=[option_20, option_21, option_22], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml']})
|
||||||
optiondescription_1 = OptionDescription(name="firefox", doc="firefox", group_type=groups.namespace, children=[option_2, optiondescription_3, option_15, option_16, option_17, option_18, optiondescription_19], properties=frozenset({"basic"}))
|
optiondescription_1 = OptionDescription(name="firefox", doc="firefox", group_type=groups.namespace, children=[option_2, optiondescription_3, option_15, option_16, option_17, option_18, optiondescription_19], properties=frozenset({"basic"}))
|
||||||
optiondescription_23 = OptionDescription(name="foxyproxy", doc="foxyproxy", group_type=groups.namespace, children=[], properties=frozenset({"advanced"}))
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_23])
|
|
||||||
|
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
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
|
|
||||||
try:
|
|
||||||
groups.namespace
|
|
||||||
except:
|
|
||||||
groups.addgroup('namespace')
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
|
||||||
class Regexp_option_26(RegexpOption):
|
|
||||||
__slots__ = tuple()
|
|
||||||
_type = 'value'
|
|
||||||
Regexp_option_26._regexp = re_compile(r"^#(?:[0-9a-f]{3}){1,2}$")
|
|
||||||
|
|
||||||
dict_env['disabled_firefox.proxy_dns_socks5'] = "{{ _.manual.socks_proxy.version is propertyerror or _.manual.socks_proxy.version == 'v4' }}"
|
|
||||||
dict_env['validators_firefox.dns_over_https.custom_dns_url'] = "{{ _.custom_dns_url.startswith(\"http://\") }}"
|
|
||||||
dict_env['disabled_firefox.dns_over_https.custom_dns_url'] = "{{ _.provider is propertyerror or _.provider != 'Custom' }}"
|
|
||||||
dict_env['default_foxyproxy.proxies.color'] = "#{%- for i in range(6) -%}{{- '0123456789abcdef' | random -}}{%- endfor -%}"
|
|
||||||
option_2 = ChoiceOption(name="proxy_mode", doc="Configure Proxy Access to the Internet", values=("No proxy", "Auto-detect proxy settings for this network", "Use system proxy settings", "Manual proxy configuration", "Automatic proxy configuration URL"), default="No proxy", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/00-proxy.yml'], 'type': 'choice'})
|
|
||||||
option_5 = DomainnameOption(name="address", doc="HTTP proxy address", type="domainname", allow_ip=True, properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_6 = PortOption(name="port", doc="HTTP proxy port", default="8080", allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_4 = OptionDescription(name="http_proxy", doc="HTTP Proxy", children=[option_5, option_6], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml']})
|
|
||||||
option_7 = BoolOption(name="use_for_https", doc="Also use this proxy for HTTPS", default=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'boolean'})
|
|
||||||
option_9 = DomainnameOption(name="address", doc="HTTPS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), type="domainname", allow_ip=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_7), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_10 = PortOption(name="port", doc="HTTPS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_6)))), allow_private=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_7), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_8 = OptionDescription(name="https_proxy", doc="HTTPS Proxy", children=[option_9, option_10], properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_7), 'prop': ParamValue("hidden"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_12 = DomainnameOption(name="address", doc="SOCKS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), type="domainname", allow_ip=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_13 = PortOption(name="port", doc="SOCKS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_6)))), allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
option_14 = ChoiceOption(name="version", doc="SOCKS host version used by proxy", values=("v4", "v5"), default="v5", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'choice'})
|
|
||||||
optiondescription_11 = OptionDescription(name="socks_proxy", doc="SOCKS Proxy", children=[option_12, option_13, option_14], properties=frozenset({"standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
optiondescription_3 = OptionDescription(name="manual", doc="Manual proxy configuration", children=[optiondescription_4, option_7, optiondescription_8, optiondescription_11], properties=frozenset({"basic", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_2), 'prop': ParamValue("disabled"), 'when': ParamValue("Manual proxy configuration"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/10-manual.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_15 = URLOption(name="auto", doc="Automatic proxy configuration URL", allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_2), 'prop': ParamValue("disabled"), 'when': ParamValue("Automatic proxy configuration URL"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/30-auto.yml'], 'type': 'web_address'})
|
|
||||||
option_16 = DomainnameOption(name="no_proxy", doc="Address for which proxy will be desactivated", multi=True, type="domainname", allow_ip=True, allow_cidr_network=True, allow_without_dot=True, allow_startswith_dot=True, properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_2), '__internal_multi': ParamValue(True), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/40-no_proxy.yml'], 'type': 'domainname', 'examples': ('.mozilla.org', '.net.nz', '192.168.1.0/24'), 'help': 'Connections to localhost, 127.0.0.1/8 and ::1 are never proxied'})
|
|
||||||
option_17 = BoolOption(name="prompt_authentication", doc="Prompt for authentication if password is saved", default=True, properties=frozenset({"mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_2), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/50-prompt_authentication.yml'], 'type': 'boolean'})
|
|
||||||
option_18 = BoolOption(name="proxy_dns_socks5", doc="Use proxy DNS when using SOCKS v5", default=False, properties=frozenset({"advanced", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if \"_.proxy_mode\" is not \"Manual proxy configuration\"\nor \"_.manual.socks_proxy.version\" is \"v4\"")), kwargs={'__internal_jinja': ParamValue("disabled_firefox.proxy_dns_socks5"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/firefox/55-proxy_dns_socks5.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("firefox.proxy_dns_socks5"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.manual.socks_proxy.version': ParamOption(option_14, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/55-proxy_dns_socks5.yml'], 'type': 'boolean'})
|
|
||||||
option_20 = BoolOption(name="enable_dns_over_https", doc="Enable DNS over HTTPS", default=False, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml'], 'type': 'boolean'})
|
|
||||||
option_21 = ChoiceOption(name="provider", doc="Use Provider", values=("Cloudflare", "NextDNS", "Custom"), default="Cloudflare", properties=frozenset({"mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_20), 'prop': ParamValue("disabled"), 'when': ParamValue(False), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml'], 'type': 'choice'})
|
|
||||||
option_22 = URLOption(name="custom_dns_url", doc="Custom DNS URL", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_firefox.dns_over_https.custom_dns_url"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/firefox/60-dns_over_https.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("firefox.dns_over_https.custom_dns_url"), 'description': ParamValue("must starts with 'https://' only"), '_.custom_dns_url': ParamSelfOption(whole=False)}))], allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if \"_.provider\" is not \"Custom\"")), kwargs={'__internal_jinja': ParamValue("disabled_firefox.dns_over_https.custom_dns_url"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/firefox/60-dns_over_https.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("firefox.dns_over_https.custom_dns_url"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.provider': ParamOption(option_21, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml'], 'type': 'web_address'})
|
|
||||||
optiondescription_19 = OptionDescription(name="dns_over_https", doc="DNS over HTTPS", children=[option_20, option_21, option_22], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml']})
|
|
||||||
optiondescription_1 = OptionDescription(name="firefox", doc="firefox", group_type=groups.namespace, children=[option_2, optiondescription_3, option_15, option_16, option_17, option_18, optiondescription_19], properties=frozenset({"basic"}))
|
|
||||||
option_25 = StrOption(name="title", doc="Title or Description", multi=True, properties=frozenset({"standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml'], 'type': 'string'})
|
|
||||||
option_26 = Regexp_option_26(name="color", doc="Color", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_foxyproxy.proxies.color"), '__internal_type': ParamValue("regexp"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("foxyproxy.proxies.color")})), properties=frozenset({"basic", "force_store_value", "mandatory"}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml'], 'type': 'regexp'})
|
|
||||||
optiondescription_24 = Leadership(name="proxies", doc="Proxy configuration", children=[option_25, option_26], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']})
|
|
||||||
optiondescription_23 = OptionDescription(name="foxyproxy", doc="foxyproxy", group_type=groups.namespace, children=[optiondescription_24], properties=frozenset({"basic"}))
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_23])
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
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
|
|
||||||
try:
|
|
||||||
groups.namespace
|
|
||||||
except:
|
|
||||||
groups.addgroup('namespace')
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
|
||||||
class Regexp_option_27(RegexpOption):
|
|
||||||
__slots__ = tuple()
|
|
||||||
_type = 'value'
|
|
||||||
Regexp_option_27._regexp = re_compile(r"^#(?:[0-9a-f]{3}){1,2}$")
|
|
||||||
|
|
||||||
dict_env['disabled_firefox.proxy_dns_socks5'] = "{{ _.manual.socks_proxy.version is propertyerror or _.manual.socks_proxy.version == 'v4' }}"
|
|
||||||
dict_env['validators_firefox.dns_over_https.custom_dns_url'] = "{{ _.custom_dns_url.startswith(\"http://\") }}"
|
|
||||||
dict_env['disabled_firefox.dns_over_https.custom_dns_url'] = "{{ _.provider is propertyerror or _.provider != 'Custom' }}"
|
|
||||||
dict_env['default_foxyproxy.proxies.color'] = "#{%- for i in range(6) -%}{{- '0123456789abcdef' | random -}}{%- endfor -%}"
|
|
||||||
dict_env['disabled_foxyproxy.proxies.address'] = "{{ _.type not in ['HTTP', 'HTTPS/SSL', 'SOCKS4', 'SOCKS5'] }}"
|
|
||||||
dict_env['disabled_foxyproxy.proxies.port'] = "{{ _.type not in ['HTTP', 'HTTPS/SSL', 'SOCKS4', 'SOCKS5'] }}"
|
|
||||||
dict_env['disabled_foxyproxy.proxies.username'] = "{{ _.type not in ['HTTP', 'HTTPS/SSL', 'SOCKS4', 'SOCKS5'] }}"
|
|
||||||
dict_env['hidden_foxyproxy.proxies.password'] = "{{ not _.username }}"
|
|
||||||
dict_env['disabled_foxyproxy.proxies.password'] = "{{ _.type not in ['HTTP', 'HTTPS/SSL', 'SOCKS4', 'SOCKS5'] }}"
|
|
||||||
dict_env['frozen_foxyproxy.proxies.password'] = "{{ not _.username }}"
|
|
||||||
dict_env['disabled_foxyproxy.proxies.url'] = "{{ _.type not in ['PAC URL', 'WPAD'] }}"
|
|
||||||
option_2 = ChoiceOption(name="proxy_mode", doc="Configure Proxy Access to the Internet", values=("No proxy", "Auto-detect proxy settings for this network", "Use system proxy settings", "Manual proxy configuration", "Automatic proxy configuration URL"), default="No proxy", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/00-proxy.yml'], 'type': 'choice'})
|
|
||||||
option_5 = DomainnameOption(name="address", doc="HTTP proxy address", type="domainname", allow_ip=True, properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_6 = PortOption(name="port", doc="HTTP proxy port", default="8080", allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_4 = OptionDescription(name="http_proxy", doc="HTTP Proxy", children=[option_5, option_6], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/10-manual.yml']})
|
|
||||||
option_7 = BoolOption(name="use_for_https", doc="Also use this proxy for HTTPS", default=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'boolean'})
|
|
||||||
option_9 = DomainnameOption(name="address", doc="HTTPS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), type="domainname", allow_ip=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_7), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_10 = PortOption(name="port", doc="HTTPS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_6)))), allow_private=True, properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_7), 'prop': ParamValue("frozen"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
optiondescription_8 = OptionDescription(name="https_proxy", doc="HTTPS Proxy", children=[option_9, option_10], properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_7), 'prop': ParamValue("hidden"), 'when': ParamValue(True), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_12 = DomainnameOption(name="address", doc="SOCKS proxy address", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), type="domainname", allow_ip=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'domainname'})
|
|
||||||
option_13 = PortOption(name="port", doc="SOCKS proxy port", default=Calculation(func['calc_value'], Params((ParamOption(option_6)))), allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'port'})
|
|
||||||
option_14 = ChoiceOption(name="version", doc="SOCKS host version used by proxy", values=("v4", "v5"), default="v5", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/20-manual.yml'], 'type': 'choice'})
|
|
||||||
optiondescription_11 = OptionDescription(name="socks_proxy", doc="SOCKS Proxy", children=[option_12, option_13, option_14], properties=frozenset({"standard"}), informations={'ymlfiles': ['tutorial_tmp/types/00-type.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
optiondescription_3 = OptionDescription(name="manual", doc="Manual proxy configuration", children=[optiondescription_4, option_7, optiondescription_8, optiondescription_11], properties=frozenset({"basic", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_2), 'prop': ParamValue("disabled"), 'when': ParamValue("Manual proxy configuration"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/10-manual.yml', 'tutorial_tmp/structural/firefox/20-manual.yml']})
|
|
||||||
option_15 = URLOption(name="auto", doc="Automatic proxy configuration URL", allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_2), 'prop': ParamValue("disabled"), 'when': ParamValue("Automatic proxy configuration URL"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/30-auto.yml'], 'type': 'web_address'})
|
|
||||||
option_16 = DomainnameOption(name="no_proxy", doc="Address for which proxy will be desactivated", multi=True, type="domainname", allow_ip=True, allow_cidr_network=True, allow_without_dot=True, allow_startswith_dot=True, properties=frozenset({"standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_2), '__internal_multi': ParamValue(True), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/40-no_proxy.yml'], 'type': 'domainname', 'examples': ('.mozilla.org', '.net.nz', '192.168.1.0/24'), 'help': 'Connections to localhost, 127.0.0.1/8 and ::1 are never proxied'})
|
|
||||||
option_17 = BoolOption(name="prompt_authentication", doc="Prompt for authentication if password is saved", default=True, properties=frozenset({"mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_2), 'prop': ParamValue("disabled"), 'when': ParamValue("No proxy"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/50-prompt_authentication.yml'], 'type': 'boolean'})
|
|
||||||
option_18 = BoolOption(name="proxy_dns_socks5", doc="Use proxy DNS when using SOCKS v5", default=False, properties=frozenset({"advanced", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if \"_.proxy_mode\" is not \"Manual proxy configuration\"\nor \"_.manual.socks_proxy.version\" is \"v4\"")), kwargs={'__internal_jinja': ParamValue("disabled_firefox.proxy_dns_socks5"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/firefox/55-proxy_dns_socks5.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("firefox.proxy_dns_socks5"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.manual.socks_proxy.version': ParamOption(option_14, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/55-proxy_dns_socks5.yml'], 'type': 'boolean'})
|
|
||||||
option_20 = BoolOption(name="enable_dns_over_https", doc="Enable DNS over HTTPS", default=False, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml'], 'type': 'boolean'})
|
|
||||||
option_21 = ChoiceOption(name="provider", doc="Use Provider", values=("Cloudflare", "NextDNS", "Custom"), default="Cloudflare", properties=frozenset({"mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_20), 'prop': ParamValue("disabled"), 'when': ParamValue(False), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml'], 'type': 'choice'})
|
|
||||||
option_22 = URLOption(name="custom_dns_url", doc="Custom DNS URL", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_firefox.dns_over_https.custom_dns_url"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/firefox/60-dns_over_https.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("firefox.dns_over_https.custom_dns_url"), 'description': ParamValue("must starts with 'https://' only"), '_.custom_dns_url': ParamSelfOption(whole=False)}))], allow_ip=False, allow_without_dot=True, properties=frozenset({"basic", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if \"_.provider\" is not \"Custom\"")), kwargs={'__internal_jinja': ParamValue("disabled_firefox.dns_over_https.custom_dns_url"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/firefox/60-dns_over_https.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("firefox.dns_over_https.custom_dns_url"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.provider': ParamOption(option_21, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml'], 'type': 'web_address'})
|
|
||||||
optiondescription_19 = OptionDescription(name="dns_over_https", doc="DNS over HTTPS", children=[option_20, option_21, option_22], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/structural/firefox/60-dns_over_https.yml']})
|
|
||||||
optiondescription_1 = OptionDescription(name="firefox", doc="firefox", group_type=groups.namespace, children=[option_2, optiondescription_3, option_15, option_16, option_17, option_18, optiondescription_19], properties=frozenset({"basic"}))
|
|
||||||
option_25 = StrOption(name="title", doc="Title or Description", multi=True, properties=frozenset({"standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml'], 'type': 'string'})
|
|
||||||
option_26 = ChoiceOption(name="type", doc="Proxy Type", values=("HTTP", "HTTPS/SSL", "SOCKS4", "SOCKS5", "PAC URL", "WPAD", "System (use system settings)", "Direct (no proxy)"), multi=True, default_multi="Direct (no proxy)", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml'], 'type': 'choice'})
|
|
||||||
option_27 = Regexp_option_27(name="color", doc="Color", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_foxyproxy.proxies.color"), '__internal_type': ParamValue("regexp"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("foxyproxy.proxies.color")})), properties=frozenset({"basic", "force_store_value", "mandatory"}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml'], 'type': 'regexp'})
|
|
||||||
option_28 = DomainnameOption(name="address", doc="IP address, DNS name, server name", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_5, notraisepropertyerror=True)))), type="domainname", allow_ip=True, allow_without_dot=True, properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if type not in:\n- HTTP\n- HTTPS/SSL\n- SOCKS4\n- SOCKS5")), kwargs={'__internal_jinja': ParamValue("disabled_foxyproxy.proxies.address"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("foxyproxy.proxies.address"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.type': ParamOption(option_26, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml'], 'type': 'domainname'})
|
|
||||||
option_29 = PortOption(name="port", doc="Port", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_6, notraisepropertyerror=True)))), allow_private=True, properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if type not in:\n- HTTP\n- HTTPS/SSL\n- SOCKS4\n- SOCKS5")), kwargs={'__internal_jinja': ParamValue("disabled_foxyproxy.proxies.port"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("foxyproxy.proxies.port"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.type': ParamOption(option_26, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml'], 'type': 'port'})
|
|
||||||
option_30 = UsernameOption(name="username", doc="Username", multi=True, properties=frozenset({"standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if type not in:\n- HTTP\n- HTTPS/SSL\n- SOCKS4\n- SOCKS5")), kwargs={'__internal_jinja': ParamValue("disabled_foxyproxy.proxies.username"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("foxyproxy.proxies.username"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.type': ParamOption(option_26, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml', 'tutorial_tmp/structural/foxyproxy/10-redefine.yml'], 'type': 'unix_user'})
|
|
||||||
option_31 = PasswordOption(name="password", doc="Password", multi=True, properties=frozenset({"force_default_on_freeze", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("hidden"), ParamValue("if username is empty")), kwargs={'__internal_jinja': ParamValue("hidden_foxyproxy.proxies.password"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/10-redefine.yml']), '__internal_attribute': ParamValue("hidden"), '__internal_variable': ParamValue("foxyproxy.proxies.password"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.username': ParamOption(option_30, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help']), Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if type not in:\n- HTTP\n- HTTPS/SSL\n- SOCKS4\n- SOCKS5")), kwargs={'__internal_jinja': ParamValue("disabled_foxyproxy.proxies.password"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("foxyproxy.proxies.password"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.type': ParamOption(option_26, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help']), Calculation(func['jinja_to_property'], Params((ParamValue("frozen"), ParamValue("if username is empty")), kwargs={'__internal_jinja': ParamValue("frozen_foxyproxy.proxies.password"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/10-redefine.yml']), '__internal_attribute': ParamValue("frozen"), '__internal_variable': ParamValue("foxyproxy.proxies.password"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.username': ParamOption(option_30, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml', 'tutorial_tmp/structural/foxyproxy/10-redefine.yml'], 'type': 'secret'})
|
|
||||||
option_32 = URLOption(name="url", doc="URL", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_15, notraisepropertyerror=True)))), allow_ip=False, allow_without_dot=True, properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if type is not in:\n- PAC URL\n- WPAD")), kwargs={'__internal_jinja': ParamValue("disabled_foxyproxy.proxies.url"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("foxyproxy.proxies.url"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.type': ParamOption(option_26, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml'], 'type': 'web_address'})
|
|
||||||
optiondescription_24 = Leadership(name="proxies", doc="Proxy configuration", children=[option_25, option_26, option_27, option_28, option_29, option_30, option_31, option_32], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml', 'tutorial_tmp/structural/foxyproxy/10-redefine.yml']})
|
|
||||||
optiondescription_23 = OptionDescription(name="foxyproxy", doc="foxyproxy", group_type=groups.namespace, children=[optiondescription_24], properties=frozenset({"basic"}))
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_23])
|
|
||||||
|
|
@ -53,7 +53,7 @@ option_27 = Regexp_option_27(name="color", doc="Color", multi=True, default=Calc
|
||||||
option_28 = DomainnameOption(name="address", doc="IP address, DNS name, server name", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_5, notraisepropertyerror=True)))), type="domainname", allow_ip=True, allow_without_dot=True, properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if type not in:\n- HTTP\n- HTTPS/SSL\n- SOCKS4\n- SOCKS5")), kwargs={'__internal_jinja': ParamValue("disabled_foxyproxy.proxies.address"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("foxyproxy.proxies.address"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.type': ParamOption(option_26, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml'], 'type': 'domainname'})
|
option_28 = DomainnameOption(name="address", doc="IP address, DNS name, server name", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_5, notraisepropertyerror=True)))), type="domainname", allow_ip=True, allow_without_dot=True, properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if type not in:\n- HTTP\n- HTTPS/SSL\n- SOCKS4\n- SOCKS5")), kwargs={'__internal_jinja': ParamValue("disabled_foxyproxy.proxies.address"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("foxyproxy.proxies.address"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.type': ParamOption(option_26, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml'], 'type': 'domainname'})
|
||||||
option_29 = PortOption(name="port", doc="Port", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_6, notraisepropertyerror=True)))), allow_private=True, properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if type not in:\n- HTTP\n- HTTPS/SSL\n- SOCKS4\n- SOCKS5")), kwargs={'__internal_jinja': ParamValue("disabled_foxyproxy.proxies.port"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("foxyproxy.proxies.port"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.type': ParamOption(option_26, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml'], 'type': 'port'})
|
option_29 = PortOption(name="port", doc="Port", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_6, notraisepropertyerror=True)))), allow_private=True, properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if type not in:\n- HTTP\n- HTTPS/SSL\n- SOCKS4\n- SOCKS5")), kwargs={'__internal_jinja': ParamValue("disabled_foxyproxy.proxies.port"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("foxyproxy.proxies.port"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.type': ParamOption(option_26, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml'], 'type': 'port'})
|
||||||
option_30 = UsernameOption(name="username", doc="Username", multi=True, properties=frozenset({"standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if type not in:\n- HTTP\n- HTTPS/SSL\n- SOCKS4\n- SOCKS5")), kwargs={'__internal_jinja': ParamValue("disabled_foxyproxy.proxies.username"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("foxyproxy.proxies.username"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.type': ParamOption(option_26, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml', 'tutorial_tmp/structural/foxyproxy/10-redefine.yml'], 'type': 'unix_user'})
|
option_30 = UsernameOption(name="username", doc="Username", multi=True, properties=frozenset({"standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if type not in:\n- HTTP\n- HTTPS/SSL\n- SOCKS4\n- SOCKS5")), kwargs={'__internal_jinja': ParamValue("disabled_foxyproxy.proxies.username"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("foxyproxy.proxies.username"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.type': ParamOption(option_26, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml', 'tutorial_tmp/structural/foxyproxy/10-redefine.yml'], 'type': 'unix_user'})
|
||||||
option_31 = PasswordOption(name="password", doc="Password", multi=True, properties=frozenset({"force_default_on_freeze", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("hidden"), ParamValue("if username is empty")), kwargs={'__internal_jinja': ParamValue("hidden_foxyproxy.proxies.password"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/10-redefine.yml']), '__internal_attribute': ParamValue("hidden"), '__internal_variable': ParamValue("foxyproxy.proxies.password"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.username': ParamOption(option_30, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help']), Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if type not in:\n- HTTP\n- HTTPS/SSL\n- SOCKS4\n- SOCKS5")), kwargs={'__internal_jinja': ParamValue("disabled_foxyproxy.proxies.password"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("foxyproxy.proxies.password"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.type': ParamOption(option_26, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help']), Calculation(func['jinja_to_property'], Params((ParamValue("frozen"), ParamValue("if username is empty")), kwargs={'__internal_jinja': ParamValue("frozen_foxyproxy.proxies.password"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/10-redefine.yml']), '__internal_attribute': ParamValue("frozen"), '__internal_variable': ParamValue("foxyproxy.proxies.password"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.username': ParamOption(option_30, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml', 'tutorial_tmp/structural/foxyproxy/10-redefine.yml'], 'type': 'secret'})
|
option_31 = PasswordOption(name="password", doc="Password", multi=True, properties=frozenset({"force_default_on_freeze", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("hidden"), ParamValue("if username is empty")), kwargs={'__internal_jinja': ParamValue("hidden_foxyproxy.proxies.password"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml', 'tutorial_tmp/structural/foxyproxy/10-redefine.yml']), '__internal_attribute': ParamValue("hidden"), '__internal_variable': ParamValue("foxyproxy.proxies.password"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.username': ParamOption(option_30, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help']), Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if type not in:\n- HTTP\n- HTTPS/SSL\n- SOCKS4\n- SOCKS5")), kwargs={'__internal_jinja': ParamValue("disabled_foxyproxy.proxies.password"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("foxyproxy.proxies.password"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.type': ParamOption(option_26, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help']), Calculation(func['jinja_to_property'], Params((ParamValue("frozen"), ParamValue("if username is empty")), kwargs={'__internal_jinja': ParamValue("frozen_foxyproxy.proxies.password"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml', 'tutorial_tmp/structural/foxyproxy/10-redefine.yml']), '__internal_attribute': ParamValue("frozen"), '__internal_variable': ParamValue("foxyproxy.proxies.password"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.username': ParamOption(option_30, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml', 'tutorial_tmp/structural/foxyproxy/10-redefine.yml'], 'type': 'secret'})
|
||||||
option_32 = URLOption(name="url", doc="URL", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_15, notraisepropertyerror=True)))), allow_ip=False, allow_without_dot=True, properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if type is not in:\n- PAC URL\n- WPAD")), kwargs={'__internal_jinja': ParamValue("disabled_foxyproxy.proxies.url"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("foxyproxy.proxies.url"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.type': ParamOption(option_26, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml'], 'type': 'web_address'})
|
option_32 = URLOption(name="url", doc="URL", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_15, notraisepropertyerror=True)))), allow_ip=False, allow_without_dot=True, properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if type is not in:\n- PAC URL\n- WPAD")), kwargs={'__internal_jinja': ParamValue("disabled_foxyproxy.proxies.url"), '__internal_type': ParamValue("boolean"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("foxyproxy.proxies.url"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.type': ParamOption(option_26, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml'], 'type': 'web_address'})
|
||||||
optiondescription_24 = Leadership(name="proxies", doc="Proxy configuration", children=[option_25, option_26, option_27, option_28, option_29, option_30, option_31, option_32], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml', 'tutorial_tmp/structural/foxyproxy/10-redefine.yml']})
|
optiondescription_24 = Leadership(name="proxies", doc="Proxy configuration", children=[option_25, option_26, option_27, option_28, option_29, option_30, option_31, option_32], properties=frozenset({"basic"}), informations={'ymlfiles': ['tutorial_tmp/structural/foxyproxy/00-foxyproxy.yml', 'tutorial_tmp/structural/foxyproxy/10-redefine.yml']})
|
||||||
optiondescription_23 = OptionDescription(name="foxyproxy", doc="foxyproxy", group_type=groups.namespace, children=[optiondescription_24], properties=frozenset({"basic"}))
|
optiondescription_23 = OptionDescription(name="foxyproxy", doc="foxyproxy", group_type=groups.namespace, children=[optiondescription_24], properties=frozenset({"basic"}))
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ def save(test_dir, eolobj, multi=False, namespace=False, error=False):
|
||||||
rmtree(tiramisu_tmp_dir)
|
rmtree(tiramisu_tmp_dir)
|
||||||
|
|
||||||
|
|
||||||
def test_structural_file(test_dir):
|
def test_structural_file1(test_dir):
|
||||||
if not test_no_namespace:
|
if not test_no_namespace:
|
||||||
print('NAMESPACE!')
|
print('NAMESPACE!')
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,24 @@ from rougail.error import DictConsistencyError
|
||||||
from tiramisu.error import ConflictError
|
from tiramisu.error import ConflictError
|
||||||
|
|
||||||
from rougail_tests.utils import config_to_dict
|
from rougail_tests.utils import config_to_dict
|
||||||
|
from rougail.config import get_rougail_config
|
||||||
|
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
logger.setLevel(logging.INFO)
|
logger.setLevel(logging.INFO)
|
||||||
|
|
||||||
|
|
||||||
|
def test_mode_unconfigured_mode():
|
||||||
|
# default variable mode is not in modes_level
|
||||||
|
rougailconfig = get_rougail_config(
|
||||||
|
backward_compatibility=False, add_extra_options=False
|
||||||
|
)
|
||||||
|
rougailconfig['main_structural_directories'] = ['tests/personalize_mode/dictionary']
|
||||||
|
eolobj = Rougail(rougailconfig=rougailconfig)
|
||||||
|
with raises(DictConsistencyError) as err:
|
||||||
|
eolobj.converted.annotate()
|
||||||
|
assert err.value.errno == 71
|
||||||
|
|
||||||
|
|
||||||
def test_mode_invalid_default():
|
def test_mode_invalid_default():
|
||||||
# default variable mode is not in modes_level
|
# default variable mode is not in modes_level
|
||||||
rougailconfig = RougailConfig.copy()
|
rougailconfig = RougailConfig.copy()
|
||||||
|
|
@ -56,6 +69,20 @@ def test_personalize_mode_unknown():
|
||||||
assert err.value.errno == 71
|
assert err.value.errno == 71
|
||||||
|
|
||||||
|
|
||||||
|
def test_personalize_mode_unknown2():
|
||||||
|
# a variable has an unknown mode
|
||||||
|
rougailconfig = RougailConfig.copy()
|
||||||
|
rougailconfig['main_structural_directories'] = ['tests/personalize_mode_without_family/dictionary']
|
||||||
|
rougailconfig['main_namespace'] = None
|
||||||
|
rougailconfig['modes_level'] = ['level1']
|
||||||
|
rougailconfig['default_variable_mode'] = 'level1'
|
||||||
|
rougailconfig['default_family_mode'] = 'level1'
|
||||||
|
eolobj = Rougail(rougailconfig=rougailconfig)
|
||||||
|
with raises(DictConsistencyError) as err:
|
||||||
|
eolobj.converted.annotate()
|
||||||
|
assert err.value.errno == 71
|
||||||
|
|
||||||
|
|
||||||
def test_personalize_annotate_twice():
|
def test_personalize_annotate_twice():
|
||||||
rougailconfig = RougailConfig.copy()
|
rougailconfig = RougailConfig.copy()
|
||||||
rougailconfig['main_structural_directories'] = ['tests/personalize_mode/dictionary']
|
rougailconfig['main_structural_directories'] = ['tests/personalize_mode/dictionary']
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,12 @@ def test_type_family_redefine_namespace():
|
||||||
type_variable("family_redefine", namespace=True)
|
type_variable("family_redefine", namespace=True)
|
||||||
|
|
||||||
|
|
||||||
|
def test_type_family_redefine_2():
|
||||||
|
with raises(DictConsistencyError) as err:
|
||||||
|
type_variable("family_redefine_family_types")
|
||||||
|
assert err.value.errno == 64
|
||||||
|
|
||||||
|
|
||||||
def test_type_family_subfamily():
|
def test_type_family_subfamily():
|
||||||
type_variable("family_subfamily")
|
type_variable("family_subfamily")
|
||||||
|
|
||||||
|
|
@ -134,7 +140,7 @@ def test_type_family_subfamily_add_namespace():
|
||||||
def test_type_error_version():
|
def test_type_error_version():
|
||||||
with raises(DictConsistencyError) as err:
|
with raises(DictConsistencyError) as err:
|
||||||
type_variable("error_version")
|
type_variable("error_version")
|
||||||
assert err.errno == 27
|
assert err.value.errno == 27
|
||||||
|
|
||||||
|
|
||||||
def test_type_family_name_description():
|
def test_type_family_name_description():
|
||||||
|
|
@ -147,3 +153,23 @@ def test_type_leadership():
|
||||||
|
|
||||||
def test_type_leadership_namespace():
|
def test_type_leadership_namespace():
|
||||||
type_variable("leadership", namespace=True)
|
type_variable("leadership", namespace=True)
|
||||||
|
|
||||||
|
|
||||||
|
def test_type_error_redefine():
|
||||||
|
type_variable("error_variable_redefine", namespace=True)
|
||||||
|
|
||||||
|
|
||||||
|
def test_type_secret():
|
||||||
|
type_variable("secret_manager")
|
||||||
|
|
||||||
|
|
||||||
|
def test_type_secret_namespace():
|
||||||
|
type_variable("secret_manager", namespace=True)
|
||||||
|
|
||||||
|
|
||||||
|
def test_type_family_secret():
|
||||||
|
type_variable("family_secret_manager")
|
||||||
|
|
||||||
|
|
||||||
|
def test_type_family_secret_namespace():
|
||||||
|
type_variable("family_secret_manager", namespace=True)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
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
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_1 = StrOption(name="my_var", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/error_variable_redefine/00_type.yml', 'tests/types/structures/error_variable_redefine/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)})
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"my_var": "a value"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"my_var": "a value"
|
||||||
|
}
|
||||||
|
|
@ -9,7 +9,7 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_3 = StrOption(name="my_type", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/family/00_type.yml', 'tests/types/structures/family/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)})
|
option_4 = StrOption(name="my_type", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/family/00_type.yml', 'tests/types/structures/family/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)})
|
||||||
optiondescription_2 = OptionDescription(name="my_family", doc="My family type", children=[option_3], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family/00_type.yml', 'tests/types/structures/family/00_structure.yml']})
|
optiondescription_3 = OptionDescription(name="my_family", doc="My family type", children=[option_4], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family/00_type.yml', 'tests/types/structures/family/00_structure.yml']})
|
||||||
optiondescription_1 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_2], properties=frozenset({"standard"}))
|
optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_3], properties=frozenset({"standard"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2])
|
||||||
|
|
|
||||||
|
|
@ -9,20 +9,20 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_3 = StrOption(name="a_first_variable", doc="a first variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
option_4 = StrOption(name="a_first_variable", doc="a first variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
||||||
option_5 = StrOption(name="identifier", doc="identifier", multi=True, default=["family"], default_multi="family", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
option_6 = StrOption(name="identifier", doc="identifier", multi=True, default=["family"], default_multi="family", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
||||||
option_6 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
option_7 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_4 = OptionDescription(name="a_sub_{{ identifier }}", doc="My sub{{ identifier }}", children=[option_5, option_6], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml']})
|
optiondescription_5 = OptionDescription(name="a_sub_{{ identifier }}", doc="My sub{{ identifier }}", children=[option_6, option_7], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml']})
|
||||||
optiondescription_2 = OptionDescription(name="my_family_1", doc="My family type", children=[option_3, optiondescription_4], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml']})
|
optiondescription_3 = OptionDescription(name="my_family_1", doc="My family type", children=[option_4, optiondescription_5], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml']})
|
||||||
option_8 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
option_9 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
||||||
option_10 = StrOption(name="identifier", doc="identifier", multi=True, default=["family"], default_multi="family", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
option_11 = StrOption(name="identifier", doc="identifier", multi=True, default=["family"], default_multi="family", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
||||||
option_11 = StrOption(name="a_second_variable", doc="a second variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
option_12 = StrOption(name="a_second_variable", doc="a second variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_9 = OptionDescription(name="a_sub_{{ identifier }}", doc="My sub{{ identifier }}", children=[option_10, option_11], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml']})
|
optiondescription_10 = OptionDescription(name="a_sub_{{ identifier }}", doc="My sub{{ identifier }}", children=[option_11, option_12], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml']})
|
||||||
optiondescription_7 = OptionDescription(name="my_family_2", doc="My family type", children=[option_8, optiondescription_9], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml']})
|
optiondescription_8 = OptionDescription(name="my_family_2", doc="My family type", children=[option_9, optiondescription_10], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml']})
|
||||||
option_13 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
option_14 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
||||||
option_15 = StrOption(name="identifier", doc="identifier", multi=True, default=["family"], default_multi="family", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
option_16 = StrOption(name="identifier", doc="identifier", multi=True, default=["family"], default_multi="family", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
||||||
option_16 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value 2", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
option_17 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value 2", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_14 = OptionDescription(name="a_sub_{{ identifier }}", doc="My sub{{ identifier }}", children=[option_15, option_16], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml']})
|
optiondescription_15 = OptionDescription(name="a_sub_{{ identifier }}", doc="My sub{{ identifier }}", children=[option_16, option_17], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml']})
|
||||||
optiondescription_12 = OptionDescription(name="my_family_3", doc="My family type", children=[option_13, optiondescription_14], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml']})
|
optiondescription_13 = OptionDescription(name="my_family_3", doc="My family type", children=[option_14, optiondescription_15], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_dynfamily/00_structure.yml', 'tests/types/structures/family_dynfamily/00_structure.yml']})
|
||||||
optiondescription_1 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_2, optiondescription_7, optiondescription_12], properties=frozenset({"basic"}))
|
optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_3, optiondescription_8, optiondescription_13], properties=frozenset({"basic"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2])
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_3 = StrOption(name="description", doc="My second variable", default="an other new value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_name_description/00_structure.yml', 'tests/types/structures/family_name_description/00_structure.yml'], 'type': 'string'})
|
option_4 = StrOption(name="name", doc="My first variable", default="a new value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_name_description/00_structure.yml', 'tests/types/structures/family_name_description/00_structure.yml'], 'type': 'string'})
|
||||||
option_4 = StrOption(name="type", doc="My third variable", default="again an other new value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_name_description/00_structure.yml', 'tests/types/structures/family_name_description/00_structure.yml'], 'type': 'string'})
|
option_5 = StrOption(name="description", doc="My second variable", default="an other new value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_name_description/00_structure.yml', 'tests/types/structures/family_name_description/00_structure.yml'], 'type': 'string'})
|
||||||
option_5 = StrOption(name="name", doc="My first variable", default="a new value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_name_description/00_structure.yml', 'tests/types/structures/family_name_description/00_structure.yml'], 'type': 'string'})
|
option_6 = StrOption(name="type", doc="My third variable", default="again an other new value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_name_description/00_structure.yml', 'tests/types/structures/family_name_description/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_2 = OptionDescription(name="my_family", doc="my_family", children=[option_3, option_4, option_5], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_name_description/00_structure.yml', 'tests/types/structures/family_name_description/00_structure.yml']})
|
optiondescription_3 = OptionDescription(name="my_family", doc="My family type", children=[option_4, option_5, option_6], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_name_description/00_structure.yml', 'tests/types/structures/family_name_description/00_structure.yml']})
|
||||||
optiondescription_1 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_2], properties=frozenset({"standard"}))
|
optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_3], properties=frozenset({"standard"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2])
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,14 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_3 = StrOption(name="a_first_variable", doc="a first variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml'], 'type': 'string'})
|
option_4 = StrOption(name="a_first_variable", doc="a first variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml'], 'type': 'string'})
|
||||||
option_4 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml'], 'type': 'string'})
|
option_5 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_2 = OptionDescription(name="my_family_1", doc="My family type", children=[option_3, option_4], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml']})
|
optiondescription_3 = OptionDescription(name="my_family_1", doc="My family type", children=[option_4, option_5], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml']})
|
||||||
option_6 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml'], 'type': 'string'})
|
option_7 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml'], 'type': 'string'})
|
||||||
option_7 = StrOption(name="a_second_variable", doc="a second variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml'], 'type': 'string'})
|
option_8 = StrOption(name="a_second_variable", doc="a second variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_5 = OptionDescription(name="my_family_2", doc="My family type", children=[option_6, option_7], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml']})
|
optiondescription_6 = OptionDescription(name="my_family_2", doc="My family type", children=[option_7, option_8], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml']})
|
||||||
option_9 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml'], 'type': 'string'})
|
option_10 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml'], 'type': 'string'})
|
||||||
option_10 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value 2", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml'], 'type': 'string'})
|
option_11 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value 2", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_8 = OptionDescription(name="my_family_3", doc="My family type", children=[option_9, option_10], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml']})
|
optiondescription_9 = OptionDescription(name="my_family_3", doc="My family type", children=[option_10, option_11], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_redefine/00_structure.yml', 'tests/types/structures/family_redefine/00_structure.yml']})
|
||||||
optiondescription_1 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_2, optiondescription_5, optiondescription_8], properties=frozenset({"basic"}))
|
optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_3, optiondescription_6, optiondescription_9], properties=frozenset({"basic"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2])
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
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
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_2 = StrOption(name="a_variable", doc="A variable", default="my_value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'string'})
|
||||||
|
option_3 = PasswordOption(name="secret", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'secret'})
|
||||||
|
optiondescription_1 = OptionDescription(name="secret1", doc="Family with secret", children=[option_2, option_3], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml']})
|
||||||
|
option_5 = StrOption(name="a_variable", doc="A variable", default="my_value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'string'})
|
||||||
|
option_6 = PasswordOption(name="secret", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'secret'})
|
||||||
|
optiondescription_4 = OptionDescription(name="secret2", doc="Family with secret", children=[option_5, option_6], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml']})
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"secret1.a_variable": "my_value",
|
||||||
|
"secret1.secret": null,
|
||||||
|
"secret2.a_variable": "my_value",
|
||||||
|
"secret2.secret": null
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"secret1.a_variable": "my_value",
|
||||||
|
"secret1.secret": null,
|
||||||
|
"secret2.a_variable": "my_value",
|
||||||
|
"secret2.secret": null
|
||||||
|
}
|
||||||
19
tests/types/result/family_secret_manager/tiramisu.py
Normal file
19
tests/types/result/family_secret_manager/tiramisu.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
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
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_4 = StrOption(name="a_variable", doc="A variable", default="my_value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'string'})
|
||||||
|
option_5 = PasswordOption(name="secret", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'secret'})
|
||||||
|
optiondescription_3 = OptionDescription(name="secret1", doc="Family with secret", children=[option_4, option_5], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml']})
|
||||||
|
option_7 = StrOption(name="a_variable", doc="A variable", default="my_value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'string'})
|
||||||
|
option_8 = PasswordOption(name="secret", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'secret'})
|
||||||
|
optiondescription_6 = OptionDescription(name="secret2", doc="Family with secret", children=[option_7, option_8], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml']})
|
||||||
|
optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_3, optiondescription_6], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2])
|
||||||
6
tests/types/result/family_secret_manager/variables.json
Normal file
6
tests/types/result/family_secret_manager/variables.json
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"ns2.secret1.a_variable": "my_value",
|
||||||
|
"ns2.secret1.secret": null,
|
||||||
|
"ns2.secret2.a_variable": "my_value",
|
||||||
|
"ns2.secret2.secret": null
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"ns2.secret1.a_variable": "my_value",
|
||||||
|
"ns2.secret1.secret": null,
|
||||||
|
"ns2.secret2.a_variable": "my_value",
|
||||||
|
"ns2.secret2.secret": null
|
||||||
|
}
|
||||||
|
|
@ -9,17 +9,17 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_3 = StrOption(name="a_first_variable", doc="a first variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml'], 'type': 'string'})
|
option_4 = StrOption(name="a_first_variable", doc="a first variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml'], 'type': 'string'})
|
||||||
option_5 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml'], 'type': 'string'})
|
option_6 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_4 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_5], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
optiondescription_5 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_6], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
||||||
optiondescription_2 = OptionDescription(name="my_family_1", doc="My family type", children=[option_3, optiondescription_4], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
optiondescription_3 = OptionDescription(name="my_family_1", doc="My family type", children=[option_4, optiondescription_5], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
||||||
option_7 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml'], 'type': 'string'})
|
option_8 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml'], 'type': 'string'})
|
||||||
option_9 = StrOption(name="a_second_variable", doc="a second variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml'], 'type': 'string'})
|
option_10 = StrOption(name="a_second_variable", doc="a second variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_8 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_9], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
optiondescription_9 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_10], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
||||||
optiondescription_6 = OptionDescription(name="my_family_2", doc="My family type", children=[option_7, optiondescription_8], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
optiondescription_7 = OptionDescription(name="my_family_2", doc="My family type", children=[option_8, optiondescription_9], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
||||||
option_11 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml'], 'type': 'string'})
|
option_12 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml'], 'type': 'string'})
|
||||||
option_13 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value 2", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml'], 'type': 'string'})
|
option_14 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value 2", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_12 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_13], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
optiondescription_13 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_14], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
||||||
optiondescription_10 = OptionDescription(name="my_family_3", doc="My family type", children=[option_11, optiondescription_12], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
optiondescription_11 = OptionDescription(name="my_family_3", doc="My family type", children=[option_12, optiondescription_13], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
||||||
optiondescription_1 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_2, optiondescription_6, optiondescription_10], properties=frozenset({"basic"}))
|
optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_3, optiondescription_7, optiondescription_11], properties=frozenset({"basic"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2])
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ option_10 = StrOption(name="a_second_variable", doc="a second variable", propert
|
||||||
optiondescription_9 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_10], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
optiondescription_9 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_10], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
||||||
optiondescription_7 = OptionDescription(name="my_family_2", doc="My family type", children=[option_8, optiondescription_9], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
optiondescription_7 = OptionDescription(name="my_family_2", doc="My family type", children=[option_8, optiondescription_9], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
||||||
option_12 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
option_12 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
||||||
option_14 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value 2", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
option_13 = StrOption(name="a_new_variable", doc="a_new_variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_13 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_14], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
option_15 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value 2", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
||||||
option_15 = StrOption(name="a_new_variable", doc="a_new_variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
optiondescription_14 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_15], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
||||||
optiondescription_11 = OptionDescription(name="my_family_3", doc="My family type", children=[option_12, optiondescription_13, option_15], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
optiondescription_11 = OptionDescription(name="my_family_3", doc="My family type", children=[option_12, option_13, optiondescription_14], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_7, optiondescription_11])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_7, optiondescription_11])
|
||||||
|
|
|
||||||
|
|
@ -9,20 +9,20 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_3 = StrOption(name="a_first_variable", doc="a first variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
option_4 = StrOption(name="a_first_variable", doc="a first variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
||||||
option_5 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
option_6 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_4 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_5], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
optiondescription_5 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_6], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
||||||
option_7 = StrOption(name="a_second_variable", doc="a_second_variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
option_8 = StrOption(name="a_second_variable", doc="a_second_variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_6 = OptionDescription(name="a_new_subfamily", doc="a_new_subfamily", children=[option_7], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/structures/family_subfamily_add/00_structure.yml']})
|
optiondescription_7 = OptionDescription(name="a_new_subfamily", doc="a_new_subfamily", children=[option_8], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/structures/family_subfamily_add/00_structure.yml']})
|
||||||
optiondescription_2 = OptionDescription(name="my_family_1", doc="My family type", children=[option_3, optiondescription_4, optiondescription_6], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
optiondescription_3 = OptionDescription(name="my_family_1", doc="My family type", children=[option_4, optiondescription_5, optiondescription_7], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
||||||
option_9 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
option_10 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
||||||
option_11 = StrOption(name="a_second_variable", doc="a second variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
option_12 = StrOption(name="a_second_variable", doc="a second variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_10 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_11], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
optiondescription_11 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_12], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
||||||
optiondescription_8 = OptionDescription(name="my_family_2", doc="My family type", children=[option_9, optiondescription_10], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
optiondescription_9 = OptionDescription(name="my_family_2", doc="My family type", children=[option_10, optiondescription_11], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
||||||
option_13 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
option_14 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
||||||
option_15 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value 2", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
option_15 = StrOption(name="a_new_variable", doc="a_new_variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_14 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_15], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
option_17 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value 2", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
||||||
option_16 = StrOption(name="a_new_variable", doc="a_new_variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/structures/family_subfamily_add/00_structure.yml'], 'type': 'string'})
|
optiondescription_16 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_17], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
||||||
optiondescription_12 = OptionDescription(name="my_family_3", doc="My family type", children=[option_13, optiondescription_14, option_16], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
optiondescription_13 = OptionDescription(name="my_family_3", doc="My family type", children=[option_14, option_15, optiondescription_16], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily_add/00_structure.yml', 'tests/types/structures/family_subfamily_add/00_structure.yml']})
|
||||||
optiondescription_1 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_2, optiondescription_8, optiondescription_12], properties=frozenset({"basic"}))
|
optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_3, optiondescription_9, optiondescription_13], properties=frozenset({"basic"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2])
|
||||||
|
|
|
||||||
|
|
@ -9,26 +9,26 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_4 = StrOption(name="a_leader", doc="My first variable", multi=True, default=["a value"], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
option_5 = StrOption(name="a_leader", doc="My first variable", multi=True, default=["a value"], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
||||||
option_5 = StrOption(name="a_first_follower", doc="My second variable", multi=True, default_multi="an other value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
option_6 = StrOption(name="a_first_follower", doc="My second variable", multi=True, default_multi="an other value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
||||||
option_6 = StrOption(name="a_second_follower", doc="My third variable", multi=True, default_multi="again an other value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
option_7 = StrOption(name="a_second_follower", doc="My third variable", multi=True, default_multi="again an other value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_3 = Leadership(name="my_leadership", doc="my_leadership", children=[option_4, option_5, option_6], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
optiondescription_4 = Leadership(name="my_leadership", doc="my_leadership", children=[option_5, option_6, option_7], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
||||||
optiondescription_2 = OptionDescription(name="my_leadership_1", doc="My family type", children=[optiondescription_3], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
optiondescription_3 = OptionDescription(name="my_leadership_1", doc="My family type", children=[optiondescription_4], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
||||||
option_9 = StrOption(name="a_leader", doc="My first variable", multi=True, default=["a value"], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
option_10 = StrOption(name="a_leader", doc="My first variable", multi=True, default=["a value"], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
||||||
option_10 = StrOption(name="a_first_follower", doc="My second variable", multi=True, default_multi="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
option_11 = StrOption(name="a_first_follower", doc="My second variable", multi=True, default_multi="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
||||||
option_11 = StrOption(name="a_second_follower", doc="My third variable", multi=True, default_multi="again an other value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
option_12 = StrOption(name="a_second_follower", doc="My third variable", multi=True, default_multi="again an other value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_8 = Leadership(name="my_leadership", doc="my_leadership", children=[option_9, option_10, option_11], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
optiondescription_9 = Leadership(name="my_leadership", doc="my_leadership", children=[option_10, option_11, option_12], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
||||||
optiondescription_7 = OptionDescription(name="my_leadership_2", doc="My family type", children=[optiondescription_8], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
optiondescription_8 = OptionDescription(name="my_leadership_2", doc="My family type", children=[optiondescription_9], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
||||||
option_14 = StrOption(name="a_leader", doc="My first variable", multi=True, default=["a value"], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
option_15 = StrOption(name="a_leader", doc="My first variable", multi=True, default=["a value"], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
||||||
option_15 = StrOption(name="a_first_follower", doc="My second variable", multi=True, default_multi="an other value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
option_16 = StrOption(name="a_first_follower", doc="My second variable", multi=True, default_multi="an other value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
||||||
option_16 = StrOption(name="a_second_follower", doc="My third variable", multi=True, default_multi="again an other value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
option_17 = StrOption(name="a_second_follower", doc="My third variable", multi=True, default_multi="again an other value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
||||||
option_17 = StrOption(name="a_new_follower", doc="a description", multi=True, default_multi="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
option_18 = StrOption(name="a_new_follower", doc="a description", multi=True, default_multi="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_13 = Leadership(name="my_leadership", doc="my_leadership", children=[option_14, option_15, option_16, option_17], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
optiondescription_14 = Leadership(name="my_leadership", doc="my_leadership", children=[option_15, option_16, option_17, option_18], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
||||||
optiondescription_12 = OptionDescription(name="my_leadership_3", doc="My family type", children=[optiondescription_13], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
optiondescription_13 = OptionDescription(name="my_leadership_3", doc="My family type", children=[optiondescription_14], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
||||||
option_20 = StrOption(name="a_leader", doc="a description", multi=True, default=["a value leader", "a second leader"], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
option_21 = StrOption(name="a_leader", doc="a description", multi=True, default=["a value leader", "a second leader"], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
||||||
option_21 = StrOption(name="a_first_follower", doc="My second variable", multi=True, default_multi="an other value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
option_22 = StrOption(name="a_first_follower", doc="My second variable", multi=True, default_multi="an other value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
||||||
option_22 = StrOption(name="a_second_follower", doc="My third variable", multi=True, default_multi="again an other value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
option_23 = StrOption(name="a_second_follower", doc="My third variable", multi=True, default_multi="again an other value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_19 = Leadership(name="my_leadership", doc="my_leadership", children=[option_20, option_21, option_22], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
optiondescription_20 = Leadership(name="my_leadership", doc="my_leadership", children=[option_21, option_22, option_23], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
||||||
optiondescription_18 = OptionDescription(name="my_leadership_4", doc="My family type", children=[optiondescription_19], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
optiondescription_19 = OptionDescription(name="my_leadership_4", doc="My family type", children=[optiondescription_20], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/leadership/00_type.yml', 'tests/types/structures/leadership/00_structure.yml']})
|
||||||
optiondescription_1 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_2, optiondescription_7, optiondescription_12, optiondescription_18], properties=frozenset({"standard"}))
|
optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_3, optiondescription_8, optiondescription_13, optiondescription_19], properties=frozenset({"standard"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2])
|
||||||
|
|
|
||||||
14
tests/types/result/secret_manager/namespace_tiramisu.py
Normal file
14
tests/types/result/secret_manager/namespace_tiramisu.py
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
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
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_1 = PasswordOption(name="secret1", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/secret_manager/00-base.yml', 'tests/types/structures/secret_manager/00-base.yml'], 'type': 'secret'})
|
||||||
|
option_2 = PasswordOption(name="secret2", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/secret_manager/00-base.yml', 'tests/types/structures/secret_manager/00-base.yml'], 'type': 'secret'})
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"secret1": null,
|
||||||
|
"secret2": null
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"secret1": null,
|
||||||
|
"secret2": null
|
||||||
|
}
|
||||||
15
tests/types/result/secret_manager/tiramisu.py
Normal file
15
tests/types/result/secret_manager/tiramisu.py
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
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
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = PasswordOption(name="secret1", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/secret_manager/00-base.yml', 'tests/types/structures/secret_manager/00-base.yml'], 'type': 'secret'})
|
||||||
|
option_4 = PasswordOption(name="secret2", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/secret_manager/00-base.yml', 'tests/types/structures/secret_manager/00-base.yml'], 'type': 'secret'})
|
||||||
|
optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2])
|
||||||
4
tests/types/result/secret_manager/variables.json
Normal file
4
tests/types/result/secret_manager/variables.json
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"ns2.secret1": null,
|
||||||
|
"ns2.secret2": null
|
||||||
|
}
|
||||||
4
tests/types/result/secret_manager/variables_rw.json
Normal file
4
tests/types/result/secret_manager/variables_rw.json
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"ns2.secret1": null,
|
||||||
|
"ns2.secret2": null
|
||||||
|
}
|
||||||
|
|
@ -9,6 +9,6 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_2 = StrOption(name="my_var", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/variable/00_type.yml', 'tests/types/structures/variable/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)})
|
option_3 = StrOption(name="my_var", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/variable/00_type.yml', 'tests/types/structures/variable/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)})
|
||||||
optiondescription_1 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[option_2], properties=frozenset({"standard"}))
|
optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2])
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,14 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_3 = StrOption(name="a_first_variable", doc="a first variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml'], 'type': 'string'})
|
option_4 = StrOption(name="a_first_variable", doc="a first variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml'], 'type': 'string'})
|
||||||
option_4 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value", properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_3), 'prop': ParamValue("hidden"), 'when': ParamValue("a value"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property']), Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_3), 'prop': ParamValue("frozen"), 'when': ParamValue("a value"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml'], 'type': 'string'})
|
option_5 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value", properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_4), 'prop': ParamValue("hidden"), 'when': ParamValue("a value"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property']), Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_4), 'prop': ParamValue("frozen"), 'when': ParamValue("a value"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_2 = OptionDescription(name="my_family_1", doc="My family type", children=[option_3, option_4], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml']})
|
optiondescription_3 = OptionDescription(name="my_family_1", doc="My family type", children=[option_4, option_5], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml']})
|
||||||
option_6 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml'], 'type': 'string'})
|
option_7 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml'], 'type': 'string'})
|
||||||
option_7 = StrOption(name="a_second_variable", doc="a second variable", properties=frozenset({"basic", "force_default_on_freeze", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("hidden"), 'when': ParamValue("a value"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property']), Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_6), 'prop': ParamValue("frozen"), 'when': ParamValue("a value"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml'], 'type': 'string'})
|
option_8 = StrOption(name="a_second_variable", doc="a second variable", properties=frozenset({"basic", "force_default_on_freeze", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_7), 'prop': ParamValue("hidden"), 'when': ParamValue("a value"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property']), Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_7), 'prop': ParamValue("frozen"), 'when': ParamValue("a value"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_5 = OptionDescription(name="my_family_2", doc="My family type", children=[option_6, option_7], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml']})
|
optiondescription_6 = OptionDescription(name="my_family_2", doc="My family type", children=[option_7, option_8], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml']})
|
||||||
option_9 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml'], 'type': 'string'})
|
option_10 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml'], 'type': 'string'})
|
||||||
option_10 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value 2", properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_9), 'prop': ParamValue("hidden"), 'when': ParamValue("a value"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property']), Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_9), 'prop': ParamValue("frozen"), 'when': ParamValue("a value"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml'], 'type': 'string'})
|
option_11 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value 2", properties=frozenset({"force_default_on_freeze", "mandatory", "standard", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_10), 'prop': ParamValue("hidden"), 'when': ParamValue("a value"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property']), Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamOption(option_10), 'prop': ParamValue("frozen"), 'when': ParamValue("a value"), 'inverse': ParamValue(True)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_8 = OptionDescription(name="my_family_3", doc="My family type", children=[option_9, option_10], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml']})
|
optiondescription_9 = OptionDescription(name="my_family_3", doc="My family type", children=[option_10, option_11], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/variable_hidden/00_structure.yml', 'tests/types/structures/variable_hidden/00_structure.yml']})
|
||||||
optiondescription_1 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_2, optiondescription_5, optiondescription_8], properties=frozenset({"basic"}))
|
optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_3, optiondescription_6, optiondescription_9], properties=frozenset({"basic"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2])
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_2 = StrOption(name="my_var1", doc="My type", default="a value", properties=frozenset({"an_other_tag", "mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/variables/00_type.yml', 'tests/types/structures/variables/00_structure.yml'], 'type': 'string', 'tags': ('an_other_tag',)})
|
option_3 = StrOption(name="my_var1", doc="My type", default="a value", properties=frozenset({"an_other_tag", "mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/variables/00_type.yml', 'tests/types/structures/variables/00_structure.yml'], 'type': 'string', 'tags': ('an_other_tag',)})
|
||||||
option_3 = StrOption(name="my_var2", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/variables/00_type.yml', 'tests/types/structures/variables/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)})
|
option_4 = StrOption(name="my_var2", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/variables/00_type.yml', 'tests/types/structures/variables/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)})
|
||||||
option_4 = StrOption(name="my_var3", doc="my_var3", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tests/types/structures/variables/00_structure.yml'], 'type': 'string'})
|
option_5 = StrOption(name="my_var3", doc="my_var3", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tests/types/structures/variables/00_structure.yml'], 'type': 'string'})
|
||||||
optiondescription_1 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[option_2, option_3, option_4], properties=frozenset({"basic"}))
|
optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[option_3, option_4, option_5], properties=frozenset({"basic"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2])
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
my_var:
|
||||||
|
type: my_type
|
||||||
|
description: My type
|
||||||
|
...
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
my_family_1:
|
||||||
|
type: my_family_type
|
||||||
|
|
||||||
|
a_first_variable: a modified value
|
||||||
|
|
||||||
|
a_second_variable: a modified value
|
||||||
|
|
||||||
|
my_family_2:
|
||||||
|
type: family
|
||||||
|
|
||||||
|
my_family_3:
|
||||||
|
type: my_family_type
|
||||||
|
|
||||||
|
a_second_variable: a modified value 2
|
||||||
|
...
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
my_family_2:
|
||||||
|
type: my_family_type
|
||||||
|
...
|
||||||
10
tests/types/structures/family_secret_manager/00-base.yml
Normal file
10
tests/types/structures/family_secret_manager/00-base.yml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
secret1:
|
||||||
|
type: family_secret
|
||||||
|
|
||||||
|
secret2:
|
||||||
|
type: family_secret
|
||||||
|
...
|
||||||
10
tests/types/structures/secret_manager/00-base.yml
Normal file
10
tests/types/structures/secret_manager/00-base.yml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
secret1:
|
||||||
|
type: secret
|
||||||
|
|
||||||
|
secret2:
|
||||||
|
type: secret
|
||||||
|
...
|
||||||
10
tests/types/types/error_variable_redefine/00_type.yml
Normal file
10
tests/types/types/error_variable_redefine/00_type.yml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
my_type:
|
||||||
|
description: My type
|
||||||
|
default: a value
|
||||||
|
tags:
|
||||||
|
- one_tag
|
||||||
|
...
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
my_family_type: # My family type
|
||||||
|
|
||||||
|
a_first_variable: a value # a first variable
|
||||||
|
|
||||||
|
a_second_variable: # a second variable
|
||||||
|
...
|
||||||
13
tests/types/types/family_secret_manager/00-base.yml
Normal file
13
tests/types/types/family_secret_manager/00-base.yml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
family_secret: # Family with secret
|
||||||
|
|
||||||
|
a_variable: my_value # A variable
|
||||||
|
|
||||||
|
secret:
|
||||||
|
description: the secret
|
||||||
|
type: secret
|
||||||
|
secret_manager:
|
||||||
|
project:
|
||||||
|
variable: _.a_variable
|
||||||
8
tests/types/types/secret_manager/00-base.yml
Normal file
8
tests/types/types/secret_manager/00-base.yml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
|
||||||
|
secret:
|
||||||
|
description: the secret
|
||||||
|
type: secret
|
||||||
|
secret_manager:
|
||||||
|
project: test
|
||||||
Loading…
Reference in a new issue