loads multipe machine for one config
This commit is contained in:
parent
a058d4a20d
commit
f6143e843c
638 changed files with 18243 additions and 5086 deletions
|
@ -100,7 +100,7 @@ Dans ce cas, tous les services et les éléments qu'il compose avec un attribut
|
||||||
|
|
||||||
La désactivation du service va créé un lien symbolique vers /dev/null.
|
La désactivation du service va créé un lien symbolique vers /dev/null.
|
||||||
|
|
||||||
Si vous ne voulez juste pas créé le fichier de service et ne pas faire de lien symbolique, il faut utiliser l'attribut undisable :
|
Si vous ne voulez juste pas créer le fichier de service et ne pas faire de lien symbolique, il faut utiliser l'attribut undisable :
|
||||||
|
|
||||||
```
|
```
|
||||||
<service name="test" disabled="True" undisable="True"/>
|
<service name="test" disabled="True" undisable="True"/>
|
||||||
|
|
|
@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
"""
|
"""
|
||||||
from .variable import CONVERT_OPTION
|
from .variable import CONVERT_OPTION
|
||||||
import importlib.resources
|
import importlib.resources
|
||||||
from os.path import dirname, join
|
from os.path import dirname, join, isfile
|
||||||
from ..utils import load_modules
|
from ..utils import load_modules
|
||||||
|
|
||||||
|
|
||||||
|
@ -83,7 +83,8 @@ class SpaceAnnotator: # pylint: disable=R0903
|
||||||
annotators = sorted(annotators, key=get_level)
|
annotators = sorted(annotators, key=get_level)
|
||||||
functions = []
|
functions = []
|
||||||
for eosfunc_file in eosfunc_files:
|
for eosfunc_file in eosfunc_files:
|
||||||
functions.extend(dir(load_modules(eosfunc_file)))
|
if isfile(eosfunc_file):
|
||||||
|
functions.extend(dir(load_modules(eosfunc_file)))
|
||||||
for annotator in annotators:
|
for annotator in annotators:
|
||||||
annotator(objectspace,
|
annotator(objectspace,
|
||||||
functions,
|
functions,
|
||||||
|
|
|
@ -44,30 +44,31 @@ class Annotator(TargetAnnotator, ParamAnnotator):
|
||||||
functions,
|
functions,
|
||||||
*args,
|
*args,
|
||||||
):
|
):
|
||||||
if not hasattr(objectspace.space, 'constraints') or \
|
|
||||||
not hasattr(objectspace.space.constraints, 'check'):
|
|
||||||
return
|
|
||||||
self.objectspace = objectspace
|
self.objectspace = objectspace
|
||||||
self.let_none = True
|
|
||||||
self.only_variable = True
|
self.only_variable = True
|
||||||
|
self.target_is_uniq = False
|
||||||
|
self.allow_function = True
|
||||||
self.functions = copy(functions)
|
self.functions = copy(functions)
|
||||||
self.functions.extend(INTERNAL_FUNCTIONS)
|
self.functions.extend(INTERNAL_FUNCTIONS)
|
||||||
self.functions.extend(self.objectspace.rougailconfig['internal_functions'])
|
self.functions.extend(self.objectspace.rougailconfig['internal_functions'])
|
||||||
self.target_is_uniq = False
|
for path_prefix, constraints in self.get_constraints():
|
||||||
self.allow_function = True
|
if not hasattr(constraints, 'check'):
|
||||||
self.convert_target(self.objectspace.space.constraints.check)
|
continue
|
||||||
self.convert_param(self.objectspace.space.constraints.check)
|
self.convert_target(constraints.check, path_prefix)
|
||||||
self.check_check()
|
self.convert_param(constraints.check, path_prefix)
|
||||||
self.check_change_warning()
|
self.check_check(constraints)
|
||||||
self.convert_valid_entier()
|
self.check_change_warning(constraints)
|
||||||
self.convert_check()
|
self.convert_valid_entier(constraints)
|
||||||
del objectspace.space.constraints.check
|
self.convert_check(constraints)
|
||||||
|
del constraints.check
|
||||||
|
|
||||||
def check_check(self): # pylint: disable=R0912
|
def check_check(self,
|
||||||
|
constraints,
|
||||||
|
): # pylint: disable=R0912
|
||||||
"""valid and manage <check>
|
"""valid and manage <check>
|
||||||
"""
|
"""
|
||||||
remove_indexes = []
|
remove_indexes = []
|
||||||
for check_idx, check in enumerate(self.objectspace.space.constraints.check):
|
for check_idx, check in enumerate(constraints.check):
|
||||||
if not check.name in self.functions:
|
if not check.name in self.functions:
|
||||||
msg = _(f'cannot find check function "{check.name}"')
|
msg = _(f'cannot find check function "{check.name}"')
|
||||||
raise DictConsistencyError(msg, 1, check.xmlfiles)
|
raise DictConsistencyError(msg, 1, check.xmlfiles)
|
||||||
|
@ -75,20 +76,24 @@ class Annotator(TargetAnnotator, ParamAnnotator):
|
||||||
remove_indexes.append(check_idx)
|
remove_indexes.append(check_idx)
|
||||||
remove_indexes.sort(reverse=True)
|
remove_indexes.sort(reverse=True)
|
||||||
for idx in remove_indexes:
|
for idx in remove_indexes:
|
||||||
del self.objectspace.space.constraints.check[idx]
|
del constraints.check[idx]
|
||||||
|
|
||||||
def check_change_warning(self):
|
def check_change_warning(self,
|
||||||
|
constraints,
|
||||||
|
):
|
||||||
"""convert level to "warnings_only"
|
"""convert level to "warnings_only"
|
||||||
"""
|
"""
|
||||||
for check in self.objectspace.space.constraints.check:
|
for check in constraints.check:
|
||||||
check.warnings_only = check.level == 'warning'
|
check.warnings_only = check.level == 'warning'
|
||||||
check.level = None
|
check.level = None
|
||||||
|
|
||||||
def convert_valid_entier(self) -> None:
|
def convert_valid_entier(self,
|
||||||
|
constraints,
|
||||||
|
) -> None:
|
||||||
"""valid and manage <check>
|
"""valid and manage <check>
|
||||||
"""
|
"""
|
||||||
remove_indexes = []
|
remove_indexes = []
|
||||||
for check_idx, check in enumerate(self.objectspace.space.constraints.check):
|
for check_idx, check in enumerate(constraints.check):
|
||||||
if not check.name == 'valid_entier':
|
if not check.name == 'valid_entier':
|
||||||
continue
|
continue
|
||||||
remove_indexes.append(check_idx)
|
remove_indexes.append(check_idx)
|
||||||
|
@ -111,12 +116,14 @@ class Annotator(TargetAnnotator, ParamAnnotator):
|
||||||
raise DictConsistencyError(msg, 19, check.xmlfiles)
|
raise DictConsistencyError(msg, 19, check.xmlfiles)
|
||||||
remove_indexes.sort(reverse=True)
|
remove_indexes.sort(reverse=True)
|
||||||
for idx in remove_indexes:
|
for idx in remove_indexes:
|
||||||
del self.objectspace.space.constraints.check[idx]
|
del constraints.check[idx]
|
||||||
|
|
||||||
def convert_check(self) -> None:
|
def convert_check(self,
|
||||||
|
constraints,
|
||||||
|
) -> None:
|
||||||
"""valid and manage <check>
|
"""valid and manage <check>
|
||||||
"""
|
"""
|
||||||
for check in self.objectspace.space.constraints.check:
|
for check in constraints.check:
|
||||||
for target in check.target:
|
for target in check.target:
|
||||||
if not hasattr(target.name, 'validators'):
|
if not hasattr(target.name, 'validators'):
|
||||||
target.name.validators = []
|
target.name.validators = []
|
||||||
|
|
|
@ -44,24 +44,24 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk):
|
||||||
*args,
|
*args,
|
||||||
):
|
):
|
||||||
self.objectspace = objectspace
|
self.objectspace = objectspace
|
||||||
self.force_service_value = {}
|
|
||||||
if hasattr(objectspace.space, 'variables'):
|
|
||||||
self.convert_auto_freeze()
|
|
||||||
if not hasattr(objectspace.space, 'constraints') or \
|
|
||||||
not hasattr(self.objectspace.space.constraints, 'condition'):
|
|
||||||
return
|
|
||||||
self.target_is_uniq = False
|
self.target_is_uniq = False
|
||||||
self.only_variable = False
|
self.only_variable = False
|
||||||
self.allow_function = False
|
self.allow_function = False
|
||||||
self.convert_target(self.objectspace.space.constraints.condition)
|
self.force_service_value = {}
|
||||||
self.check_condition_optional()
|
if hasattr(objectspace.space, 'variables'):
|
||||||
self.convert_condition_source()
|
self.convert_auto_freeze()
|
||||||
self.convert_param(self.objectspace.space.constraints.condition)
|
for path_prefix, constraints in self.get_constraints():
|
||||||
self.check_source_target()
|
if not hasattr(constraints, 'condition'):
|
||||||
self.convert_xxxlist()
|
continue
|
||||||
self.check_choice_option_condition()
|
self.convert_target(constraints.condition, path_prefix)
|
||||||
self.remove_condition_with_empty_target()
|
self.check_condition_optional(constraints, path_prefix)
|
||||||
self.convert_condition()
|
self.convert_condition_source(constraints, path_prefix)
|
||||||
|
self.convert_param(constraints.condition, path_prefix)
|
||||||
|
self.check_source_target(constraints)
|
||||||
|
self.convert_xxxlist(constraints, path_prefix)
|
||||||
|
self.check_choice_option_condition(constraints, path_prefix)
|
||||||
|
self.remove_condition_with_empty_target(constraints)
|
||||||
|
self.convert_condition(constraints, path_prefix)
|
||||||
|
|
||||||
def valid_type_validation(self,
|
def valid_type_validation(self,
|
||||||
obj,
|
obj,
|
||||||
|
@ -84,7 +84,10 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk):
|
||||||
if variable.auto_save:
|
if variable.auto_save:
|
||||||
continue
|
continue
|
||||||
auto_freeze_variable = self.objectspace.rougailconfig['auto_freeze_variable']
|
auto_freeze_variable = self.objectspace.rougailconfig['auto_freeze_variable']
|
||||||
if not self.objectspace.paths.path_is_defined(auto_freeze_variable):
|
if not self.objectspace.paths.path_is_defined(auto_freeze_variable,
|
||||||
|
self.objectspace.rougailconfig['variable_namespace'],
|
||||||
|
variable.path_prefix,
|
||||||
|
):
|
||||||
msg = _(f'the variable "{variable.name}" is auto_freeze but there is no variable "{auto_freeze_variable}"')
|
msg = _(f'the variable "{variable.name}" is auto_freeze but there is no variable "{auto_freeze_variable}"')
|
||||||
raise DictConsistencyError(msg, 81, variable.xmlfiles)
|
raise DictConsistencyError(msg, 81, variable.xmlfiles)
|
||||||
new_condition = self.objectspace.condition(variable.xmlfiles)
|
new_condition = self.objectspace.condition(variable.xmlfiles)
|
||||||
|
@ -96,18 +99,22 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk):
|
||||||
new_condition.param = [new_param]
|
new_condition.param = [new_param]
|
||||||
new_target = self.objectspace.target(variable.xmlfiles)
|
new_target = self.objectspace.target(variable.xmlfiles)
|
||||||
new_target.type = 'variable'
|
new_target.type = 'variable'
|
||||||
new_target.name = variable.path
|
path = variable.path
|
||||||
|
if variable.path_prefix:
|
||||||
|
path = path.split('.', 1)[-1]
|
||||||
|
new_target.name = path
|
||||||
new_condition.target = [new_target]
|
new_condition.target = [new_target]
|
||||||
if not hasattr(self.objectspace.space, 'constraints'):
|
path_prefix, constraints = next(self.get_constraints(create=True,
|
||||||
self.objectspace.space.constraints = self.objectspace.constraints(variable.xmlfiles)
|
path_prefix=variable.path_prefix,
|
||||||
if not hasattr(self.objectspace.space.constraints, 'condition'):
|
))
|
||||||
self.objectspace.space.constraints.condition = []
|
if not hasattr(constraints, 'condition'):
|
||||||
self.objectspace.space.constraints.condition.append(new_condition)
|
constraints.condition = []
|
||||||
|
constraints.condition.append(new_condition)
|
||||||
|
|
||||||
def check_source_target(self):
|
def check_source_target(self, constraints):
|
||||||
"""verify that source != target in condition
|
"""verify that source != target in condition
|
||||||
"""
|
"""
|
||||||
for condition in self.objectspace.space.constraints.condition:
|
for condition in constraints.condition:
|
||||||
for target in condition.target:
|
for target in condition.target:
|
||||||
if target.type == 'variable' and \
|
if target.type == 'variable' and \
|
||||||
condition.source.path == target.name.path:
|
condition.source.path == target.name.path:
|
||||||
|
@ -115,25 +122,34 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk):
|
||||||
f'{condition.source.path}')
|
f'{condition.source.path}')
|
||||||
raise DictConsistencyError(msg, 11, condition.xmlfiles)
|
raise DictConsistencyError(msg, 11, condition.xmlfiles)
|
||||||
|
|
||||||
def check_condition_optional(self):
|
def check_condition_optional(self,
|
||||||
|
constraints,
|
||||||
|
path_prefix,
|
||||||
|
):
|
||||||
"""a condition with a optional **and** the source variable doesn't exist
|
"""a condition with a optional **and** the source variable doesn't exist
|
||||||
"""
|
"""
|
||||||
remove_conditions = []
|
remove_conditions = []
|
||||||
for idx, condition in enumerate(self.objectspace.space.constraints.condition):
|
for idx, condition in enumerate(constraints.condition):
|
||||||
if condition.optional is False or \
|
if condition.optional is False or \
|
||||||
self.objectspace.paths.path_is_defined(condition.source):
|
self.objectspace.paths.path_is_defined(condition.source,
|
||||||
|
condition.namespace,
|
||||||
|
path_prefix,
|
||||||
|
):
|
||||||
continue
|
continue
|
||||||
remove_conditions.append(idx)
|
remove_conditions.append(idx)
|
||||||
if (hasattr(condition, 'apply_on_fallback') and condition.apply_on_fallback) or \
|
if (hasattr(condition, 'apply_on_fallback') and condition.apply_on_fallback) or \
|
||||||
(not hasattr(condition, 'apply_on_fallback') and \
|
(not hasattr(condition, 'apply_on_fallback') and \
|
||||||
condition.name.endswith('_if_in')):
|
condition.name.endswith('_if_in')):
|
||||||
self.force_actions_to_variable(condition)
|
self.force_actions_to_variable(condition,
|
||||||
|
path_prefix,
|
||||||
|
)
|
||||||
remove_conditions.sort(reverse=True)
|
remove_conditions.sort(reverse=True)
|
||||||
for idx in remove_conditions:
|
for idx in remove_conditions:
|
||||||
self.objectspace.space.constraints.condition.pop(idx)
|
constraints.condition.pop(idx)
|
||||||
|
|
||||||
def force_actions_to_variable(self,
|
def force_actions_to_variable(self,
|
||||||
condition: 'self.objectspace.condition',
|
condition: 'self.objectspace.condition',
|
||||||
|
path_prefix,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""force property to a variable
|
"""force property to a variable
|
||||||
for example disabled_if_not_in => variable.disabled = True
|
for example disabled_if_not_in => variable.disabled = True
|
||||||
|
@ -144,7 +160,9 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk):
|
||||||
if target.type.endswith('list'):
|
if target.type.endswith('list'):
|
||||||
self.force_service_value[target.name] = main_action != 'disabled'
|
self.force_service_value[target.name] = main_action != 'disabled'
|
||||||
continue
|
continue
|
||||||
leader_or_var, variables = self._get_family_variables_from_target(target)
|
leader_or_var, variables = self._get_family_variables_from_target(target,
|
||||||
|
path_prefix,
|
||||||
|
)
|
||||||
setattr(leader_or_var, main_action, True)
|
setattr(leader_or_var, main_action, True)
|
||||||
for action in actions[1:]:
|
for action in actions[1:]:
|
||||||
for variable in variables:
|
for variable in variables:
|
||||||
|
@ -162,35 +180,41 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk):
|
||||||
|
|
||||||
def _get_family_variables_from_target(self,
|
def _get_family_variables_from_target(self,
|
||||||
target,
|
target,
|
||||||
|
path_prefix,
|
||||||
):
|
):
|
||||||
if target.type == 'variable':
|
if target.type == 'variable':
|
||||||
if not self.objectspace.paths.is_leader(target.name.path):
|
if not self.objectspace.paths.is_leader(target.name):
|
||||||
return target.name, [target.name]
|
return target.name, [target.name]
|
||||||
# it's a leader, so apply property to leadership
|
# it's a leader, so apply property to leadership
|
||||||
family_name = self.objectspace.paths.get_variable_family_path(target.name.path)
|
|
||||||
namespace = target.name.namespace
|
namespace = target.name.namespace
|
||||||
|
family_name = self.objectspace.paths.get_variable_family_path(target.name.path,
|
||||||
|
namespace,
|
||||||
|
force_path_prefix=path_prefix,
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
family_name = target.name.path
|
family_name = target.name.path
|
||||||
namespace = target.namespace
|
namespace = target.namespace
|
||||||
variable = self.objectspace.paths.get_family(family_name,
|
variable = self.objectspace.paths.get_family(family_name,
|
||||||
namespace,
|
namespace,
|
||||||
|
path_prefix,
|
||||||
)
|
)
|
||||||
if hasattr(variable, 'variable'):
|
if hasattr(variable, 'variable'):
|
||||||
return variable, list(variable.variable.values())
|
return variable, list(variable.variable.values())
|
||||||
return variable, []
|
return variable, []
|
||||||
|
|
||||||
def convert_xxxlist(self):
|
def convert_xxxlist(self, constraints, path_prefix):
|
||||||
"""transform *list to variable or family
|
"""transform *list to variable or family
|
||||||
"""
|
"""
|
||||||
fills = {}
|
fills = {}
|
||||||
for condition in self.objectspace.space.constraints.condition:
|
for condition in constraints.condition:
|
||||||
remove_targets = []
|
remove_targets = []
|
||||||
for target_idx, target in enumerate(condition.target):
|
for target_idx, target in enumerate(condition.target):
|
||||||
if target.type.endswith('list'):
|
if target.type.endswith('list'):
|
||||||
listvars = self.objectspace.list_conditions.get(target.type,
|
listvars = self.objectspace.paths.list_conditions[path_prefix].get(target.type,
|
||||||
{}).get(target.name)
|
{}).get(target.name)
|
||||||
if listvars:
|
if listvars:
|
||||||
self._convert_xxxlist_to_fill(condition,
|
self._convert_xxxlist_to_fill(constraints,
|
||||||
|
condition,
|
||||||
target,
|
target,
|
||||||
listvars,
|
listvars,
|
||||||
fills,
|
fills,
|
||||||
|
@ -204,6 +228,7 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk):
|
||||||
condition.target.pop(target_idx)
|
condition.target.pop(target_idx)
|
||||||
|
|
||||||
def _convert_xxxlist_to_fill(self,
|
def _convert_xxxlist_to_fill(self,
|
||||||
|
constraints,
|
||||||
condition: 'self.objectspace.condition',
|
condition: 'self.objectspace.condition',
|
||||||
target: 'self.objectspace.target',
|
target: 'self.objectspace.target',
|
||||||
listvars: list,
|
listvars: list,
|
||||||
|
@ -211,9 +236,11 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk):
|
||||||
):
|
):
|
||||||
for listvar in listvars:
|
for listvar in listvars:
|
||||||
if target.name in self.force_service_value:
|
if target.name in self.force_service_value:
|
||||||
|
# do not add fill, just change default value
|
||||||
listvar.default = self.force_service_value[target.name]
|
listvar.default = self.force_service_value[target.name]
|
||||||
continue
|
continue
|
||||||
if listvar.path in fills:
|
if listvar.path in fills:
|
||||||
|
# a fill is already set for this path
|
||||||
fill = fills[listvar.path]
|
fill = fills[listvar.path]
|
||||||
or_needed = True
|
or_needed = True
|
||||||
for param in fill.param:
|
for param in fill.param:
|
||||||
|
@ -225,14 +252,17 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk):
|
||||||
else:
|
else:
|
||||||
fill = self.objectspace.fill(target.xmlfiles)
|
fill = self.objectspace.fill(target.xmlfiles)
|
||||||
new_target = self.objectspace.target(target.xmlfiles)
|
new_target = self.objectspace.target(target.xmlfiles)
|
||||||
new_target.name = listvar.path
|
path = listvar.path
|
||||||
|
if listvar.path_prefix:
|
||||||
|
path = path.split('.', 1)[-1]
|
||||||
|
new_target.name = path
|
||||||
fill.target = [new_target]
|
fill.target = [new_target]
|
||||||
fill.name = 'calc_value'
|
fill.name = 'calc_value'
|
||||||
fill.namespace = 'services'
|
fill.namespace = 'services'
|
||||||
fill.index = 0
|
fill.index = 0
|
||||||
if not hasattr(self.objectspace.space.constraints, 'fill'):
|
if not hasattr(constraints, 'fill'):
|
||||||
self.objectspace.space.constraints.fill = []
|
constraints.fill = []
|
||||||
self.objectspace.space.constraints.fill.append(fill)
|
constraints.fill.append(fill)
|
||||||
fills[listvar.path] = fill
|
fills[listvar.path] = fill
|
||||||
param1 = self.objectspace.param(target.xmlfiles)
|
param1 = self.objectspace.param(target.xmlfiles)
|
||||||
param1.text = False
|
param1.text = False
|
||||||
|
@ -255,7 +285,10 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk):
|
||||||
param3 = self.objectspace.param(target.xmlfiles)
|
param3 = self.objectspace.param(target.xmlfiles)
|
||||||
param3.name = f'condition_{fill.index}'
|
param3.name = f'condition_{fill.index}'
|
||||||
param3.type = 'variable'
|
param3.type = 'variable'
|
||||||
param3.text = condition.source.path
|
path = condition.source.path
|
||||||
|
if condition.source.path_prefix:
|
||||||
|
path = path.split('.', 1)[-1]
|
||||||
|
param3.text = path
|
||||||
param3.propertyerror = False
|
param3.propertyerror = False
|
||||||
fill.param.append(param3)
|
fill.param.append(param3)
|
||||||
param4 = self.objectspace.param(target.xmlfiles)
|
param4 = self.objectspace.param(target.xmlfiles)
|
||||||
|
@ -275,12 +308,17 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk):
|
||||||
param6.text = 'OR'
|
param6.text = 'OR'
|
||||||
fill.param.append(param6)
|
fill.param.append(param6)
|
||||||
|
|
||||||
def convert_condition_source(self):
|
def convert_condition_source(self, constraints, path_prefix):
|
||||||
"""remove condition for ChoiceOption that don't have param
|
"""remove condition for ChoiceOption that don't have param
|
||||||
"""
|
"""
|
||||||
for condition in self.objectspace.space.constraints.condition:
|
for condition in constraints.condition:
|
||||||
try:
|
try:
|
||||||
condition.source = self.objectspace.paths.get_variable(condition.source)
|
condition.source = self.objectspace.paths.get_variable(condition.source,
|
||||||
|
condition.namespace,
|
||||||
|
allow_variable_namespace=True,
|
||||||
|
force_path_prefix=path_prefix,
|
||||||
|
add_path_prefix=True,
|
||||||
|
)
|
||||||
except DictConsistencyError as err:
|
except DictConsistencyError as err:
|
||||||
if err.errno == 36:
|
if err.errno == 36:
|
||||||
msg = _(f'the source "{condition.source}" in condition cannot be a dynamic '
|
msg = _(f'the source "{condition.source}" in condition cannot be a dynamic '
|
||||||
|
@ -291,46 +329,58 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk):
|
||||||
raise DictConsistencyError(msg, 23, condition.xmlfiles) from err
|
raise DictConsistencyError(msg, 23, condition.xmlfiles) from err
|
||||||
raise err from err # pragma: no cover
|
raise err from err # pragma: no cover
|
||||||
|
|
||||||
def check_choice_option_condition(self):
|
def check_choice_option_condition(self,
|
||||||
|
constraints,
|
||||||
|
path_prefix,
|
||||||
|
):
|
||||||
"""remove condition of ChoiceOption that doesn't match
|
"""remove condition of ChoiceOption that doesn't match
|
||||||
"""
|
"""
|
||||||
remove_conditions = []
|
remove_conditions = []
|
||||||
for condition_idx, condition in enumerate(self.objectspace.space.constraints.condition):
|
for condition_idx, condition in enumerate(constraints.condition):
|
||||||
if condition.source.path in self.objectspace.valid_enums:
|
if not self.objectspace.paths.has_valid_enums(condition.source.path,
|
||||||
valid_enum = self.objectspace.valid_enums[condition.source.path]['values']
|
condition.source.path_prefix,
|
||||||
remove_param = [param_idx for param_idx, param in enumerate(condition.param) \
|
):
|
||||||
if param.type != 'variable' and param.text not in valid_enum]
|
continue
|
||||||
if not remove_param:
|
valid_enum = self.objectspace.paths.get_valid_enums(condition.source.path,
|
||||||
continue
|
condition.source.path_prefix,
|
||||||
remove_param.sort(reverse=True)
|
)
|
||||||
for idx in remove_param:
|
remove_param = [param_idx for param_idx, param in enumerate(condition.param) \
|
||||||
del condition.param[idx]
|
if param.type != 'variable' and param.text not in valid_enum]
|
||||||
if not condition.param and condition.name.endswith('_if_not_in'):
|
if not remove_param:
|
||||||
self.force_actions_to_variable(condition)
|
continue
|
||||||
remove_conditions.append(condition_idx)
|
remove_param.sort(reverse=True)
|
||||||
|
for idx in remove_param:
|
||||||
|
del condition.param[idx]
|
||||||
|
if not condition.param and condition.name.endswith('_if_not_in'):
|
||||||
|
self.force_actions_to_variable(condition,
|
||||||
|
path_prefix,
|
||||||
|
)
|
||||||
|
remove_conditions.append(condition_idx)
|
||||||
remove_conditions.sort(reverse=True)
|
remove_conditions.sort(reverse=True)
|
||||||
for idx in remove_conditions:
|
for idx in remove_conditions:
|
||||||
self.objectspace.space.constraints.condition.pop(idx)
|
constraints.condition.pop(idx)
|
||||||
|
|
||||||
def remove_condition_with_empty_target(self):
|
def remove_condition_with_empty_target(self, constraints):
|
||||||
"""remove condition with empty target
|
"""remove condition with empty target
|
||||||
"""
|
"""
|
||||||
# optional target are remove, condition could be empty
|
# optional target are remove, condition could be empty
|
||||||
remove_conditions = [condition_idx for condition_idx, condition in \
|
remove_conditions = [condition_idx for condition_idx, condition in \
|
||||||
enumerate(self.objectspace.space.constraints.condition) \
|
enumerate(constraints.condition) \
|
||||||
if not condition.target]
|
if not condition.target]
|
||||||
remove_conditions.sort(reverse=True)
|
remove_conditions.sort(reverse=True)
|
||||||
for idx in remove_conditions:
|
for idx in remove_conditions:
|
||||||
self.objectspace.space.constraints.condition.pop(idx)
|
constraints.condition.pop(idx)
|
||||||
|
|
||||||
def convert_condition(self):
|
def convert_condition(self, constraints, path_prefix):
|
||||||
"""valid and manage <condition>
|
"""valid and manage <condition>
|
||||||
"""
|
"""
|
||||||
for condition in self.objectspace.space.constraints.condition:
|
for condition in constraints.condition:
|
||||||
actions = self.get_actions_from_condition(condition.name)
|
actions = self.get_actions_from_condition(condition.name)
|
||||||
for param in condition.param:
|
for param in condition.param:
|
||||||
for target in condition.target:
|
for target in condition.target:
|
||||||
leader_or_variable, variables = self._get_family_variables_from_target(target)
|
leader_or_variable, variables = self._get_family_variables_from_target(target,
|
||||||
|
path_prefix,
|
||||||
|
)
|
||||||
# if option is already disable, do not apply disable_if_in
|
# if option is already disable, do not apply disable_if_in
|
||||||
# check only the first action (example of multiple actions:
|
# check only the first action (example of multiple actions:
|
||||||
# 'hidden', 'frozen', 'force_default_on_freeze')
|
# 'hidden', 'frozen', 'force_default_on_freeze')
|
||||||
|
|
|
@ -61,6 +61,17 @@ class Annotator(Walk):
|
||||||
self.dynamic_families()
|
self.dynamic_families()
|
||||||
self.convert_help()
|
self.convert_help()
|
||||||
|
|
||||||
|
def remove_empty_families(self) -> None:
|
||||||
|
"""Remove all families without any variable
|
||||||
|
"""
|
||||||
|
removed_families = {}
|
||||||
|
for family, parent in self.get_families(with_parent=True):
|
||||||
|
if isinstance(family, self.objectspace.family) and not self._has_variable(family):
|
||||||
|
removed_families.setdefault(parent, []).append(family)
|
||||||
|
for parent, families in removed_families.items():
|
||||||
|
for family in families:
|
||||||
|
del parent.variable[family.name]
|
||||||
|
|
||||||
def _has_variable(self,
|
def _has_variable(self,
|
||||||
family: 'self.objectspace.family',
|
family: 'self.objectspace.family',
|
||||||
) -> bool:
|
) -> bool:
|
||||||
|
@ -73,18 +84,6 @@ class Annotator(Walk):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def remove_empty_families(self) -> None:
|
|
||||||
"""Remove all families without any variable
|
|
||||||
"""
|
|
||||||
#FIXME pas sous family
|
|
||||||
for families in self.objectspace.space.variables.values():
|
|
||||||
removed_families = []
|
|
||||||
for family_name, family in families.variable.items():
|
|
||||||
if isinstance(family, self.objectspace.family) and not self._has_variable(family):
|
|
||||||
removed_families.append(family_name)
|
|
||||||
for family_name in removed_families:
|
|
||||||
del families.variable[family_name]
|
|
||||||
|
|
||||||
def family_names(self) -> None:
|
def family_names(self) -> None:
|
||||||
"""Set doc, path, ... to family
|
"""Set doc, path, ... to family
|
||||||
"""
|
"""
|
||||||
|
@ -268,7 +267,13 @@ class Annotator(Walk):
|
||||||
for family in self.get_families():
|
for family in self.get_families():
|
||||||
if 'dynamic' not in vars(family):
|
if 'dynamic' not in vars(family):
|
||||||
continue
|
continue
|
||||||
family.suffixes = self.objectspace.paths.get_variable(family.dynamic, family.xmlfiles)
|
family.suffixes = self.objectspace.paths.get_variable(family.dynamic,
|
||||||
|
family.namespace,
|
||||||
|
xmlfiles=family.xmlfiles,
|
||||||
|
allow_variable_namespace=True,
|
||||||
|
force_path_prefix=family.path_prefix,
|
||||||
|
add_path_prefix=True,
|
||||||
|
)
|
||||||
del family.dynamic
|
del family.dynamic
|
||||||
if not family.suffixes.multi:
|
if not family.suffixes.multi:
|
||||||
msg = _(f'dynamic family "{family.name}" must be linked '
|
msg = _(f'dynamic family "{family.name}" must be linked '
|
||||||
|
|
|
@ -44,9 +44,6 @@ class Annotator(TargetAnnotator, ParamAnnotator):
|
||||||
functions,
|
functions,
|
||||||
*args,
|
*args,
|
||||||
):
|
):
|
||||||
if not hasattr(objectspace.space, 'constraints') or \
|
|
||||||
not hasattr(objectspace.space.constraints, 'fill'):
|
|
||||||
return
|
|
||||||
self.objectspace = objectspace
|
self.objectspace = objectspace
|
||||||
self.functions = copy(functions)
|
self.functions = copy(functions)
|
||||||
self.functions.extend(self.objectspace.rougailconfig['internal_functions'])
|
self.functions.extend(self.objectspace.rougailconfig['internal_functions'])
|
||||||
|
@ -55,10 +52,13 @@ class Annotator(TargetAnnotator, ParamAnnotator):
|
||||||
self.target_is_uniq = True
|
self.target_is_uniq = True
|
||||||
self.only_variable = True
|
self.only_variable = True
|
||||||
self.allow_function = False
|
self.allow_function = False
|
||||||
self.convert_target(self.objectspace.space.constraints.fill)
|
for path_prefix, constraints in self.get_constraints():
|
||||||
self.convert_param(self.objectspace.space.constraints.fill)
|
if not hasattr(constraints, 'fill'):
|
||||||
self.fill_to_value()
|
continue
|
||||||
del self.objectspace.space.constraints.fill
|
self.convert_target(constraints.fill, path_prefix)
|
||||||
|
self.convert_param(constraints.fill, path_prefix)
|
||||||
|
self.fill_to_value(constraints)
|
||||||
|
del constraints.fill
|
||||||
|
|
||||||
def calc_is_multi(self, variable: 'self.objectspace.variable') -> bool:
|
def calc_is_multi(self, variable: 'self.objectspace.variable') -> bool:
|
||||||
multi = variable.multi
|
multi = variable.multi
|
||||||
|
@ -66,12 +66,12 @@ class Annotator(TargetAnnotator, ParamAnnotator):
|
||||||
return multi
|
return multi
|
||||||
if multi == 'submulti':
|
if multi == 'submulti':
|
||||||
return True
|
return True
|
||||||
return not self.objectspace.paths.is_follower(variable.path)
|
return not self.objectspace.paths.is_follower(variable)
|
||||||
|
|
||||||
def fill_to_value(self) -> None:
|
def fill_to_value(self, constraints) -> None:
|
||||||
"""valid and manage <fill>
|
"""valid and manage <fill>
|
||||||
"""
|
"""
|
||||||
for fill in self.objectspace.space.constraints.fill:
|
for fill in constraints.fill:
|
||||||
# test if the function exists
|
# test if the function exists
|
||||||
if fill.name not in self.functions:
|
if fill.name not in self.functions:
|
||||||
msg = _(f'cannot find fill function "{fill.name}"')
|
msg = _(f'cannot find fill function "{fill.name}"')
|
||||||
|
|
|
@ -46,7 +46,7 @@ class ParamAnnotator:
|
||||||
"""
|
"""
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def convert_param(self, objects) -> None:
|
def convert_param(self, objects, path_prefix) -> None:
|
||||||
""" valid and convert param
|
""" valid and convert param
|
||||||
"""
|
"""
|
||||||
for obj in objects:
|
for obj in objects:
|
||||||
|
@ -64,27 +64,32 @@ class ParamAnnotator:
|
||||||
msg = _(f'"{param.type}" parameter must not have a value')
|
msg = _(f'"{param.type}" parameter must not have a value')
|
||||||
raise DictConsistencyError(msg, 40, obj.xmlfiles)
|
raise DictConsistencyError(msg, 40, obj.xmlfiles)
|
||||||
elif param.type == 'variable':
|
elif param.type == 'variable':
|
||||||
try:
|
if not isinstance(param.text, self.objectspace.variable):
|
||||||
path, suffix = self.objectspace.paths.get_variable_path(param.text,
|
try:
|
||||||
obj.namespace,
|
param.text, suffix = self.objectspace.paths.get_variable_with_suffix(param.text,
|
||||||
param.xmlfiles,
|
obj.namespace,
|
||||||
)
|
param.xmlfiles,
|
||||||
param.text = self.objectspace.paths.get_variable(path)
|
path_prefix,
|
||||||
if variable_type and param.text.type != variable_type:
|
)
|
||||||
msg = _(f'"{obj.name}" has type "{variable_type}" but param '
|
if variable_type and param.text.type != variable_type:
|
||||||
f'has type "{param.text.type}"')
|
msg = _(f'"{obj.name}" has type "{variable_type}" but param '
|
||||||
raise DictConsistencyError(msg, 26, param.xmlfiles)
|
f'has type "{param.text.type}"')
|
||||||
if suffix:
|
raise DictConsistencyError(msg, 26, param.xmlfiles)
|
||||||
param.suffix = suffix
|
if suffix:
|
||||||
family_path = self.objectspace.paths.get_variable_family_path(path)
|
param.suffix = suffix
|
||||||
namespace = param.text.namespace
|
namespace = param.text.namespace
|
||||||
param.family = self.objectspace.paths.get_family(family_path,
|
family_path = self.objectspace.paths.get_variable_family_path(param.text.path,
|
||||||
namespace,
|
namespace,
|
||||||
)
|
force_path_prefix=path_prefix,
|
||||||
except DictConsistencyError as err:
|
)
|
||||||
if err.errno != 42 or not param.optional:
|
param.family = self.objectspace.paths.get_family(family_path,
|
||||||
raise err
|
namespace,
|
||||||
param_to_delete.append(param_idx)
|
path_prefix,
|
||||||
|
)
|
||||||
|
except DictConsistencyError as err:
|
||||||
|
if err.errno != 42 or not param.optional:
|
||||||
|
raise err
|
||||||
|
param_to_delete.append(param_idx)
|
||||||
elif param.type == 'function':
|
elif param.type == 'function':
|
||||||
if not self.allow_function:
|
if not self.allow_function:
|
||||||
msg = _(f'cannot use "function" type')
|
msg = _(f'cannot use "function" type')
|
||||||
|
@ -101,7 +106,7 @@ class ParamAnnotator:
|
||||||
# no param.text
|
# no param.text
|
||||||
if param.type == 'suffix':
|
if param.type == 'suffix':
|
||||||
for target in obj.target:
|
for target in obj.target:
|
||||||
if not self.objectspace.paths.variable_is_dynamic(target.name.path):
|
if not self.objectspace.paths.is_dynamic(target.name):
|
||||||
target_name = target.name
|
target_name = target.name
|
||||||
if isinstance(target_name, self.objectspace.variable):
|
if isinstance(target_name, self.objectspace.variable):
|
||||||
target_name = target_name.name
|
target_name = target_name.name
|
||||||
|
@ -110,7 +115,7 @@ class ParamAnnotator:
|
||||||
raise DictConsistencyError(msg, 53, obj.xmlfiles)
|
raise DictConsistencyError(msg, 53, obj.xmlfiles)
|
||||||
elif param.type == 'index':
|
elif param.type == 'index':
|
||||||
for target in obj.target:
|
for target in obj.target:
|
||||||
if not self.objectspace.paths.is_follower(target.name.path):
|
if not self.objectspace.paths.is_follower(target.name):
|
||||||
msg = _(f'"{param.type}" parameter cannot be set with target '
|
msg = _(f'"{param.type}" parameter cannot be set with target '
|
||||||
f'"{target.name.name}" which is not a follower variable')
|
f'"{target.name.name}" which is not a follower variable')
|
||||||
raise DictConsistencyError(msg, 60, obj.xmlfiles)
|
raise DictConsistencyError(msg, 60, obj.xmlfiles)
|
||||||
|
|
|
@ -42,8 +42,16 @@ class Annotator(Walk):
|
||||||
*args
|
*args
|
||||||
) -> None:
|
) -> None:
|
||||||
self.objectspace = objectspace
|
self.objectspace = objectspace
|
||||||
if hasattr(self.objectspace.space, 'services'):
|
services = []
|
||||||
self.convert_services()
|
if not self.objectspace.paths.has_path_prefix() and hasattr(self.objectspace.space, 'services'):
|
||||||
|
services.append(self.objectspace.space.services)
|
||||||
|
elif hasattr(self.objectspace.space, 'variables'):
|
||||||
|
for path_prefix in self.objectspace.paths.get_path_prefixes():
|
||||||
|
if path_prefix in self.objectspace.space.variables and \
|
||||||
|
hasattr(self.objectspace.space.variables[path_prefix], 'services'):
|
||||||
|
services.append(self.objectspace.space.variables[path_prefix].services)
|
||||||
|
for service in services:
|
||||||
|
self.convert_services(service)
|
||||||
if hasattr(self.objectspace.space, 'variables'):
|
if hasattr(self.objectspace.space, 'variables'):
|
||||||
self.convert_family()
|
self.convert_family()
|
||||||
self.convert_variable()
|
self.convert_variable()
|
||||||
|
@ -57,12 +65,12 @@ class Annotator(Walk):
|
||||||
if isinstance(variable, self.objectspace.variable) and variable.hidden is True and \
|
if isinstance(variable, self.objectspace.variable) and variable.hidden is True and \
|
||||||
variable.name != self.objectspace.rougailconfig['auto_freeze_variable']:
|
variable.name != self.objectspace.rougailconfig['auto_freeze_variable']:
|
||||||
if not variable.auto_freeze and \
|
if not variable.auto_freeze and \
|
||||||
not hasattr(variable, 'provider'):
|
not hasattr(variable, 'provider') and not hasattr(variable, 'supplier'):
|
||||||
variable.frozen = True
|
variable.frozen = True
|
||||||
if not variable.auto_save and \
|
if not variable.auto_save and \
|
||||||
not variable.auto_freeze and \
|
not variable.auto_freeze and \
|
||||||
'force_default_on_freeze' not in vars(variable) and \
|
'force_default_on_freeze' not in vars(variable) and \
|
||||||
not hasattr(variable, 'provider'):
|
not hasattr(variable, 'provider') and not hasattr(variable, 'supplier'):
|
||||||
variable.force_default_on_freeze = True
|
variable.force_default_on_freeze = True
|
||||||
if not hasattr(variable, 'properties'):
|
if not hasattr(variable, 'properties'):
|
||||||
variable.properties = []
|
variable.properties = []
|
||||||
|
@ -72,6 +80,11 @@ class Annotator(Walk):
|
||||||
# for subprop in CONVERT_PROPERTIES.get(prop, [prop]):
|
# for subprop in CONVERT_PROPERTIES.get(prop, [prop]):
|
||||||
variable.properties.append(prop)
|
variable.properties.append(prop)
|
||||||
setattr(variable, prop, None)
|
setattr(variable, prop, None)
|
||||||
|
if hasattr(variable, 'unique') and variable.unique != 'nil':
|
||||||
|
if variable.unique == 'False':
|
||||||
|
variable.properties.append('notunique')
|
||||||
|
else:
|
||||||
|
variable.properties.append('unique')
|
||||||
if hasattr(variable, 'mode') and variable.mode:
|
if hasattr(variable, 'mode') and variable.mode:
|
||||||
variable.properties.append(variable.mode)
|
variable.properties.append(variable.mode)
|
||||||
variable.mode = None
|
variable.mode = None
|
||||||
|
@ -84,13 +97,13 @@ class Annotator(Walk):
|
||||||
if not variable.properties:
|
if not variable.properties:
|
||||||
del variable.properties
|
del variable.properties
|
||||||
|
|
||||||
def convert_services(self) -> None:
|
def convert_services(self, services) -> None:
|
||||||
"""convert services
|
"""convert services
|
||||||
"""
|
"""
|
||||||
self.convert_property(self.objectspace.space.services)
|
self.convert_property(services)
|
||||||
for services in self.objectspace.space.services.service.values():
|
for services_ in services.service.values():
|
||||||
self.convert_property(services)
|
self.convert_property(services_)
|
||||||
for service in vars(services).values():
|
for service in vars(services_).values():
|
||||||
if not isinstance(service, self.objectspace.family):
|
if not isinstance(service, self.objectspace.family):
|
||||||
continue
|
continue
|
||||||
self.convert_property(service)
|
self.convert_property(service)
|
||||||
|
|
|
@ -53,23 +53,39 @@ class Annotator:
|
||||||
*args,
|
*args,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.objectspace = objectspace
|
self.objectspace = objectspace
|
||||||
self.uniq_overrides = []
|
self.uniq_overrides = {}
|
||||||
if 'network_type' not in self.objectspace.types:
|
if 'network_type' not in self.objectspace.types:
|
||||||
self.objectspace.types['network_type'] = self.objectspace.types['ip_type']
|
self.objectspace.types['network_type'] = self.objectspace.types['ip_type']
|
||||||
if hasattr(self.objectspace.space, 'services'):
|
services = []
|
||||||
if not hasattr(self.objectspace.space.services, 'service'):
|
if not self.objectspace.paths.has_path_prefix():
|
||||||
del self.objectspace.space.services
|
self.uniq_overrides[None] = []
|
||||||
else:
|
if hasattr(self.objectspace.space, 'services'):
|
||||||
self.convert_services()
|
if not hasattr(self.objectspace.space.services, 'service'):
|
||||||
|
del self.objectspace.space.services
|
||||||
|
else:
|
||||||
|
services.append((None, 'services', self.objectspace.space.services))
|
||||||
|
elif hasattr(self.objectspace.space, 'variables'):
|
||||||
|
for path_prefix in self.objectspace.paths.get_path_prefixes():
|
||||||
|
self.uniq_overrides[path_prefix] = []
|
||||||
|
root_path = f'{path_prefix}.services'
|
||||||
|
if not path_prefix in self.objectspace.space.variables or \
|
||||||
|
not hasattr(self.objectspace.space.variables[path_prefix], 'services'):
|
||||||
|
continue
|
||||||
|
if not hasattr(self.objectspace.space.variables[path_prefix].services, 'service'):
|
||||||
|
del self.objectspace.space.variables[path_prefix].services
|
||||||
|
else:
|
||||||
|
services.append((path_prefix, root_path, self.objectspace.space.variables[path_prefix].services))
|
||||||
|
for path_prefix, root_path, service in services:
|
||||||
|
self.convert_services(path_prefix, root_path, service)
|
||||||
|
|
||||||
def convert_services(self):
|
def convert_services(self, path_prefix, root_path, services):
|
||||||
"""convert services to variables
|
"""convert services to variables
|
||||||
"""
|
"""
|
||||||
self.objectspace.space.services.hidden = True
|
services.hidden = True
|
||||||
self.objectspace.space.services.name = 'services'
|
services.name = 'services'
|
||||||
self.objectspace.space.services.doc = 'services'
|
services.doc = 'services'
|
||||||
self.objectspace.space.services.path = 'services'
|
services.path = root_path
|
||||||
for service_name, service in self.objectspace.space.services.service.items():
|
for service_name, service in services.service.items():
|
||||||
service.name = normalize_family(service_name)
|
service.name = normalize_family(service_name)
|
||||||
activate_obj = self._generate_element('boolean',
|
activate_obj = self._generate_element('boolean',
|
||||||
None,
|
None,
|
||||||
|
@ -77,19 +93,26 @@ class Annotator:
|
||||||
'activate',
|
'activate',
|
||||||
not service.disabled,
|
not service.disabled,
|
||||||
service,
|
service,
|
||||||
'.'.join(['services', service.name, 'activate']),
|
f'{root_path}.{service.name}',
|
||||||
|
path_prefix,
|
||||||
)
|
)
|
||||||
service.disabled = None
|
service.disabled = None
|
||||||
for elttype, values in dict(vars(service)).items():
|
dico = dict(vars(service))
|
||||||
|
if 'type' not in dico:
|
||||||
|
if service.manage:
|
||||||
|
dico['type'] = service.type
|
||||||
|
else:
|
||||||
|
dico['type'] = 'none'
|
||||||
|
for elttype, values in dico.items():
|
||||||
if elttype == 'servicelist':
|
if elttype == 'servicelist':
|
||||||
self.objectspace.list_conditions.setdefault('servicelist',
|
self.objectspace.paths.list_conditions[path_prefix].setdefault('servicelist',
|
||||||
{}).setdefault(
|
{}).setdefault(
|
||||||
values,
|
values,
|
||||||
[]).append(activate_obj)
|
[]).append(activate_obj)
|
||||||
continue
|
continue
|
||||||
if elttype in ERASED_ATTRIBUTES:
|
if elttype in ERASED_ATTRIBUTES:
|
||||||
continue
|
continue
|
||||||
if not service.manage and elttype not in ALLOW_ATTRIBUT_NOT_MANAGE:
|
if not service.manage and elttype not in ALLOW_ATTRIBUT_NOT_MANAGE and (elttype != 'type' or values != 'none'):
|
||||||
msg = _(f'unmanage service cannot have "{elttype}"')
|
msg = _(f'unmanage service cannot have "{elttype}"')
|
||||||
raise DictConsistencyError(msg, 66, service.xmlfiles)
|
raise DictConsistencyError(msg, 66, service.xmlfiles)
|
||||||
if isinstance(values, (dict, list)):
|
if isinstance(values, (dict, list)):
|
||||||
|
@ -97,10 +120,14 @@ class Annotator:
|
||||||
eltname = elttype + 's'
|
eltname = elttype + 's'
|
||||||
else:
|
else:
|
||||||
eltname = elttype
|
eltname = elttype
|
||||||
path = '.'.join(['services', service.name, eltname])
|
if hasattr(service, 'servicelist'):
|
||||||
|
if isinstance(values, dict):
|
||||||
|
for key, value in values.items():
|
||||||
|
setattr(value, 'servicelist', service.servicelist)
|
||||||
family = self._gen_family(eltname,
|
family = self._gen_family(eltname,
|
||||||
path,
|
f'{root_path}.{service.name}',
|
||||||
service.xmlfiles,
|
service.xmlfiles,
|
||||||
|
path_prefix,
|
||||||
with_informations=False,
|
with_informations=False,
|
||||||
)
|
)
|
||||||
if isinstance(values, dict):
|
if isinstance(values, dict):
|
||||||
|
@ -108,22 +135,25 @@ class Annotator:
|
||||||
family.family = self.make_group_from_elts(service_name,
|
family.family = self.make_group_from_elts(service_name,
|
||||||
elttype,
|
elttype,
|
||||||
values,
|
values,
|
||||||
path,
|
f'{root_path}.{service.name}.{eltname}',
|
||||||
|
root_path,
|
||||||
|
path_prefix,
|
||||||
)
|
)
|
||||||
setattr(service, elttype, family)
|
setattr(service, elttype, family)
|
||||||
else:
|
else:
|
||||||
if not hasattr(service, 'information'):
|
if not hasattr(service, 'information'):
|
||||||
service.information = self.objectspace.information(service.xmlfiles)
|
service.information = self.objectspace.information(service.xmlfiles)
|
||||||
setattr(service.information, elttype, values)
|
setattr(service.information, elttype, values)
|
||||||
service.path = '.'.join(['services', service.name])
|
service.path = f'{root_path}.{service.name}'
|
||||||
manage = self._generate_element('boolean',
|
manage = self._generate_element('boolean',
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
'manage',
|
'manage',
|
||||||
service.manage,
|
service.manage,
|
||||||
service,
|
service,
|
||||||
'.'.join(['services', service.name, 'manage']),
|
f'{root_path}.{service.name}',
|
||||||
)
|
path_prefix,
|
||||||
|
)
|
||||||
service.variable = [activate_obj, manage]
|
service.variable = [activate_obj, manage]
|
||||||
service.doc = service_name
|
service.doc = service_name
|
||||||
|
|
||||||
|
@ -132,6 +162,8 @@ class Annotator:
|
||||||
elttype,
|
elttype,
|
||||||
elts,
|
elts,
|
||||||
path,
|
path,
|
||||||
|
root_path,
|
||||||
|
path_prefix,
|
||||||
):
|
):
|
||||||
"""Splits each objects into a group (and `OptionDescription`, in tiramisu terms)
|
"""Splits each objects into a group (and `OptionDescription`, in tiramisu terms)
|
||||||
and build elements and its attributes (the `Options` in tiramisu terms)
|
and build elements and its attributes (the `Options` in tiramisu terms)
|
||||||
|
@ -144,13 +176,17 @@ class Annotator:
|
||||||
if hasattr(self, update_elt):
|
if hasattr(self, update_elt):
|
||||||
getattr(self, update_elt)(elt,
|
getattr(self, update_elt)(elt,
|
||||||
service_name,
|
service_name,
|
||||||
|
path_prefix,
|
||||||
)
|
)
|
||||||
c_name, subpath = self._get_name_path(elt,
|
c_name, subpath = self._get_name_path(elt,
|
||||||
path,
|
path,
|
||||||
|
root_path,
|
||||||
|
path_prefix,
|
||||||
)
|
)
|
||||||
family = self._gen_family(c_name,
|
family = self._gen_family(c_name,
|
||||||
subpath,
|
subpath.rsplit('.', 1)[0],
|
||||||
elt.xmlfiles,
|
elt.xmlfiles,
|
||||||
|
path_prefix,
|
||||||
)
|
)
|
||||||
family.variable = []
|
family.variable = []
|
||||||
if hasattr(elt, 'disabled'):
|
if hasattr(elt, 'disabled'):
|
||||||
|
@ -163,17 +199,18 @@ class Annotator:
|
||||||
'activate',
|
'activate',
|
||||||
not disabled,
|
not disabled,
|
||||||
elt,
|
elt,
|
||||||
'.'.join([subpath, 'activate']),
|
subpath,
|
||||||
|
path_prefix,
|
||||||
)
|
)
|
||||||
for key in dir(elt):
|
for key in dir(elt):
|
||||||
if key.startswith('_') or key.endswith('_type') or key in ERASED_ATTRIBUTES2:
|
if key.startswith('_') or key.endswith('_type') or key in ERASED_ATTRIBUTES2:
|
||||||
continue
|
continue
|
||||||
value = getattr(elt, key)
|
value = getattr(elt, key)
|
||||||
if key == listname:
|
if key in [listname, 'servicelist']:
|
||||||
self.objectspace.list_conditions.setdefault(listname,
|
self.objectspace.paths.list_conditions[path_prefix].setdefault(key,
|
||||||
{}).setdefault(
|
{}).setdefault(
|
||||||
value,
|
value,
|
||||||
[]).append(activate_obj)
|
[]).append(activate_obj)
|
||||||
continue
|
continue
|
||||||
if key == 'name':
|
if key == 'name':
|
||||||
dtd_key_type = elttype + '_type'
|
dtd_key_type = elttype + '_type'
|
||||||
|
@ -189,7 +226,8 @@ class Annotator:
|
||||||
key,
|
key,
|
||||||
value,
|
value,
|
||||||
elt,
|
elt,
|
||||||
f'{subpath}.{key}'
|
subpath,
|
||||||
|
path_prefix,
|
||||||
))
|
))
|
||||||
else:
|
else:
|
||||||
setattr(family.information, key, value)
|
setattr(family.information, key, value)
|
||||||
|
@ -201,6 +239,8 @@ class Annotator:
|
||||||
def _get_name_path(self,
|
def _get_name_path(self,
|
||||||
elt,
|
elt,
|
||||||
path: str,
|
path: str,
|
||||||
|
root_path: str,
|
||||||
|
path_prefix: str,
|
||||||
) -> Tuple[str, str]:
|
) -> Tuple[str, str]:
|
||||||
# create element name, if already exists, add _xx to be uniq
|
# create element name, if already exists, add _xx to be uniq
|
||||||
if hasattr(elt, 'source') and elt.source:
|
if hasattr(elt, 'source') and elt.source:
|
||||||
|
@ -214,7 +254,7 @@ class Annotator:
|
||||||
c_name += f'_{idx}'
|
c_name += f'_{idx}'
|
||||||
subpath = '{}.{}'.format(path, normalize_family(c_name))
|
subpath = '{}.{}'.format(path, normalize_family(c_name))
|
||||||
try:
|
try:
|
||||||
self.objectspace.paths.get_family(subpath, 'services')
|
self.objectspace.paths.get_family(subpath, root_path, path_prefix)
|
||||||
except DictConsistencyError as err:
|
except DictConsistencyError as err:
|
||||||
if err.errno == 42:
|
if err.errno == 42:
|
||||||
return c_name, subpath
|
return c_name, subpath
|
||||||
|
@ -222,8 +262,9 @@ class Annotator:
|
||||||
|
|
||||||
def _gen_family(self,
|
def _gen_family(self,
|
||||||
name,
|
name,
|
||||||
path,
|
subpath,
|
||||||
xmlfiles,
|
xmlfiles,
|
||||||
|
path_prefix,
|
||||||
with_informations=True,
|
with_informations=True,
|
||||||
):
|
):
|
||||||
family = self.objectspace.family(xmlfiles)
|
family = self.objectspace.family(xmlfiles)
|
||||||
|
@ -231,9 +272,10 @@ class Annotator:
|
||||||
family.doc = name
|
family.doc = name
|
||||||
family.mode = None
|
family.mode = None
|
||||||
self.objectspace.paths.add_family('services',
|
self.objectspace.paths.add_family('services',
|
||||||
path,
|
subpath,
|
||||||
family,
|
family,
|
||||||
None,
|
False,
|
||||||
|
force_path_prefix=path_prefix,
|
||||||
)
|
)
|
||||||
if with_informations:
|
if with_informations:
|
||||||
family.information = self.objectspace.information(xmlfiles)
|
family.information = self.objectspace.information(xmlfiles)
|
||||||
|
@ -247,13 +289,19 @@ class Annotator:
|
||||||
value,
|
value,
|
||||||
elt,
|
elt,
|
||||||
path,
|
path,
|
||||||
|
path_prefix,
|
||||||
): # pylint: disable=R0913
|
): # pylint: disable=R0913
|
||||||
variable = self.objectspace.variable(elt.xmlfiles)
|
variable = self.objectspace.variable(elt.xmlfiles)
|
||||||
variable.name = normalize_family(key)
|
variable.name = normalize_family(key)
|
||||||
variable.mode = None
|
variable.mode = None
|
||||||
variable.type = type_
|
variable.type = type_
|
||||||
if type_ == 'symlink':
|
if type_ == 'symlink':
|
||||||
variable.opt = self.objectspace.paths.get_variable(value, xmlfiles=elt.xmlfiles)
|
variable.opt = self.objectspace.paths.get_variable(value,
|
||||||
|
self.objectspace.rougailconfig['variable_namespace'],
|
||||||
|
xmlfiles=elt.xmlfiles,
|
||||||
|
force_path_prefix=path_prefix,
|
||||||
|
add_path_prefix=True,
|
||||||
|
)
|
||||||
variable.multi = None
|
variable.multi = None
|
||||||
needed_type = self.objectspace.types[dtd_key_type]
|
needed_type = self.objectspace.types[dtd_key_type]
|
||||||
if needed_type not in ('variable', variable.opt.type):
|
if needed_type not in ('variable', variable.opt.type):
|
||||||
|
@ -267,22 +315,22 @@ class Annotator:
|
||||||
variable.namespace = 'services'
|
variable.namespace = 'services'
|
||||||
self.objectspace.paths.add_variable('services',
|
self.objectspace.paths.add_variable('services',
|
||||||
path,
|
path,
|
||||||
'service',
|
|
||||||
False,
|
|
||||||
variable,
|
variable,
|
||||||
|
force_path_prefix=path_prefix
|
||||||
)
|
)
|
||||||
return variable
|
return variable
|
||||||
|
|
||||||
def _update_override(self,
|
def _update_override(self,
|
||||||
override,
|
override,
|
||||||
service_name,
|
service_name,
|
||||||
|
path_prefix,
|
||||||
):
|
):
|
||||||
|
|
||||||
if service_name in self.uniq_overrides:
|
if service_name in self.uniq_overrides[path_prefix]:
|
||||||
msg = _('only one override is allowed by service, '
|
msg = _('only one override is allowed by service, '
|
||||||
'please use a variable multiple if you want have more than one IP')
|
'please use a variable multiple if you want have more than one IP')
|
||||||
raise DictConsistencyError(msg, 69, override.xmlfiles)
|
raise DictConsistencyError(msg, 69, override.xmlfiles)
|
||||||
self.uniq_overrides.append(service_name)
|
self.uniq_overrides[path_prefix].append(service_name)
|
||||||
override.name = service_name
|
override.name = service_name
|
||||||
if not hasattr(override, 'source'):
|
if not hasattr(override, 'source'):
|
||||||
override.source = service_name
|
override.source = service_name
|
||||||
|
@ -290,6 +338,7 @@ class Annotator:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _update_file(file_,
|
def _update_file(file_,
|
||||||
service_name,
|
service_name,
|
||||||
|
path_prefix,
|
||||||
):
|
):
|
||||||
if not hasattr(file_, 'file_type') or file_.file_type == "filename":
|
if not hasattr(file_, 'file_type') or file_.file_type == "filename":
|
||||||
if not hasattr(file_, 'source'):
|
if not hasattr(file_, 'source'):
|
||||||
|
@ -302,8 +351,14 @@ class Annotator:
|
||||||
def _update_ip(self,
|
def _update_ip(self,
|
||||||
ip,
|
ip,
|
||||||
service_name,
|
service_name,
|
||||||
|
path_prefix,
|
||||||
) -> None:
|
) -> None:
|
||||||
variable = self.objectspace.paths.get_variable(ip.name, ip.xmlfiles)
|
variable = self.objectspace.paths.get_variable(ip.name,
|
||||||
|
ip.namespace,
|
||||||
|
xmlfiles=ip.xmlfiles,
|
||||||
|
force_path_prefix=path_prefix,
|
||||||
|
add_path_prefix=True,
|
||||||
|
)
|
||||||
if variable.type not in ['ip', 'network', 'network_cidr']:
|
if variable.type not in ['ip', 'network', 'network_cidr']:
|
||||||
msg = _(f'ip cannot be linked to "{variable.type}" variable "{ip.name}"')
|
msg = _(f'ip cannot be linked to "{variable.type}" variable "{ip.name}"')
|
||||||
raise DictConsistencyError(msg, 70, ip.xmlfiles)
|
raise DictConsistencyError(msg, 70, ip.xmlfiles)
|
||||||
|
@ -314,7 +369,12 @@ class Annotator:
|
||||||
msg = _(f'ip with ip_type "{variable.type}" must have netmask')
|
msg = _(f'ip with ip_type "{variable.type}" must have netmask')
|
||||||
raise DictConsistencyError(msg, 64, ip.xmlfiles)
|
raise DictConsistencyError(msg, 64, ip.xmlfiles)
|
||||||
if hasattr(ip, 'netmask'):
|
if hasattr(ip, 'netmask'):
|
||||||
netmask = self.objectspace.paths.get_variable(ip.netmask, ip.xmlfiles)
|
netmask = self.objectspace.paths.get_variable(ip.netmask,
|
||||||
|
ip.namespace,
|
||||||
|
xmlfiles=ip.xmlfiles,
|
||||||
|
force_path_prefix=path_prefix,
|
||||||
|
add_path_prefix=True,
|
||||||
|
)
|
||||||
if netmask.type != 'netmask':
|
if netmask.type != 'netmask':
|
||||||
msg = _(f'netmask in ip must have type "netmask", not "{netmask.type}"')
|
msg = _(f'netmask in ip must have type "netmask", not "{netmask.type}"')
|
||||||
raise DictConsistencyError(msg, 65, ip.xmlfiles)
|
raise DictConsistencyError(msg, 65, ip.xmlfiles)
|
||||||
|
|
|
@ -26,13 +26,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
"""
|
"""
|
||||||
from rougail.i18n import _
|
from rougail.i18n import _
|
||||||
from rougail.error import DictConsistencyError
|
from rougail.error import DictConsistencyError
|
||||||
|
from rougail.annotator.variable import Walk
|
||||||
|
|
||||||
|
|
||||||
class TargetAnnotator:
|
class TargetAnnotator(Walk):
|
||||||
"""Target annotator
|
"""Target annotator
|
||||||
"""
|
"""
|
||||||
def convert_target(self,
|
def convert_target(self,
|
||||||
objects,
|
objects,
|
||||||
|
path_prefix,
|
||||||
) -> None:
|
) -> None:
|
||||||
""" valid and convert param
|
""" valid and convert param
|
||||||
"""
|
"""
|
||||||
|
@ -52,13 +54,15 @@ class TargetAnnotator:
|
||||||
# let's replace the target by the path
|
# let's replace the target by the path
|
||||||
try:
|
try:
|
||||||
if target.type == 'variable':
|
if target.type == 'variable':
|
||||||
path, suffix = self.objectspace.paths.get_variable_path(target.name,
|
if not isinstance(target.name, self.objectspace.variable):
|
||||||
obj.namespace,
|
target.name, suffix = self.objectspace.paths.get_variable_with_suffix(target.name,
|
||||||
)
|
obj.namespace,
|
||||||
target.name = self.objectspace.paths.get_variable(path)
|
target.xmlfiles,
|
||||||
if suffix:
|
path_prefix,
|
||||||
msg = _(f'target to {target.name.path} with suffix is not allowed')
|
)
|
||||||
raise DictConsistencyError(msg, 35, obj.xmlfiles)
|
if suffix:
|
||||||
|
msg = _(f'target to {target.name.path} with suffix is not allowed')
|
||||||
|
raise DictConsistencyError(msg, 35, obj.xmlfiles)
|
||||||
elif self.only_variable:
|
elif self.only_variable:
|
||||||
msg = _(f'target to "{target.name}" with param type "{target.type}" '
|
msg = _(f'target to "{target.name}" with param type "{target.type}" '
|
||||||
f'is not allowed')
|
f'is not allowed')
|
||||||
|
@ -73,6 +77,8 @@ class TargetAnnotator:
|
||||||
raise DictConsistencyError(msg, 51, target.xmlfiles)
|
raise DictConsistencyError(msg, 51, target.xmlfiles)
|
||||||
target.name = self.objectspace.paths.get_family(target.name,
|
target.name = self.objectspace.paths.get_family(target.name,
|
||||||
obj.namespace,
|
obj.namespace,
|
||||||
|
path_prefix,
|
||||||
|
allow_variable_namespace=True,
|
||||||
)
|
)
|
||||||
elif target.type.endswith('list') and \
|
elif target.type.endswith('list') and \
|
||||||
obj.name not in ['disabled_if_in', 'disabled_if_not_in']:
|
obj.name not in ['disabled_if_in', 'disabled_if_not_in']:
|
||||||
|
|
|
@ -75,9 +75,13 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||||
if variable.value[0].type == 'calculation':
|
if variable.value[0].type == 'calculation':
|
||||||
variable.default = variable.value[0]
|
variable.default = variable.value[0]
|
||||||
elif variable.multi:
|
elif variable.multi:
|
||||||
if not self.objectspace.paths.is_follower(variable.path):
|
if self.objectspace.paths.is_follower(variable):
|
||||||
|
if variable.multi != 'submulti' and len(variable.value) != 1:
|
||||||
|
msg = _(f'the follower "{variable.name}" without multi attribute can only have one value')
|
||||||
|
raise DictConsistencyError(msg, 87, variable.xmlfiles)
|
||||||
|
else:
|
||||||
variable.default = [value.name for value in variable.value]
|
variable.default = [value.name for value in variable.value]
|
||||||
if not self.objectspace.paths.is_leader(variable.path):
|
if not self.objectspace.paths.is_leader(variable):
|
||||||
if variable.multi == 'submulti':
|
if variable.multi == 'submulti':
|
||||||
variable.default_multi = [value.name for value in variable.value]
|
variable.default_multi = [value.name for value in variable.value]
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
from rougail.i18n import _
|
from rougail.i18n import _
|
||||||
from rougail.error import DictConsistencyError
|
from rougail.error import DictConsistencyError
|
||||||
from rougail.objspace import convert_boolean
|
from rougail.objspace import convert_boolean, get_variables
|
||||||
|
|
||||||
|
|
||||||
CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int),
|
CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int),
|
||||||
|
@ -56,7 +56,7 @@ CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int),
|
||||||
'allow_ip': False}),
|
'allow_ip': False}),
|
||||||
'web_address': dict(opttype="URLOption", initkwargs={'allow_ip': True,
|
'web_address': dict(opttype="URLOption", initkwargs={'allow_ip': True,
|
||||||
'allow_without_dot': True}),
|
'allow_without_dot': True}),
|
||||||
'port': dict(opttype="PortOption", initkwargs={'allow_private': True}),
|
'port': dict(opttype="PortOption", initkwargs={'allow_private': True, 'allow_protocol': True}),
|
||||||
'mac': dict(opttype="MACOption"),
|
'mac': dict(opttype="MACOption"),
|
||||||
'cidr': dict(opttype="IPOption", initkwargs={'cidr': True}),
|
'cidr': dict(opttype="IPOption", initkwargs={'cidr': True}),
|
||||||
'network_cidr': dict(opttype="NetworkOption", initkwargs={'cidr': True}),
|
'network_cidr': dict(opttype="NetworkOption", initkwargs={'cidr': True}),
|
||||||
|
@ -71,35 +71,56 @@ class Walk:
|
||||||
def get_variables(self):
|
def get_variables(self):
|
||||||
"""Iter all variables from the objectspace
|
"""Iter all variables from the objectspace
|
||||||
"""
|
"""
|
||||||
for family in self.objectspace.space.variables.values():
|
yield from get_variables(self.objectspace)
|
||||||
yield from self._get_variables(family)
|
|
||||||
|
|
||||||
def _get_variables(self,
|
def get_families(self,
|
||||||
family: 'self.objectspace.family',
|
with_parent: bool=False,
|
||||||
):
|
):
|
||||||
if not hasattr(family, 'variable'):
|
|
||||||
return
|
|
||||||
for variable in family.variable.values():
|
|
||||||
if isinstance(variable, self.objectspace.family):
|
|
||||||
yield from self._get_variables(variable)
|
|
||||||
else:
|
|
||||||
yield variable
|
|
||||||
|
|
||||||
def get_families(self):
|
|
||||||
"""Iter all families from the objectspace
|
"""Iter all families from the objectspace
|
||||||
"""
|
"""
|
||||||
for family in self.objectspace.space.variables.values():
|
for family in self.objectspace.space.variables.values():
|
||||||
yield from self._get_families(family)
|
yield from self._get_families(family, None, with_parent)
|
||||||
|
|
||||||
def _get_families(self,
|
def _get_families(self,
|
||||||
family: 'self.objectspace.family',
|
family: 'self.objectspace.family',
|
||||||
|
old_family: 'self.objectspace.family',
|
||||||
|
with_parent: bool,
|
||||||
):
|
):
|
||||||
yield family
|
if with_parent:
|
||||||
if not hasattr(family, 'variable'):
|
yield family, old_family,
|
||||||
return
|
if hasattr(family, 'variable'):
|
||||||
for fam in family.variable.values():
|
if not with_parent:
|
||||||
if isinstance(fam, self.objectspace.family):
|
yield family
|
||||||
yield from self._get_families(fam)
|
for fam in family.variable.values():
|
||||||
|
if isinstance(fam, self.objectspace.family):
|
||||||
|
yield from self._get_families(fam, family, with_parent)
|
||||||
|
if hasattr(family, 'variables'):
|
||||||
|
for fam in family.variables.values():
|
||||||
|
yield from self._get_families(fam, family, with_parent)
|
||||||
|
|
||||||
|
def get_constraints(self,
|
||||||
|
create: bool=False,
|
||||||
|
path_prefix: str=None,
|
||||||
|
):
|
||||||
|
if not self.objectspace.paths.has_path_prefix():
|
||||||
|
if hasattr(self.objectspace.space, 'constraints'):
|
||||||
|
yield None, self.objectspace.space.constraints
|
||||||
|
elif create:
|
||||||
|
self.objectspace.space.constraints = self.objectspace.constraints(None)
|
||||||
|
yield None, self.objectspace.space.constraints
|
||||||
|
else:
|
||||||
|
if path_prefix:
|
||||||
|
path_prefixes = [path_prefix]
|
||||||
|
else:
|
||||||
|
path_prefixes = self.objectspace.paths.get_path_prefixes()
|
||||||
|
for path_prefix in path_prefixes:
|
||||||
|
if hasattr(self.objectspace.space, 'variables') and \
|
||||||
|
path_prefix in self.objectspace.space.variables and \
|
||||||
|
hasattr(self.objectspace.space.variables[path_prefix], 'constraints'):
|
||||||
|
yield path_prefix, self.objectspace.space.variables[path_prefix].constraints
|
||||||
|
elif create:
|
||||||
|
self.objectspace.space.variables[path_prefix].constraints = self.objectspace.constraints(None)
|
||||||
|
yield path_prefix, self.objectspace.space.variables[path_prefix].constraints
|
||||||
|
|
||||||
|
|
||||||
class Annotator(Walk): # pylint: disable=R0903
|
class Annotator(Walk): # pylint: disable=R0903
|
||||||
|
@ -166,7 +187,10 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||||
elif choice.type == 'space':
|
elif choice.type == 'space':
|
||||||
choice.name = ' '
|
choice.name = ' '
|
||||||
elif choice.type == 'variable':
|
elif choice.type == 'variable':
|
||||||
choice.name = self.objectspace.paths.get_variable(choice.name)
|
choice.name = self.objectspace.paths.get_variable(choice.name,
|
||||||
|
variable.namespace,
|
||||||
|
force_path_prefix=variable.path_prefix,
|
||||||
|
)
|
||||||
if not choice.name.multi:
|
if not choice.name.multi:
|
||||||
msg = _(f'only multi "variable" is allowed for a choice '
|
msg = _(f'only multi "variable" is allowed for a choice '
|
||||||
f'of variable "{variable.name}"')
|
f'of variable "{variable.name}"')
|
||||||
|
@ -186,10 +210,10 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||||
f'of all expected values ({values})')
|
f'of all expected values ({values})')
|
||||||
raise DictConsistencyError(msg, 15, value.xmlfiles)
|
raise DictConsistencyError(msg, 15, value.xmlfiles)
|
||||||
ref_choice = variable.choice[0]
|
ref_choice = variable.choice[0]
|
||||||
self.objectspace.valid_enums[variable.path] = {'type': ref_choice.type,
|
self.objectspace.paths.set_valid_enums(variable.path,
|
||||||
'values': values,
|
values,
|
||||||
'xmlfiles': ref_choice.xmlfiles,
|
variable.path_prefix,
|
||||||
}
|
)
|
||||||
elif variable.type == 'choice':
|
elif variable.type == 'choice':
|
||||||
msg = _(f'choice is mandatory for the variable "{variable.name}" with choice type')
|
msg = _(f'choice is mandatory for the variable "{variable.name}" with choice type')
|
||||||
raise DictConsistencyError(msg, 4, variable.xmlfiles)
|
raise DictConsistencyError(msg, 4, variable.xmlfiles)
|
||||||
|
|
|
@ -56,4 +56,10 @@ RougailConfig = {'dictionaries_dir': [join(ROUGAILROOT, 'dictionaries')],
|
||||||
'default_files_group': 'root',
|
'default_files_group': 'root',
|
||||||
'default_files_included': 'no',
|
'default_files_included': 'no',
|
||||||
'default_overrides_engine': 'creole',
|
'default_overrides_engine': 'creole',
|
||||||
|
'default_service_names_engine': 'none',
|
||||||
|
'default_systemd_directory': '/systemd',
|
||||||
|
'base_option_name': 'baseoption',
|
||||||
|
'export_with_import': True,
|
||||||
|
'force_convert_dyn_option_description': False,
|
||||||
|
'suffix': '',
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,8 @@ from .xmlreflector import XMLReflector
|
||||||
from .tiramisureflector import TiramisuReflector
|
from .tiramisureflector import TiramisuReflector
|
||||||
from .annotator import SpaceAnnotator
|
from .annotator import SpaceAnnotator
|
||||||
from .error import DictConsistencyError
|
from .error import DictConsistencyError
|
||||||
|
from .providersupplier import provider_supplier
|
||||||
|
from .utils import normalize_family
|
||||||
|
|
||||||
|
|
||||||
class RougailConvert:
|
class RougailConvert:
|
||||||
|
@ -60,56 +62,92 @@ class RougailConvert:
|
||||||
) -> None:
|
) -> None:
|
||||||
if rougailconfig is None:
|
if rougailconfig is None:
|
||||||
rougailconfig = RougailConfig
|
rougailconfig = RougailConfig
|
||||||
xmlreflector = XMLReflector(rougailconfig)
|
self.rougailconfig = rougailconfig
|
||||||
rougailobjspace = RougailObjSpace(xmlreflector,
|
xmlreflector = XMLReflector(self.rougailconfig)
|
||||||
rougailconfig,
|
self.rougailobjspace = RougailObjSpace(xmlreflector,
|
||||||
)
|
self.rougailconfig,
|
||||||
self._load_dictionaries(xmlreflector,
|
)
|
||||||
rougailobjspace,
|
self.internal_functions = self.rougailconfig['internal_functions']
|
||||||
rougailconfig['variable_namespace'],
|
self.functions_file = self.rougailconfig['functions_file']
|
||||||
rougailconfig['dictionaries_dir'],
|
if not isinstance(self.functions_file, list):
|
||||||
rougailconfig['variable_namespace_description'],
|
self.functions_file = [self.functions_file]
|
||||||
|
self.dictionaries = False
|
||||||
|
self.annotator = False
|
||||||
|
self.reflector = None
|
||||||
|
|
||||||
|
def load_dictionaries(self,
|
||||||
|
path_prefix: str=None,
|
||||||
|
) -> None:
|
||||||
|
self.rougailobjspace.paths.set_path_prefix(normalize_family(path_prefix))
|
||||||
|
self._load_dictionaries(self.rougailobjspace.xmlreflector,
|
||||||
|
self.rougailconfig['variable_namespace'],
|
||||||
|
self.rougailconfig['dictionaries_dir'],
|
||||||
|
path_prefix,
|
||||||
|
self.rougailconfig['variable_namespace_description'],
|
||||||
)
|
)
|
||||||
for namespace, extra_dir in rougailconfig['extra_dictionaries'].items():
|
for namespace, extra_dir in self.rougailconfig['extra_dictionaries'].items():
|
||||||
if namespace in ['services', rougailconfig['variable_namespace']]:
|
if namespace in ['services', self.rougailconfig['variable_namespace']]:
|
||||||
msg = _(f'Namespace name "{namespace}" is not allowed')
|
msg = _(f'Namespace name "{namespace}" is not allowed')
|
||||||
raise DictConsistencyError(msg, 21, None)
|
raise DictConsistencyError(msg, 21, None)
|
||||||
self._load_dictionaries(xmlreflector,
|
self._load_dictionaries(self.rougailobjspace.xmlreflector,
|
||||||
rougailobjspace,
|
|
||||||
namespace,
|
namespace,
|
||||||
extra_dir,
|
extra_dir,
|
||||||
|
path_prefix,
|
||||||
)
|
)
|
||||||
functions_file = rougailconfig['functions_file']
|
if hasattr(self.rougailobjspace.space, 'variables'):
|
||||||
if not isinstance(functions_file, list):
|
provider_supplier(self.rougailobjspace,
|
||||||
functions_file = [functions_file]
|
path_prefix,
|
||||||
SpaceAnnotator(rougailobjspace,
|
)
|
||||||
functions_file,
|
self.dictionaries = True
|
||||||
)
|
|
||||||
self.output = TiramisuReflector(rougailobjspace,
|
|
||||||
functions_file,
|
|
||||||
rougailconfig['internal_functions'],
|
|
||||||
).get_text() + '\n'
|
|
||||||
|
|
||||||
@staticmethod
|
def _load_dictionaries(self,
|
||||||
def _load_dictionaries(xmlreflector: XMLReflector,
|
xmlreflector: XMLReflector,
|
||||||
rougailobjspace: RougailObjSpace,
|
|
||||||
namespace: str,
|
namespace: str,
|
||||||
xmlfolders: List[str],
|
xmlfolders: List[str],
|
||||||
|
path_prefix: str,
|
||||||
namespace_description: str=None,
|
namespace_description: str=None,
|
||||||
) -> List[str]:
|
) -> List[str]:
|
||||||
for xmlfile, document in xmlreflector.load_xml_from_folders(xmlfolders):
|
for xmlfile, document in xmlreflector.load_xml_from_folders(xmlfolders):
|
||||||
rougailobjspace.xml_parse_document(xmlfile,
|
self.rougailobjspace.xml_parse_document(xmlfile,
|
||||||
document,
|
document,
|
||||||
namespace,
|
namespace,
|
||||||
namespace_description,
|
namespace_description,
|
||||||
)
|
path_prefix,
|
||||||
|
)
|
||||||
|
|
||||||
|
def annotate(self):
|
||||||
|
if self.annotator:
|
||||||
|
raise DictConsistencyError(_('Cannot execute annotate multiple time'), 85, None)
|
||||||
|
SpaceAnnotator(self.rougailobjspace,
|
||||||
|
self.functions_file,
|
||||||
|
)
|
||||||
|
self.annotator = True
|
||||||
|
|
||||||
|
def reflexion(self,
|
||||||
|
exclude_imports: list=[],
|
||||||
|
):
|
||||||
|
if not self.dictionaries:
|
||||||
|
self.load_dictionaries()
|
||||||
|
if not self.annotator:
|
||||||
|
self.annotate()
|
||||||
|
if self.reflector:
|
||||||
|
raise DictConsistencyError(_('Cannot execute reflexion multiple time'), 86, None)
|
||||||
|
functions_file = [func for func in self.functions_file if func not in exclude_imports]
|
||||||
|
self.reflector = TiramisuReflector(self.rougailobjspace,
|
||||||
|
functions_file,
|
||||||
|
self.internal_functions,
|
||||||
|
self.rougailconfig,
|
||||||
|
)
|
||||||
|
|
||||||
def save(self,
|
def save(self,
|
||||||
filename: str,
|
filename: str,
|
||||||
) -> str:
|
) -> str:
|
||||||
"""Return tiramisu object declaration as a string
|
"""Return tiramisu object declaration as a string
|
||||||
"""
|
"""
|
||||||
|
if self.reflector is None:
|
||||||
|
self.reflexion()
|
||||||
|
output = self.reflector.get_text() + '\n'
|
||||||
if filename:
|
if filename:
|
||||||
with open(filename, 'w') as tiramisu:
|
with open(filename, 'w') as tiramisu:
|
||||||
tiramisu.write(self.output)
|
tiramisu.write(output)
|
||||||
return self.output
|
return output
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
<!ATTLIST service disabled (True|False) "False">
|
<!ATTLIST service disabled (True|False) "False">
|
||||||
<!ATTLIST service engine (none|creole|jinja2) #IMPLIED>
|
<!ATTLIST service engine (none|creole|jinja2) #IMPLIED>
|
||||||
<!ATTLIST service target CDATA #IMPLIED>
|
<!ATTLIST service target CDATA #IMPLIED>
|
||||||
<!ATTLIST service type (service|mount|swap|timer) "service">
|
<!ATTLIST service type (service|mount|swap|timer|target) "service">
|
||||||
<!ATTLIST service undisable (True|False) "False">
|
<!ATTLIST service undisable (True|False) "False">
|
||||||
|
|
||||||
<!ELEMENT ip (#PCDATA)>
|
<!ELEMENT ip (#PCDATA)>
|
||||||
|
@ -101,6 +101,7 @@
|
||||||
<!ATTLIST variable hidden (True|False) "False">
|
<!ATTLIST variable hidden (True|False) "False">
|
||||||
<!ATTLIST variable disabled (True|False) "False">
|
<!ATTLIST variable disabled (True|False) "False">
|
||||||
<!ATTLIST variable multi (True|False) "False">
|
<!ATTLIST variable multi (True|False) "False">
|
||||||
|
<!ATTLIST variable unique (nil|True|False) "nil">
|
||||||
<!ATTLIST variable redefine (True|False) "False">
|
<!ATTLIST variable redefine (True|False) "False">
|
||||||
<!ATTLIST variable exists (True|False) "True">
|
<!ATTLIST variable exists (True|False) "True">
|
||||||
<!ATTLIST variable mandatory (True|False) "False">
|
<!ATTLIST variable mandatory (True|False) "False">
|
||||||
|
@ -112,6 +113,7 @@
|
||||||
<!ATTLIST variable remove_condition (True|False) "False">
|
<!ATTLIST variable remove_condition (True|False) "False">
|
||||||
<!ATTLIST variable remove_fill (True|False) "False">
|
<!ATTLIST variable remove_fill (True|False) "False">
|
||||||
<!ATTLIST variable provider CDATA #IMPLIED>
|
<!ATTLIST variable provider CDATA #IMPLIED>
|
||||||
|
<!ATTLIST variable supplier CDATA #IMPLIED>
|
||||||
<!ATTLIST variable test CDATA #IMPLIED>
|
<!ATTLIST variable test CDATA #IMPLIED>
|
||||||
|
|
||||||
<!ELEMENT value (#PCDATA)>
|
<!ELEMENT value (#PCDATA)>
|
||||||
|
|
|
@ -29,7 +29,7 @@ from typing import Optional
|
||||||
|
|
||||||
from .i18n import _
|
from .i18n import _
|
||||||
from .xmlreflector import XMLReflector
|
from .xmlreflector import XMLReflector
|
||||||
from .utils import valid_variable_family_name
|
from .utils import valid_variable_family_name, normalize_family
|
||||||
from .error import SpaceObjShallNotBeUpdated, DictConsistencyError
|
from .error import SpaceObjShallNotBeUpdated, DictConsistencyError
|
||||||
from .path import Path
|
from .path import Path
|
||||||
|
|
||||||
|
@ -106,14 +106,13 @@ class RougailObjSpace:
|
||||||
self.paths = Path(rougailconfig)
|
self.paths = Path(rougailconfig)
|
||||||
|
|
||||||
self.forced_text_elts_as_name = set(FORCED_TEXT_ELTS_AS_NAME)
|
self.forced_text_elts_as_name = set(FORCED_TEXT_ELTS_AS_NAME)
|
||||||
self.list_conditions = {}
|
|
||||||
self.valid_enums = {}
|
|
||||||
self.booleans_attributs = []
|
self.booleans_attributs = []
|
||||||
self.has_dyn_option = False
|
self.has_dyn_option = False
|
||||||
self.types = {}
|
self.types = {}
|
||||||
|
|
||||||
self.make_object_space_classes(xmlreflector)
|
self.make_object_space_classes(xmlreflector)
|
||||||
self.rougailconfig = rougailconfig
|
self.rougailconfig = rougailconfig
|
||||||
|
self.xmlreflector = xmlreflector
|
||||||
|
|
||||||
def make_object_space_classes(self,
|
def make_object_space_classes(self,
|
||||||
xmlreflector: XMLReflector,
|
xmlreflector: XMLReflector,
|
||||||
|
@ -171,13 +170,28 @@ class RougailObjSpace:
|
||||||
document,
|
document,
|
||||||
namespace,
|
namespace,
|
||||||
namespace_description,
|
namespace_description,
|
||||||
|
path_prefix,
|
||||||
):
|
):
|
||||||
"""Parses a Rougail XML file and populates the RougailObjSpace
|
"""Parses a Rougail XML file and populates the RougailObjSpace
|
||||||
"""
|
"""
|
||||||
redefine_variables = []
|
redefine_variables = []
|
||||||
|
if path_prefix:
|
||||||
|
if not hasattr(self.space, 'variables'):
|
||||||
|
self.space.variables = {}
|
||||||
|
n_path_prefix = normalize_family(path_prefix)
|
||||||
|
if n_path_prefix not in self.space.variables:
|
||||||
|
space = self.variables([xmlfile])
|
||||||
|
space.name = n_path_prefix
|
||||||
|
space.doc = path_prefix
|
||||||
|
space.path = path_prefix
|
||||||
|
self.space.variables[n_path_prefix] = space
|
||||||
|
else:
|
||||||
|
space = self.space.variables[n_path_prefix]
|
||||||
|
else:
|
||||||
|
space = self.space
|
||||||
self._xml_parse(xmlfile,
|
self._xml_parse(xmlfile,
|
||||||
document,
|
document,
|
||||||
self.space,
|
space,
|
||||||
namespace,
|
namespace,
|
||||||
namespace_description,
|
namespace_description,
|
||||||
redefine_variables,
|
redefine_variables,
|
||||||
|
@ -196,13 +210,13 @@ class RougailObjSpace:
|
||||||
# var to check unique family name in a XML file
|
# var to check unique family name in a XML file
|
||||||
family_names = []
|
family_names = []
|
||||||
for child in document:
|
for child in document:
|
||||||
if is_dynamic:
|
|
||||||
is_sub_dynamic = True
|
|
||||||
else:
|
|
||||||
is_sub_dynamic = document.attrib.get('dynamic') is not None
|
|
||||||
if not isinstance(child.tag, str):
|
if not isinstance(child.tag, str):
|
||||||
# doesn't proceed the XML commentaries
|
# doesn't proceed the XML commentaries
|
||||||
continue
|
continue
|
||||||
|
if is_dynamic:
|
||||||
|
is_sub_dynamic = True
|
||||||
|
else:
|
||||||
|
is_sub_dynamic = child.attrib.get('dynamic') is not None
|
||||||
if namespace_description and child.tag == 'variables':
|
if namespace_description and child.tag == 'variables':
|
||||||
child.attrib['description'] = namespace_description
|
child.attrib['description'] = namespace_description
|
||||||
if child.tag == 'family':
|
if child.tag == 'family':
|
||||||
|
@ -230,6 +244,7 @@ class RougailObjSpace:
|
||||||
self.remove(child,
|
self.remove(child,
|
||||||
variableobj,
|
variableobj,
|
||||||
redefine_variables,
|
redefine_variables,
|
||||||
|
namespace,
|
||||||
)
|
)
|
||||||
if not exists:
|
if not exists:
|
||||||
self.set_path(namespace,
|
self.set_path(namespace,
|
||||||
|
@ -238,6 +253,11 @@ class RougailObjSpace:
|
||||||
space,
|
space,
|
||||||
is_sub_dynamic,
|
is_sub_dynamic,
|
||||||
)
|
)
|
||||||
|
elif isinstance(variableobj, self.variable):
|
||||||
|
if 'name' in document.attrib:
|
||||||
|
family_name = document.attrib['name']
|
||||||
|
else:
|
||||||
|
family_name = namespace
|
||||||
self.add_to_tree_structure(variableobj,
|
self.add_to_tree_structure(variableobj,
|
||||||
space,
|
space,
|
||||||
child,
|
child,
|
||||||
|
@ -324,10 +344,10 @@ class RougailObjSpace:
|
||||||
redefine = convert_boolean(subspace.get('redefine', default_redefine))
|
redefine = convert_boolean(subspace.get('redefine', default_redefine))
|
||||||
if redefine is True:
|
if redefine is True:
|
||||||
if isinstance(existed_var, self.variable): # pylint: disable=E1101
|
if isinstance(existed_var, self.variable): # pylint: disable=E1101
|
||||||
if namespace == self.rougailconfig['variable_namespace']:
|
# if namespace == self.rougailconfig['variable_namespace']:
|
||||||
redefine_variables.append(name)
|
# redefine_variables.append(name)
|
||||||
else:
|
# else:
|
||||||
redefine_variables.append(space.path + '.' + name)
|
redefine_variables.append(space.path + '.' + name)
|
||||||
existed_var.xmlfiles.append(xmlfile)
|
existed_var.xmlfiles.append(xmlfile)
|
||||||
return True, existed_var
|
return True, existed_var
|
||||||
exists = convert_boolean(subspace.get('exists', True))
|
exists = convert_boolean(subspace.get('exists', True))
|
||||||
|
@ -355,7 +375,7 @@ class RougailObjSpace:
|
||||||
def get_existed_obj(self,
|
def get_existed_obj(self,
|
||||||
name: str,
|
name: str,
|
||||||
xmlfile: str,
|
xmlfile: str,
|
||||||
space: str,
|
space,
|
||||||
child,
|
child,
|
||||||
namespace: str,
|
namespace: str,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
@ -366,20 +386,19 @@ class RougailObjSpace:
|
||||||
if child.tag == 'variable': # pylint: disable=E1101
|
if child.tag == 'variable': # pylint: disable=E1101
|
||||||
if namespace != self.rougailconfig['variable_namespace']:
|
if namespace != self.rougailconfig['variable_namespace']:
|
||||||
name = space.path + '.' + name
|
name = space.path + '.' + name
|
||||||
if not self.paths.path_is_defined(name):
|
if not self.paths.path_is_defined(name, namespace):
|
||||||
return None
|
return None
|
||||||
old_family_name = self.paths.get_variable_family_path(name)
|
old_family_name = self.paths.get_variable_family_path(name, namespace)
|
||||||
if space.path != old_family_name:
|
if space.path != old_family_name:
|
||||||
msg = _(f'Variable "{name}" was previously create in family "{old_family_name}", '
|
msg = _(f'Variable "{name}" was previously create in family "{old_family_name}", '
|
||||||
f'now it is in "{space.path}"')
|
f'now it is in "{space.path}"')
|
||||||
raise DictConsistencyError(msg, 47, space.xmlfiles)
|
raise DictConsistencyError(msg, 47, space.xmlfiles)
|
||||||
return self.paths.get_variable(name)
|
return self.paths.get_variable(name, namespace)
|
||||||
# it's not a family
|
# it's not a variable
|
||||||
tag = FORCE_TAG.get(child.tag, child.tag)
|
tag = FORCE_TAG.get(child.tag, child.tag)
|
||||||
children = getattr(space, tag, {})
|
children = getattr(space, tag, {})
|
||||||
if name in children and isinstance(children[name], getattr(self, child.tag)):
|
if name in children and isinstance(children[name], getattr(self, child.tag)):
|
||||||
return children[name]
|
return children[name]
|
||||||
return None
|
|
||||||
|
|
||||||
def set_text(self,
|
def set_text(self,
|
||||||
child,
|
child,
|
||||||
|
@ -422,6 +441,7 @@ class RougailObjSpace:
|
||||||
child,
|
child,
|
||||||
variableobj,
|
variableobj,
|
||||||
redefine_variables,
|
redefine_variables,
|
||||||
|
namespace,
|
||||||
):
|
):
|
||||||
"""Rougail object tree manipulations
|
"""Rougail object tree manipulations
|
||||||
"""
|
"""
|
||||||
|
@ -438,23 +458,34 @@ class RougailObjSpace:
|
||||||
self.remove_condition(variableobj.name)
|
self.remove_condition(variableobj.name)
|
||||||
if child.attrib.get('remove_fill', False):
|
if child.attrib.get('remove_fill', False):
|
||||||
self.remove_fill(variableobj.name)
|
self.remove_fill(variableobj.name)
|
||||||
if child.tag == 'fill':
|
elif child.tag == 'fill':
|
||||||
for target in child:
|
for target in child:
|
||||||
if target.tag == 'target' and target.text in redefine_variables:
|
if target.tag == 'target' and \
|
||||||
|
self.paths.get_path(target.text, namespace) in redefine_variables:
|
||||||
self.remove_fill(target.text)
|
self.remove_fill(target.text)
|
||||||
|
|
||||||
def remove_check(self, name):
|
def remove_check(self, name):
|
||||||
"""Remove a check with a specified target
|
"""Remove a check with a specified target
|
||||||
"""
|
"""
|
||||||
if hasattr(self.space.constraints, 'check'):
|
constraints = self.get_constraints()
|
||||||
remove_checks = []
|
if not constraints or not hasattr(constraints, 'check'):
|
||||||
for idx, check in enumerate(self.space.constraints.check): # pylint: disable=E1101
|
return
|
||||||
for target in check.target:
|
remove_checks = []
|
||||||
if target.name == name:
|
for idx, check in enumerate(constraints.check): # pylint: disable=E1101
|
||||||
remove_checks.append(idx)
|
for target in check.target:
|
||||||
remove_checks.sort(reverse=True)
|
if target.name == name:
|
||||||
for idx in remove_checks:
|
remove_checks.append(idx)
|
||||||
self.space.constraints.check.pop(idx) # pylint: disable=E1101
|
remove_checks.sort(reverse=True)
|
||||||
|
for idx in remove_checks:
|
||||||
|
constraints.check.pop(idx) # pylint: disable=E1101
|
||||||
|
|
||||||
|
def get_constraints(self):
|
||||||
|
path_prefix = self.paths.get_path_prefix()
|
||||||
|
if not path_prefix:
|
||||||
|
if hasattr(self.space, 'constraints'):
|
||||||
|
return self.space.constraints
|
||||||
|
elif hasattr(self.space.variables[path_prefix], 'constraints'):
|
||||||
|
return self.space.variables[path_prefix].constraints
|
||||||
|
|
||||||
def remove_condition(self,
|
def remove_condition(self,
|
||||||
name: str,
|
name: str,
|
||||||
|
@ -462,12 +493,13 @@ class RougailObjSpace:
|
||||||
"""Remove a condition with a specified source
|
"""Remove a condition with a specified source
|
||||||
"""
|
"""
|
||||||
remove_conditions = []
|
remove_conditions = []
|
||||||
for idx, condition in enumerate(self.space.constraints.condition): # pylint: disable=E1101
|
constraints = self.get_constraints()
|
||||||
|
for idx, condition in enumerate(constraints.condition): # pylint: disable=E1101
|
||||||
if condition.source == name:
|
if condition.source == name:
|
||||||
remove_conditions.append(idx)
|
remove_conditions.append(idx)
|
||||||
remove_conditions.sort(reverse=True)
|
remove_conditions.sort(reverse=True)
|
||||||
for idx in remove_conditions:
|
for idx in remove_conditions:
|
||||||
del self.space.constraints.condition[idx] # pylint: disable=E1101
|
del constraints.condition[idx] # pylint: disable=E1101
|
||||||
|
|
||||||
def remove_fill(self,
|
def remove_fill(self,
|
||||||
name: str,
|
name: str,
|
||||||
|
@ -475,13 +507,14 @@ class RougailObjSpace:
|
||||||
"""Remove a fill with a specified target
|
"""Remove a fill with a specified target
|
||||||
"""
|
"""
|
||||||
remove_fills = []
|
remove_fills = []
|
||||||
for idx, fill in enumerate(self.space.constraints.fill): # pylint: disable=E1101
|
constraints = self.get_constraints()
|
||||||
|
for idx, fill in enumerate(constraints.fill): # pylint: disable=E1101
|
||||||
for target in fill.target:
|
for target in fill.target:
|
||||||
if target.name == name:
|
if target.name == name:
|
||||||
remove_fills.append(idx)
|
remove_fills.append(idx)
|
||||||
remove_fills.sort(reverse=True)
|
remove_fills.sort(reverse=True)
|
||||||
for idx in remove_fills:
|
for idx in remove_fills:
|
||||||
self.space.constraints.fill.pop(idx) # pylint: disable=E1101
|
constraints.fill.pop(idx) # pylint: disable=E1101
|
||||||
|
|
||||||
def set_path(self,
|
def set_path(self,
|
||||||
namespace,
|
namespace,
|
||||||
|
@ -493,33 +526,24 @@ class RougailObjSpace:
|
||||||
"""Fill self.paths attributes
|
"""Fill self.paths attributes
|
||||||
"""
|
"""
|
||||||
if isinstance(variableobj, self.variable): # pylint: disable=E1101
|
if isinstance(variableobj, self.variable): # pylint: disable=E1101
|
||||||
if 'name' in document.attrib:
|
|
||||||
family_name = document.attrib['name']
|
|
||||||
else:
|
|
||||||
family_name = namespace
|
|
||||||
|
|
||||||
if isinstance(space, self.family) and space.leadership:
|
|
||||||
leader = space.path
|
|
||||||
else:
|
|
||||||
leader = None
|
|
||||||
self.paths.add_variable(namespace,
|
self.paths.add_variable(namespace,
|
||||||
variableobj.name,
|
|
||||||
space.path,
|
space.path,
|
||||||
is_dynamic,
|
|
||||||
variableobj,
|
variableobj,
|
||||||
leader,
|
is_dynamic,
|
||||||
|
isinstance(space, self.family) and space.leadership,
|
||||||
)
|
)
|
||||||
elif isinstance(variableobj, self.family): # pylint: disable=E1101
|
elif isinstance(variableobj, self.family): # pylint: disable=E1101
|
||||||
family_name = variableobj.name
|
|
||||||
if namespace != self.rougailconfig['variable_namespace']:
|
|
||||||
family_name = space.path + '.' + family_name
|
|
||||||
self.paths.add_family(namespace,
|
self.paths.add_family(namespace,
|
||||||
family_name,
|
|
||||||
variableobj,
|
|
||||||
space.path,
|
space.path,
|
||||||
|
variableobj,
|
||||||
|
is_dynamic,
|
||||||
)
|
)
|
||||||
elif isinstance(variableobj, self.variables):
|
elif isinstance(variableobj, self.variables):
|
||||||
variableobj.path = variableobj.name
|
path_prefix = self.paths.get_path_prefix()
|
||||||
|
if path_prefix:
|
||||||
|
variableobj.path = path_prefix + '.' + variableobj.name
|
||||||
|
else:
|
||||||
|
variableobj.path = variableobj.name
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def add_to_tree_structure(variableobj,
|
def add_to_tree_structure(variableobj,
|
||||||
|
@ -538,3 +562,22 @@ class RougailObjSpace:
|
||||||
getattr(space, child.tag).append(variableobj)
|
getattr(space, child.tag).append(variableobj)
|
||||||
else:
|
else:
|
||||||
setattr(space, child.tag, variableobj)
|
setattr(space, child.tag, variableobj)
|
||||||
|
|
||||||
|
|
||||||
|
def get_variables(objectspace):
|
||||||
|
"""Iter all variables from the objectspace
|
||||||
|
"""
|
||||||
|
for family in objectspace.space.variables.values():
|
||||||
|
yield from _get_variables(family, objectspace.family)
|
||||||
|
|
||||||
|
|
||||||
|
def _get_variables(family, family_type):
|
||||||
|
if hasattr(family, 'variable'):
|
||||||
|
for variable in family.variable.values():
|
||||||
|
if isinstance(variable, family_type):
|
||||||
|
yield from _get_variables(variable, family_type)
|
||||||
|
else:
|
||||||
|
yield variable
|
||||||
|
if hasattr(family, 'variables'):
|
||||||
|
for family in family.variables.values():
|
||||||
|
yield from _get_variables(family, family_type)
|
||||||
|
|
|
@ -40,138 +40,293 @@ class Path:
|
||||||
) -> None:
|
) -> None:
|
||||||
self.variables = {}
|
self.variables = {}
|
||||||
self.families = {}
|
self.families = {}
|
||||||
|
#self.names = {}
|
||||||
self.full_paths_families = {}
|
self.full_paths_families = {}
|
||||||
self.full_paths_variables = {}
|
self.full_paths_variables = {}
|
||||||
|
self.full_dyn_paths_families = {}
|
||||||
|
self.valid_enums = {}
|
||||||
self.variable_namespace = rougailconfig['variable_namespace']
|
self.variable_namespace = rougailconfig['variable_namespace']
|
||||||
|
self.providers = {}
|
||||||
|
self.suppliers = {}
|
||||||
|
self.list_conditions = {}
|
||||||
|
self.suffix = rougailconfig['suffix']
|
||||||
|
self.index = 0
|
||||||
|
|
||||||
|
def set_path_prefix(self, prefix: str) -> None:
|
||||||
|
self._path_prefix = prefix
|
||||||
|
if prefix:
|
||||||
|
if None in self.full_paths_families:
|
||||||
|
raise DictConsistencyError(_(f'prefix "{prefix}" cannot be set if a prefix "None" exists'), 39, None)
|
||||||
|
else:
|
||||||
|
for old_prefix in self.full_paths_families:
|
||||||
|
if old_prefix != None:
|
||||||
|
raise DictConsistencyError(_(f'no prefix cannot be set if a prefix exists'), 84, None)
|
||||||
|
if prefix in self.full_paths_families:
|
||||||
|
raise DictConsistencyError(_(f'prefix "{prefix}" already exists'), 83, None)
|
||||||
|
self.full_paths_families[prefix] = {}
|
||||||
|
self.full_paths_variables[prefix] = {}
|
||||||
|
self.valid_enums[prefix] = {}
|
||||||
|
self.providers[prefix] = {}
|
||||||
|
self.suppliers[prefix] = {}
|
||||||
|
self.list_conditions[prefix] = {}
|
||||||
|
|
||||||
|
def has_path_prefix(self) -> bool:
|
||||||
|
return None not in self.full_paths_families
|
||||||
|
|
||||||
|
def get_path_prefixes(self) -> list:
|
||||||
|
return list(self.full_paths_families)
|
||||||
|
|
||||||
|
def get_path_prefix(self) -> str:
|
||||||
|
return self._path_prefix
|
||||||
|
|
||||||
# Family
|
# Family
|
||||||
def add_family(self,
|
def add_family(self,
|
||||||
namespace: str,
|
namespace: str,
|
||||||
name: str,
|
|
||||||
variableobj: str,
|
|
||||||
subpath: str,
|
subpath: str,
|
||||||
|
variableobj: str,
|
||||||
|
is_dynamic: str,
|
||||||
|
force_path_prefix: str=None,
|
||||||
) -> str: # pylint: disable=C0111
|
) -> str: # pylint: disable=C0111
|
||||||
"""Add a new family
|
"""Add a new family
|
||||||
"""
|
"""
|
||||||
|
if force_path_prefix is None:
|
||||||
|
force_path_prefix = self._path_prefix
|
||||||
|
path = subpath + '.' + variableobj.name
|
||||||
if namespace == self.variable_namespace:
|
if namespace == self.variable_namespace:
|
||||||
full_name = '.'.join([subpath, name])
|
if variableobj.name in self.full_paths_families[force_path_prefix]:
|
||||||
if name in self.full_paths_families:
|
msg = _(f'Duplicate family name "{variableobj.name}"')
|
||||||
msg = _(f'Duplicate family name "{name}"')
|
|
||||||
raise DictConsistencyError(msg, 55, variableobj.xmlfiles)
|
raise DictConsistencyError(msg, 55, variableobj.xmlfiles)
|
||||||
self.full_paths_families[name] = full_name
|
self.full_paths_families[force_path_prefix][variableobj.name] = path
|
||||||
else:
|
if is_dynamic:
|
||||||
if '.' not in name: # pragma: no cover
|
if subpath in self.full_dyn_paths_families:
|
||||||
msg = _(f'Variable "{name}" in namespace "{namespace}" must have dot')
|
dyn_subpath = self.full_dyn_paths_families[subpath]
|
||||||
raise DictConsistencyError(msg, 39, variableobj.xmlfiles)
|
else:
|
||||||
full_name = name
|
dyn_subpath = subpath
|
||||||
if full_name in self.families and \
|
self.full_dyn_paths_families[path] = f'{dyn_subpath}.{variableobj.name}{{suffix}}'
|
||||||
self.families[full_name]['variableobj'] != variableobj: # pragma: no cover
|
if path in self.families:
|
||||||
msg = _(f'Duplicate family name "{name}"')
|
msg = _(f'Duplicate family name "{path}"')
|
||||||
raise DictConsistencyError(msg, 37, variableobj.xmlfiles)
|
raise DictConsistencyError(msg, 37, variableobj.xmlfiles)
|
||||||
if full_name in self.variables:
|
if path in self.variables:
|
||||||
msg = _(f'A variable and a family has the same path "{full_name}"')
|
msg = _(f'A variable and a family has the same path "{path}"')
|
||||||
raise DictConsistencyError(msg, 56, variableobj.xmlfiles)
|
raise DictConsistencyError(msg, 56, variableobj.xmlfiles)
|
||||||
self.families[full_name] = dict(name=name,
|
self.families[path] = dict(name=path,
|
||||||
namespace=namespace,
|
namespace=namespace,
|
||||||
variableobj=variableobj,
|
variableobj=variableobj,
|
||||||
)
|
)
|
||||||
variableobj.path = full_name
|
self.set_name(variableobj, 'optiondescription_')
|
||||||
|
variableobj.path = path
|
||||||
|
variableobj.path_prefix = force_path_prefix
|
||||||
|
|
||||||
def get_family(self,
|
def get_family(self,
|
||||||
name: str,
|
path: str,
|
||||||
current_namespace: str,
|
current_namespace: str,
|
||||||
|
path_prefix: str,
|
||||||
|
allow_variable_namespace: bool=False,
|
||||||
) -> 'Family': # pylint: disable=C0111
|
) -> 'Family': # pylint: disable=C0111
|
||||||
"""Get a family
|
"""Get a family
|
||||||
"""
|
"""
|
||||||
name = '.'.join([normalize_family(subname) for subname in name.split('.')])
|
if (current_namespace == self.variable_namespace or allow_variable_namespace) and path in self.full_paths_families[path_prefix]:
|
||||||
if name not in self.families and name in self.full_paths_families:
|
path = self.full_paths_families[path_prefix][path]
|
||||||
name = self.full_paths_families[name]
|
elif allow_variable_namespace and path_prefix:
|
||||||
if name not in self.families:
|
path = f'{path_prefix}.{path}'
|
||||||
raise DictConsistencyError(_(f'unknown option {name}'), 42, [])
|
if path not in self.families:
|
||||||
dico = self.families[name]
|
raise DictConsistencyError(_(f'unknown option "{path}"'), 42, [])
|
||||||
if current_namespace not in [self.variable_namespace, 'services'] and \
|
dico = self.families[path]
|
||||||
current_namespace != dico['namespace']:
|
if current_namespace != dico['namespace'] and \
|
||||||
|
(not allow_variable_namespace or current_namespace != self.variable_namespace):
|
||||||
msg = _(f'A family located in the "{dico["namespace"]}" namespace '
|
msg = _(f'A family located in the "{dico["namespace"]}" namespace '
|
||||||
f'shall not be used in the "{current_namespace}" namespace')
|
f'shall not be used in the "{current_namespace}" namespace')
|
||||||
raise DictConsistencyError(msg, 38, [])
|
raise DictConsistencyError(msg, 38, [])
|
||||||
return dico['variableobj']
|
return dico['variableobj']
|
||||||
|
|
||||||
def is_leader(self, path): # pylint: disable=C0111
|
def _get_dyn_path(self,
|
||||||
"""Is the variable is a leader
|
subpath: str,
|
||||||
"""
|
name: bool,
|
||||||
variable = self._get_variable(path)
|
) -> str:
|
||||||
if not variable['leader']:
|
if subpath in self.full_dyn_paths_families:
|
||||||
return False
|
subpath = self.full_dyn_paths_families[subpath]
|
||||||
leadership = self.get_family(variable['leader'], variable['variableobj'].namespace)
|
path = f'{subpath}.{name}{{suffix}}'
|
||||||
return next(iter(leadership.variable.values())).path == path
|
else:
|
||||||
|
path = f'{subpath}.{name}'
|
||||||
|
return path
|
||||||
|
|
||||||
def is_follower(self, path):
|
def set_provider(self,
|
||||||
"""Is the variable is a follower
|
variableobj,
|
||||||
"""
|
name,
|
||||||
variable = self._get_variable(path)
|
family,
|
||||||
if not variable['leader']:
|
):
|
||||||
return False
|
if not hasattr(variableobj, 'provider'):
|
||||||
leadership = self.get_family(variable['leader'], variable['variableobj'].namespace)
|
return
|
||||||
return next(iter(leadership.variable.values())).path != path
|
p_name = 'provider:' + variableobj.provider
|
||||||
|
if '.' in name:
|
||||||
|
msg = f'provider "{p_name}" not allowed in extra'
|
||||||
|
raise DictConsistencyError(msg, 82, variableobj.xmlfiles)
|
||||||
|
if p_name in self.providers[variableobj.path_prefix]:
|
||||||
|
msg = f'provider "{p_name}" declare multiple time'
|
||||||
|
raise DictConsistencyError(msg, 79, variableobj.xmlfiles)
|
||||||
|
self.providers[variableobj.path_prefix][p_name] = {'path': self._get_dyn_path(family,
|
||||||
|
name,
|
||||||
|
),
|
||||||
|
'option': variableobj,
|
||||||
|
}
|
||||||
|
|
||||||
|
def get_provider(self,
|
||||||
|
name: str,
|
||||||
|
path_prefix: str=None,
|
||||||
|
) -> 'self.objectspace.variable':
|
||||||
|
return self.providers[path_prefix][name]['option']
|
||||||
|
|
||||||
|
|
||||||
|
def get_providers_path(self, path_prefix=None):
|
||||||
|
if path_prefix:
|
||||||
|
return {name: option['path'].split('.', 1)[-1] for name, option in self.providers[path_prefix].items()}
|
||||||
|
return {name: option['path'] for name, option in self.providers[path_prefix].items()}
|
||||||
|
|
||||||
|
def set_supplier(self,
|
||||||
|
variableobj,
|
||||||
|
name,
|
||||||
|
family,
|
||||||
|
):
|
||||||
|
if not hasattr(variableobj, 'supplier'):
|
||||||
|
return
|
||||||
|
s_name = 'supplier:' + variableobj.supplier
|
||||||
|
if '.' in name:
|
||||||
|
msg = f'supplier "{s_name}" not allowed in extra'
|
||||||
|
raise DictConsistencyError(msg, 82, variableobj.xmlfiles)
|
||||||
|
if s_name in self.suppliers[variableobj.path_prefix]:
|
||||||
|
msg = f'supplier "{s_name}" declare multiple time'
|
||||||
|
raise DictConsistencyError(msg, 79, variableobj.xmlfiles)
|
||||||
|
self.suppliers[variableobj.path_prefix][s_name] = {'path': self._get_dyn_path(family,
|
||||||
|
name),
|
||||||
|
'option': variableobj,
|
||||||
|
}
|
||||||
|
|
||||||
|
def get_supplier(self,
|
||||||
|
name: str,
|
||||||
|
path_prefix: str=None,
|
||||||
|
) -> 'self.objectspace.variable':
|
||||||
|
return self.suppliers[path_prefix][name]['option']
|
||||||
|
|
||||||
|
def get_suppliers_path(self, path_prefix=None):
|
||||||
|
if path_prefix:
|
||||||
|
return {name: option['path'].split('.', 1)[-1] for name, option in self.suppliers[path_prefix].items()}
|
||||||
|
return {name: option['path'] for name, option in self.suppliers[path_prefix].items()}
|
||||||
|
|
||||||
# Variable
|
# Variable
|
||||||
def add_variable(self, # pylint: disable=R0913
|
def add_variable(self, # pylint: disable=R0913
|
||||||
namespace: str,
|
namespace: str,
|
||||||
name: str,
|
subpath: str,
|
||||||
family: str,
|
variableobj: "self.objectspace.variable",
|
||||||
is_dynamic: bool,
|
is_dynamic: bool=False,
|
||||||
variableobj,
|
is_leader: bool=False,
|
||||||
leader: 'self.objectspace.family'=None,
|
force_path_prefix: str=None,
|
||||||
) -> str: # pylint: disable=C0111
|
) -> str: # pylint: disable=C0111
|
||||||
"""Add a new variable (with path)
|
"""Add a new variable (with path)
|
||||||
"""
|
"""
|
||||||
if '.' not in name:
|
if force_path_prefix is None:
|
||||||
full_path = '.'.join([family, name])
|
force_path_prefix = self._path_prefix
|
||||||
if namespace == self.variable_namespace:
|
path = subpath + '.' + variableobj.name
|
||||||
self.full_paths_variables[name] = full_path
|
if namespace == self.variable_namespace:
|
||||||
else:
|
self.full_paths_variables[force_path_prefix][variableobj.name] = path
|
||||||
full_path = name
|
if path in self.families:
|
||||||
variableobj.path = full_path
|
msg = _(f'A family and a variable has the same path "{path}"')
|
||||||
if full_path in self.families:
|
|
||||||
msg = _(f'A family and a variable has the same path "{full_path}"')
|
|
||||||
raise DictConsistencyError(msg, 57, variableobj.xmlfiles)
|
raise DictConsistencyError(msg, 57, variableobj.xmlfiles)
|
||||||
self.variables[full_path] = dict(name=name,
|
if is_leader:
|
||||||
family=family,
|
leader = subpath
|
||||||
leader=leader,
|
else:
|
||||||
is_dynamic=is_dynamic,
|
leader = None
|
||||||
variableobj=variableobj,
|
self.variables[path] = dict(name=path,
|
||||||
)
|
family=subpath,
|
||||||
|
leader=leader,
|
||||||
|
is_dynamic=is_dynamic,
|
||||||
|
variableobj=variableobj,
|
||||||
|
)
|
||||||
|
variableobj.path = path
|
||||||
|
variableobj.path_prefix = force_path_prefix
|
||||||
|
self.set_name(variableobj, 'option_')
|
||||||
|
|
||||||
|
def set_name(self,
|
||||||
|
variableobj,
|
||||||
|
option_prefix,
|
||||||
|
):
|
||||||
|
self.index += 1
|
||||||
|
variableobj.reflector_name = f'{option_prefix}{self.index}{self.suffix}'
|
||||||
|
|
||||||
def get_variable(self,
|
def get_variable(self,
|
||||||
name: str,
|
name: str,
|
||||||
|
namespace: str,
|
||||||
xmlfiles: List[str]=[],
|
xmlfiles: List[str]=[],
|
||||||
|
allow_variable_namespace: bool=False,
|
||||||
|
force_path_prefix: str=None,
|
||||||
|
add_path_prefix: bool=False,
|
||||||
) -> 'Variable': # pylint: disable=C0111
|
) -> 'Variable': # pylint: disable=C0111
|
||||||
"""Get variable object from a path
|
"""Get variable object from a path
|
||||||
"""
|
"""
|
||||||
variable, suffix = self._get_variable(name, with_suffix=True, xmlfiles=xmlfiles)
|
if force_path_prefix is None:
|
||||||
|
force_path_prefix = self._path_prefix
|
||||||
|
try:
|
||||||
|
variable, suffix = self._get_variable(name,
|
||||||
|
namespace,
|
||||||
|
with_suffix=True,
|
||||||
|
xmlfiles=xmlfiles,
|
||||||
|
path_prefix=force_path_prefix,
|
||||||
|
add_path_prefix=add_path_prefix,
|
||||||
|
)
|
||||||
|
except DictConsistencyError as err:
|
||||||
|
if not allow_variable_namespace or err.errno != 42 or namespace == self.variable_namespace:
|
||||||
|
raise err from err
|
||||||
|
variable, suffix = self._get_variable(name,
|
||||||
|
self.variable_namespace,
|
||||||
|
with_suffix=True,
|
||||||
|
xmlfiles=xmlfiles,
|
||||||
|
path_prefix=force_path_prefix,
|
||||||
|
)
|
||||||
if suffix:
|
if suffix:
|
||||||
raise DictConsistencyError(_(f"{name} is a dynamic variable"), 36, [])
|
raise DictConsistencyError(_(f"{name} is a dynamic variable"), 36, [])
|
||||||
return variable['variableobj']
|
return variable['variableobj']
|
||||||
|
|
||||||
def get_variable_family_path(self,
|
def get_variable_family_path(self,
|
||||||
name: str,
|
name: str,
|
||||||
|
namespace: str,
|
||||||
xmlfiles: List[str]=False,
|
xmlfiles: List[str]=False,
|
||||||
|
force_path_prefix: str=None,
|
||||||
) -> str: # pylint: disable=C0111
|
) -> str: # pylint: disable=C0111
|
||||||
"""Get the full path of a family
|
"""Get the full path of a family
|
||||||
"""
|
"""
|
||||||
return self._get_variable(name, xmlfiles=xmlfiles)['family']
|
if force_path_prefix is None:
|
||||||
|
force_path_prefix = self._path_prefix
|
||||||
|
return self._get_variable(name,
|
||||||
|
namespace,
|
||||||
|
xmlfiles=xmlfiles,
|
||||||
|
path_prefix=force_path_prefix,
|
||||||
|
)['family']
|
||||||
|
|
||||||
def get_variable_path(self,
|
def get_variable_with_suffix(self,
|
||||||
name: str,
|
name: str,
|
||||||
current_namespace: str,
|
current_namespace: str,
|
||||||
xmlfiles: List[str]=[],
|
xmlfiles: List[str],
|
||||||
) -> str: # pylint: disable=C0111
|
path_prefix: str,
|
||||||
|
) -> str: # pylint: disable=C0111
|
||||||
"""get full path of a variable
|
"""get full path of a variable
|
||||||
"""
|
"""
|
||||||
dico, suffix = self._get_variable(name,
|
try:
|
||||||
with_suffix=True,
|
dico, suffix = self._get_variable(name,
|
||||||
xmlfiles=xmlfiles,
|
current_namespace,
|
||||||
)
|
with_suffix=True,
|
||||||
|
xmlfiles=xmlfiles,
|
||||||
|
path_prefix=path_prefix,
|
||||||
|
add_path_prefix=True,
|
||||||
|
)
|
||||||
|
except DictConsistencyError as err:
|
||||||
|
if err.errno != 42 or current_namespace == self.variable_namespace:
|
||||||
|
raise err from err
|
||||||
|
dico, suffix = self._get_variable(name,
|
||||||
|
self.variable_namespace,
|
||||||
|
with_suffix=True,
|
||||||
|
xmlfiles=xmlfiles,
|
||||||
|
path_prefix=path_prefix,
|
||||||
|
add_path_prefix=True,
|
||||||
|
)
|
||||||
namespace = dico['variableobj'].namespace
|
namespace = dico['variableobj'].namespace
|
||||||
if namespace not in [self.variable_namespace, 'services'] and \
|
if namespace not in [self.variable_namespace, 'services'] and \
|
||||||
current_namespace != 'services' and \
|
current_namespace != 'services' and \
|
||||||
|
@ -179,41 +334,131 @@ class Path:
|
||||||
msg = _(f'A variable located in the "{namespace}" namespace shall not be used '
|
msg = _(f'A variable located in the "{namespace}" namespace shall not be used '
|
||||||
f'in the "{current_namespace}" namespace')
|
f'in the "{current_namespace}" namespace')
|
||||||
raise DictConsistencyError(msg, 41, xmlfiles)
|
raise DictConsistencyError(msg, 41, xmlfiles)
|
||||||
return dico['variableobj'].path, suffix
|
return dico['variableobj'], suffix
|
||||||
|
|
||||||
def path_is_defined(self,
|
def path_is_defined(self,
|
||||||
path: str,
|
path: str,
|
||||||
|
namespace: str,
|
||||||
|
force_path_prefix: str=None,
|
||||||
) -> str: # pylint: disable=C0111
|
) -> str: # pylint: disable=C0111
|
||||||
"""The path is a valid path
|
"""The path is a valid path
|
||||||
"""
|
"""
|
||||||
if '.' not in path and path not in self.variables and path in self.full_paths_variables:
|
if namespace == self.variable_namespace:
|
||||||
return True
|
if force_path_prefix is None:
|
||||||
|
force_path_prefix = self._path_prefix
|
||||||
|
return path in self.full_paths_variables[force_path_prefix]
|
||||||
return path in self.variables
|
return path in self.variables
|
||||||
|
|
||||||
def variable_is_dynamic(self,
|
def get_path(self,
|
||||||
name: str,
|
path: str,
|
||||||
) -> bool:
|
namespace: str,
|
||||||
|
) -> str:
|
||||||
|
if namespace == self.variable_namespace:
|
||||||
|
if path not in self.full_paths_variables[self._path_prefix]:
|
||||||
|
return None
|
||||||
|
path = self.full_paths_variables[self._path_prefix][path]
|
||||||
|
else:
|
||||||
|
path = f'{self._path_prefix}.{path}'
|
||||||
|
return path
|
||||||
|
|
||||||
|
def is_dynamic(self, variableobj) -> bool:
|
||||||
"""This variable is in dynamic family
|
"""This variable is in dynamic family
|
||||||
"""
|
"""
|
||||||
return self._get_variable(name)['is_dynamic']
|
return self._get_variable(variableobj.path,
|
||||||
|
variableobj.namespace,
|
||||||
|
path_prefix=variableobj.path_prefix,
|
||||||
|
)['is_dynamic']
|
||||||
|
|
||||||
|
def is_leader(self, variableobj): # pylint: disable=C0111
|
||||||
|
"""Is the variable is a leader
|
||||||
|
"""
|
||||||
|
path = variableobj.path
|
||||||
|
variable = self._get_variable(path,
|
||||||
|
variableobj.namespace,
|
||||||
|
path_prefix=variableobj.path_prefix,
|
||||||
|
)
|
||||||
|
if not variable['leader']:
|
||||||
|
return False
|
||||||
|
leadership = self.get_family(variable['leader'],
|
||||||
|
variableobj.namespace,
|
||||||
|
path_prefix=variableobj.path_prefix,
|
||||||
|
)
|
||||||
|
return next(iter(leadership.variable.values())).path == path
|
||||||
|
|
||||||
|
def is_follower(self, variableobj) -> bool:
|
||||||
|
"""Is the variable is a follower
|
||||||
|
"""
|
||||||
|
variable = self._get_variable(variableobj.path,
|
||||||
|
variableobj.namespace,
|
||||||
|
path_prefix=variableobj.path_prefix,
|
||||||
|
)
|
||||||
|
if not variable['leader']:
|
||||||
|
return False
|
||||||
|
leadership = self.get_family(variable['leader'],
|
||||||
|
variableobj.namespace,
|
||||||
|
path_prefix=variableobj.path_prefix,
|
||||||
|
)
|
||||||
|
return next(iter(leadership.variable.values())).path != variableobj.path
|
||||||
|
|
||||||
|
def get_leader(self, variableobj) -> str:
|
||||||
|
variable = self._get_variable(variableobj.path,
|
||||||
|
variableobj.namespace,
|
||||||
|
path_prefix=variableobj.path_prefix,
|
||||||
|
)
|
||||||
|
if not variable['leader']:
|
||||||
|
raise Exception(f'cannot find leader for {variableobj.path}')
|
||||||
|
leadership = self.get_family(variable['leader'],
|
||||||
|
variableobj.namespace,
|
||||||
|
path_prefix=variableobj.path_prefix,
|
||||||
|
)
|
||||||
|
return next(iter(leadership.variable.values()))
|
||||||
|
|
||||||
def _get_variable(self,
|
def _get_variable(self,
|
||||||
name: str,
|
path: str,
|
||||||
|
namespace: str,
|
||||||
with_suffix: bool=False,
|
with_suffix: bool=False,
|
||||||
xmlfiles: List[str]=[],
|
xmlfiles: List[str]=[],
|
||||||
|
path_prefix: str=None,
|
||||||
|
add_path_prefix: bool=False,
|
||||||
) -> str:
|
) -> str:
|
||||||
name = '.'.join([normalize_family(subname) for subname in name.split('.')])
|
if namespace == self.variable_namespace:
|
||||||
if name not in self.variables:
|
if path in self.full_paths_variables[path_prefix]:
|
||||||
if '.' not in name and name in self.full_paths_variables:
|
path = self.full_paths_variables[path_prefix][path]
|
||||||
name = self.full_paths_variables[name]
|
else:
|
||||||
elif with_suffix:
|
if with_suffix:
|
||||||
for var_name, full_path in self.full_paths_variables.items():
|
for var_name, full_path in self.full_paths_variables[path_prefix].items():
|
||||||
if name.startswith(var_name):
|
if not path.startswith(var_name):
|
||||||
variable = self._get_variable(full_path)
|
continue
|
||||||
if variable['is_dynamic']:
|
variable = self._get_variable(full_path, namespace, path_prefix=path_prefix)
|
||||||
return variable, name[len(var_name):]
|
if not variable['is_dynamic']:
|
||||||
if name not in self.variables:
|
continue
|
||||||
raise DictConsistencyError(_(f'unknown option "{name}"'), 42, xmlfiles)
|
return variable, path[len(var_name):]
|
||||||
|
if path_prefix and add_path_prefix:
|
||||||
|
path = f'{path_prefix}.{path}'
|
||||||
|
elif path_prefix and add_path_prefix:
|
||||||
|
path = f'{path_prefix}.{path}'
|
||||||
|
#FIXME with_suffix and variable in extra?
|
||||||
|
if path not in self.variables:
|
||||||
|
raise DictConsistencyError(_(f'unknown option "{path}"'), 42, xmlfiles)
|
||||||
if with_suffix:
|
if with_suffix:
|
||||||
return self.variables[name], None
|
return self.variables[path], None
|
||||||
return self.variables[name]
|
return self.variables[path]
|
||||||
|
|
||||||
|
def set_valid_enums(self,
|
||||||
|
path,
|
||||||
|
values,
|
||||||
|
path_prefix,
|
||||||
|
):
|
||||||
|
self.valid_enums[path_prefix][path] = values
|
||||||
|
|
||||||
|
def has_valid_enums(self,
|
||||||
|
path: str,
|
||||||
|
path_prefix: str,
|
||||||
|
) -> bool:
|
||||||
|
return path in self.valid_enums[path_prefix]
|
||||||
|
|
||||||
|
def get_valid_enums(self,
|
||||||
|
path: str,
|
||||||
|
path_prefix: str,
|
||||||
|
):
|
||||||
|
return self.valid_enums[path_prefix][path]
|
||||||
|
|
41
src/rougail/providersupplier.py
Normal file
41
src/rougail/providersupplier.py
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
"""Provider/supplier
|
||||||
|
|
||||||
|
distribued with GPL-2 or later license
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 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 General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
"""
|
||||||
|
from rougail.objspace import get_variables
|
||||||
|
from rougail.utils import normalize_family
|
||||||
|
|
||||||
|
|
||||||
|
def provider_supplier(objectspace,
|
||||||
|
path_prefix,
|
||||||
|
):
|
||||||
|
n_path_prefix = normalize_family(path_prefix)
|
||||||
|
for variable in get_variables(objectspace):
|
||||||
|
if variable.path_prefix != n_path_prefix:
|
||||||
|
continue
|
||||||
|
if hasattr(variable, 'provider'):
|
||||||
|
family_name, variable.name = variable.path.rsplit('.', 1)
|
||||||
|
objectspace.paths.set_provider(variable,
|
||||||
|
variable.name,
|
||||||
|
family_name,
|
||||||
|
)
|
||||||
|
if hasattr(variable, 'supplier'):
|
||||||
|
family_name, variable.name = variable.path.rsplit('.', 1)
|
||||||
|
objectspace.paths.set_supplier(variable,
|
||||||
|
variable.name,
|
||||||
|
family_name,
|
||||||
|
)
|
|
@ -35,9 +35,11 @@ from os.path import dirname, join, isfile, isdir, abspath
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import Config, undefined
|
from tiramisu3 import Config, undefined
|
||||||
|
from tiramisu3.api import TiramisuOption
|
||||||
from tiramisu3.error import PropertiesOptionError # pragma: no cover
|
from tiramisu3.error import PropertiesOptionError # pragma: no cover
|
||||||
except ModuleNotFoundError: # pragma: no cover
|
except ModuleNotFoundError: # pragma: no cover
|
||||||
from tiramisu import Config, undefined
|
from tiramisu import Config, undefined
|
||||||
|
from tiramisu.api import TiramisuOption
|
||||||
from tiramisu.error import PropertiesOptionError
|
from tiramisu.error import PropertiesOptionError
|
||||||
|
|
||||||
from ..config import RougailConfig
|
from ..config import RougailConfig
|
||||||
|
@ -57,6 +59,7 @@ log.addHandler(logging.NullHandler())
|
||||||
|
|
||||||
INFORMATIONS = {'files': ['source', 'mode', 'engine', 'included'],
|
INFORMATIONS = {'files': ['source', 'mode', 'engine', 'included'],
|
||||||
'overrides': ['name', 'source', 'engine'],
|
'overrides': ['name', 'source', 'engine'],
|
||||||
|
'service_names': ['doc', 'engine', 'type'],
|
||||||
}
|
}
|
||||||
DEFAULT = {'files': ['owner', 'group'],
|
DEFAULT = {'files': ['owner', 'group'],
|
||||||
'overrides': [],
|
'overrides': [],
|
||||||
|
@ -178,9 +181,13 @@ class RougailExtra:
|
||||||
For example %%extra1.family.variable
|
For example %%extra1.family.variable
|
||||||
"""
|
"""
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
|
name: str,
|
||||||
suboption: Dict,
|
suboption: Dict,
|
||||||
|
path: str,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
self._name = name
|
||||||
self._suboption = suboption
|
self._suboption = suboption
|
||||||
|
self._path = path
|
||||||
|
|
||||||
def __getattr__(self,
|
def __getattr__(self,
|
||||||
key: str,
|
key: str,
|
||||||
|
@ -188,7 +195,7 @@ class RougailExtra:
|
||||||
try:
|
try:
|
||||||
return self._suboption[key]
|
return self._suboption[key]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise AttributeError(f'unable to find extra "{key}"')
|
raise AttributeError(f'unable to find extra "{self._path}.{key}"')
|
||||||
|
|
||||||
def __getitem__(self,
|
def __getitem__(self,
|
||||||
key: str,
|
key: str,
|
||||||
|
@ -202,10 +209,7 @@ class RougailExtra:
|
||||||
return self._suboption.items()
|
return self._suboption.items()
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
suboptions = {}
|
return self._name
|
||||||
for key, value in self._suboption.items():
|
|
||||||
suboptions[key] = str(value)
|
|
||||||
return f'<extra object with: {suboptions}>'
|
|
||||||
|
|
||||||
|
|
||||||
class RougailBaseTemplate:
|
class RougailBaseTemplate:
|
||||||
|
@ -334,6 +338,19 @@ class RougailBaseTemplate:
|
||||||
destfilenames.append(destfilename)
|
destfilenames.append(destfilename)
|
||||||
return destfilenames
|
return destfilenames
|
||||||
|
|
||||||
|
async def load_variables(self):
|
||||||
|
for option in await self.config.option.list(type='all'):
|
||||||
|
namespace = await option.option.name()
|
||||||
|
is_variable_namespace = namespace == self.rougailconfig['variable_namespace']
|
||||||
|
if namespace == 'services':
|
||||||
|
is_service_namespace = 'root'
|
||||||
|
else:
|
||||||
|
is_service_namespace = False
|
||||||
|
self.rougail_variables_dict[namespace] = await self._load_variables(option,
|
||||||
|
is_variable_namespace,
|
||||||
|
is_service_namespace,
|
||||||
|
)
|
||||||
|
|
||||||
async def instance_files(self) -> None:
|
async def instance_files(self) -> None:
|
||||||
"""Run templatisation on all files
|
"""Run templatisation on all files
|
||||||
"""
|
"""
|
||||||
|
@ -342,17 +359,8 @@ class RougailBaseTemplate:
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
ori_dir = None
|
ori_dir = None
|
||||||
chdir(self.tmp_dir)
|
chdir(self.tmp_dir)
|
||||||
for option in await self.config.option.list(type='all'):
|
if not self.rougail_variables_dict:
|
||||||
namespace = await option.option.name()
|
await self.load_variables()
|
||||||
is_variable_namespace = namespace == self.rougailconfig['variable_namespace']
|
|
||||||
if namespace == 'services':
|
|
||||||
is_service_namespace = 'root'
|
|
||||||
else:
|
|
||||||
is_service_namespace = False
|
|
||||||
self.rougail_variables_dict[namespace] = await self.load_variables(option,
|
|
||||||
is_variable_namespace,
|
|
||||||
is_service_namespace,
|
|
||||||
)
|
|
||||||
for templates_dir in self.templates_dir:
|
for templates_dir in self.templates_dir:
|
||||||
for template in listdir(templates_dir):
|
for template in listdir(templates_dir):
|
||||||
self.prepare_template(template,
|
self.prepare_template(template,
|
||||||
|
@ -398,7 +406,7 @@ class RougailBaseTemplate:
|
||||||
)
|
)
|
||||||
if included and fill.get('included', 'no') == 'content':
|
if included and fill.get('included', 'no') == 'content':
|
||||||
files_to_delete.extend(destfilenames)
|
files_to_delete.extend(destfilenames)
|
||||||
else:
|
elif 'name' in fill:
|
||||||
self.log.debug(_(f"Instantiation of file '{fill['name']}' disabled"))
|
self.log.debug(_(f"Instantiation of file '{fill['name']}' disabled"))
|
||||||
self.post_instance_service(service_name)
|
self.post_instance_service(service_name)
|
||||||
for filename in files_to_delete:
|
for filename in files_to_delete:
|
||||||
|
@ -483,14 +491,16 @@ class RougailBaseTemplate:
|
||||||
) -> None: # pragma: no cover
|
) -> None: # pragma: no cover
|
||||||
raise NotImplementedError(_('cannot instanciate this service type override'))
|
raise NotImplementedError(_('cannot instanciate this service type override'))
|
||||||
|
|
||||||
async def load_variables(self,
|
async def _load_variables(self,
|
||||||
optiondescription,
|
optiondescription,
|
||||||
is_variable_namespace: str,
|
is_variable_namespace: str,
|
||||||
is_service_namespace: str,
|
is_service_namespace: str,
|
||||||
) -> RougailExtra:
|
) -> RougailExtra:
|
||||||
"""Load all variables and set it in RougailExtra objects
|
"""Load all variables and set it in RougailExtra objects
|
||||||
"""
|
"""
|
||||||
variables = {}
|
variables = {}
|
||||||
|
if isinstance(self.config, TiramisuOption):
|
||||||
|
len_root_path = len(await self.config.option.path()) + 1
|
||||||
for option in await optiondescription.list('all'):
|
for option in await optiondescription.list('all'):
|
||||||
if await option.option.isoptiondescription():
|
if await option.option.isoptiondescription():
|
||||||
if await option.option.isleadership():
|
if await option.option.isleadership():
|
||||||
|
@ -502,11 +512,15 @@ class RougailBaseTemplate:
|
||||||
if is_variable_namespace:
|
if is_variable_namespace:
|
||||||
self.rougail_variables_dict[await suboption.option.name()] = leader
|
self.rougail_variables_dict[await suboption.option.name()] = leader
|
||||||
else:
|
else:
|
||||||
|
if isinstance(self.config, TiramisuOption):
|
||||||
|
path = (await suboption.option.path())[len_root_path:]
|
||||||
|
else:
|
||||||
|
path = await suboption.option.path()
|
||||||
await leader._add_follower(self.config,
|
await leader._add_follower(self.config,
|
||||||
await suboption.option.name(),
|
await suboption.option.name(),
|
||||||
await suboption.option.path(),
|
path,
|
||||||
)
|
)
|
||||||
variables[leadership_name] = RougailExtra({leader_name: leader})
|
variables[leadership_name] = RougailExtra(await optiondescription.option.name(), {leader_name: leader}, await optiondescription.option.path())
|
||||||
else:
|
else:
|
||||||
if is_service_namespace == 'root':
|
if is_service_namespace == 'root':
|
||||||
new_is_service_namespace = 'service_name'
|
new_is_service_namespace = 'service_name'
|
||||||
|
@ -517,10 +531,10 @@ class RougailBaseTemplate:
|
||||||
new_is_service_namespace = is_service_namespace[:-1]
|
new_is_service_namespace = is_service_namespace[:-1]
|
||||||
else:
|
else:
|
||||||
new_is_service_namespace = is_service_namespace
|
new_is_service_namespace = is_service_namespace
|
||||||
subfamilies = await self.load_variables(option,
|
subfamilies = await self._load_variables(option,
|
||||||
is_variable_namespace,
|
is_variable_namespace,
|
||||||
new_is_service_namespace,
|
new_is_service_namespace,
|
||||||
)
|
)
|
||||||
variables[await option.option.name()] = subfamilies
|
variables[await option.option.name()] = subfamilies
|
||||||
else:
|
else:
|
||||||
if is_variable_namespace:
|
if is_variable_namespace:
|
||||||
|
@ -528,7 +542,10 @@ class RougailBaseTemplate:
|
||||||
self.rougail_variables_dict[await option.option.name()] = value
|
self.rougail_variables_dict[await option.option.name()] = value
|
||||||
if await option.option.issymlinkoption() and await option.option.isfollower():
|
if await option.option.issymlinkoption() and await option.option.isfollower():
|
||||||
value = []
|
value = []
|
||||||
path = await option.option.path()
|
if isinstance(self.config, TiramisuOption):
|
||||||
|
path = (await option.option.path())[len_root_path:]
|
||||||
|
else:
|
||||||
|
path = await option.option.path()
|
||||||
for index in range(await option.value.len()):
|
for index in range(await option.value.len()):
|
||||||
value.append(await self.config.option(path, index).value.get())
|
value.append(await self.config.option(path, index).value.get())
|
||||||
else:
|
else:
|
||||||
|
@ -543,4 +560,4 @@ class RougailBaseTemplate:
|
||||||
variables,
|
variables,
|
||||||
optiondescription,
|
optiondescription,
|
||||||
)
|
)
|
||||||
return RougailExtra(variables)
|
return RougailExtra(await optiondescription.option.name(), variables, await optiondescription.option.path())
|
||||||
|
|
|
@ -29,7 +29,12 @@ from shutil import copy
|
||||||
|
|
||||||
|
|
||||||
def process(filename: str,
|
def process(filename: str,
|
||||||
|
source: str,
|
||||||
destfilename: str,
|
destfilename: str,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
copy(filename, destfilename)
|
if filename is not None:
|
||||||
|
copy(filename, destfilename)
|
||||||
|
else:
|
||||||
|
with open(destfilename, 'w') as fh:
|
||||||
|
fh.write(source)
|
||||||
|
|
|
@ -104,7 +104,7 @@ C %%filename %%file.mode %%file.owner %%file.group - {self.rougailconfig['tmpfil
|
||||||
raise FileNotFound(_(f'Override source file "{source}" does not exist in {", ".join(self.templates_dir)}'))
|
raise FileNotFound(_(f'Override source file "{source}" does not exist in {", ".join(self.templates_dir)}'))
|
||||||
tmp_file = join(self.tmp_dir, source)
|
tmp_file = join(self.tmp_dir, source)
|
||||||
service_name = filevar['name']
|
service_name = filevar['name']
|
||||||
destfile = f'/systemd/system/{service_name}.d/rougail.conf'
|
destfile = f'{self.rougailconfig["default_systemd_directory"]}/system/{service_name}.d/rougail.conf'
|
||||||
return tmp_file, None, destfile, None
|
return tmp_file, None, destfile, None
|
||||||
|
|
||||||
def get_data_ip(self,
|
def get_data_ip(self,
|
||||||
|
@ -134,7 +134,7 @@ C %%filename %%file.mode %%file.owner %%file.group - {self.rougailconfig['tmpfil
|
||||||
):
|
):
|
||||||
tmp_file = join(self.tmp_dir, service_name)
|
tmp_file = join(self.tmp_dir, service_name)
|
||||||
var = None
|
var = None
|
||||||
destfile = f'/systemd/system/{service_name}'
|
destfile = f'{self.rougailconfig["default_systemd_directory"]}/system/{service_name}'
|
||||||
return tmp_file, None, destfile, var
|
return tmp_file, None, destfile, var
|
||||||
|
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ C %%filename %%file.mode %%file.owner %%file.group - {self.rougailconfig['tmpfil
|
||||||
def target_service(self,
|
def target_service(self,
|
||||||
service_name: str,
|
service_name: str,
|
||||||
target_name: str,
|
target_name: str,
|
||||||
global_service: str,
|
global_service: bool,
|
||||||
):
|
):
|
||||||
filename = f'{self.destinations_dir}/systemd/system/{target_name}.target.wants/{service_name}'
|
filename = f'{self.destinations_dir}/systemd/system/{target_name}.target.wants/{service_name}'
|
||||||
makedirs(dirname(filename), exist_ok=True)
|
makedirs(dirname(filename), exist_ok=True)
|
||||||
|
@ -163,7 +163,7 @@ C %%filename %%file.mode %%file.owner %%file.group - {self.rougailconfig['tmpfil
|
||||||
) -> None: # pragma: no cover
|
) -> None: # pragma: no cover
|
||||||
if self.ip_per_service is None:
|
if self.ip_per_service is None:
|
||||||
return
|
return
|
||||||
destfile = f'/systemd/system/{service_name}.d/rougail_ip.conf'
|
destfile = f'{self.rougailconfig["default_systemd_directory"]}/system/{service_name}.d/rougail_ip.conf'
|
||||||
destfilename = join(self.destinations_dir, destfile[1:])
|
destfilename = join(self.destinations_dir, destfile[1:])
|
||||||
makedirs(dirname(destfilename), exist_ok=True)
|
makedirs(dirname(destfilename), exist_ok=True)
|
||||||
self.log.info(_(f"creole processing: '{destfilename}'"))
|
self.log.info(_(f"creole processing: '{destfilename}'"))
|
||||||
|
|
|
@ -32,13 +32,12 @@ from .i18n import _
|
||||||
from .annotator import CONVERT_OPTION
|
from .annotator import CONVERT_OPTION
|
||||||
from .objspace import RootRougailObject
|
from .objspace import RootRougailObject
|
||||||
from .error import DictConsistencyError
|
from .error import DictConsistencyError
|
||||||
|
from .utils import normalize_family
|
||||||
|
|
||||||
|
|
||||||
class BaseElt: # pylint: disable=R0903
|
class BaseElt: # pylint: disable=R0903
|
||||||
"""Base element
|
"""Base element
|
||||||
"""
|
"""
|
||||||
name = 'baseoption'
|
|
||||||
doc = 'baseoption'
|
|
||||||
path = '.'
|
path = '.'
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,83 +48,105 @@ class TiramisuReflector:
|
||||||
objectspace,
|
objectspace,
|
||||||
funcs_paths,
|
funcs_paths,
|
||||||
internal_functions,
|
internal_functions,
|
||||||
|
cfg,
|
||||||
):
|
):
|
||||||
self.index = 0
|
self.cfg = cfg
|
||||||
self.text = []
|
self.text = {'header': [],
|
||||||
|
'option': [],
|
||||||
|
'optiondescription': [],
|
||||||
|
}
|
||||||
if funcs_paths:
|
if funcs_paths:
|
||||||
self.text.extend(["from importlib.machinery import SourceFileLoader as _SourceFileLoader",
|
if self.cfg['export_with_import']:
|
||||||
"from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec",
|
self.text['header'].extend(["from importlib.machinery import SourceFileLoader as _SourceFileLoader",
|
||||||
"class func:",
|
"from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec",
|
||||||
" pass",
|
"class func:",
|
||||||
])
|
" pass",
|
||||||
|
"",
|
||||||
|
"def _load_functions(path):",
|
||||||
|
" global _SourceFileLoader, _spec_from_loader, _module_from_spec, func",
|
||||||
|
" loader = _SourceFileLoader('func', path)",
|
||||||
|
" spec = _spec_from_loader(loader.name, loader)",
|
||||||
|
" func_ = _module_from_spec(spec)",
|
||||||
|
" loader.exec_module(func_)",
|
||||||
|
" for function in dir(func_):",
|
||||||
|
" if function.startswith('_'):",
|
||||||
|
" continue",
|
||||||
|
" setattr(func, function, getattr(func_, function))",
|
||||||
|
])
|
||||||
for funcs_path in funcs_paths:
|
for funcs_path in funcs_paths:
|
||||||
if not isfile(funcs_path):
|
if not isfile(funcs_path):
|
||||||
continue
|
continue
|
||||||
self.text.extend([f"_loader = _SourceFileLoader('func', '{funcs_path}')",
|
self.text['header'].append(f"_load_functions('{funcs_path}')")
|
||||||
"_spec = _spec_from_loader(_loader.name, _loader)",
|
if self.cfg['export_with_import']:
|
||||||
"_func = _module_from_spec(_spec)",
|
if internal_functions:
|
||||||
"_loader.exec_module(_func)",
|
for func in internal_functions:
|
||||||
"for function in dir(_func):",
|
self.text['header'].append(f"setattr(func, '{func}', {func})")
|
||||||
" if function.startswith('_'):",
|
self.text['header'].extend(["try:",
|
||||||
" continue",
|
" from tiramisu3 import *",
|
||||||
" setattr(func, function, getattr(_func, function))",
|
"except:",
|
||||||
])
|
" from tiramisu import *",
|
||||||
if internal_functions:
|
])
|
||||||
for func in internal_functions:
|
|
||||||
self.text.append(f"setattr(func, '{func}', {func})")
|
|
||||||
self.text.extend(["try:",
|
|
||||||
" from tiramisu3 import *",
|
|
||||||
"except:",
|
|
||||||
" from tiramisu import *",
|
|
||||||
])
|
|
||||||
self.objectspace = objectspace
|
self.objectspace = objectspace
|
||||||
self.make_tiramisu_objects()
|
self.make_tiramisu_objects()
|
||||||
if self.objectspace.has_dyn_option is True:
|
if self.cfg['export_with_import'] and (self.cfg['force_convert_dyn_option_description'] or self.objectspace.has_dyn_option is True):
|
||||||
self.text.append("from rougail.tiramisu import ConvertDynOptionDescription")
|
self.text['header'].append("from rougail.tiramisu import ConvertDynOptionDescription")
|
||||||
|
|
||||||
def make_tiramisu_objects(self) -> None:
|
def make_tiramisu_objects(self) -> None:
|
||||||
"""make tiramisu objects
|
"""make tiramisu objects
|
||||||
"""
|
"""
|
||||||
providers = {}
|
|
||||||
baseelt = BaseElt()
|
baseelt = BaseElt()
|
||||||
|
baseelt.reflector_name = f'option_0{self.objectspace.rougailconfig["suffix"]}'
|
||||||
self.set_name(baseelt)
|
self.set_name(baseelt)
|
||||||
dynamic_path = ''
|
|
||||||
dynamic = False
|
|
||||||
basefamily = Family(baseelt,
|
basefamily = Family(baseelt,
|
||||||
self.text,
|
self.text,
|
||||||
self.objectspace,
|
self.objectspace,
|
||||||
)
|
)
|
||||||
for elt in self.reorder_family():
|
if not self.objectspace.paths.has_path_prefix():
|
||||||
self.populate_family(basefamily,
|
for elt in self.reorder_family(self.objectspace.space):
|
||||||
elt,
|
self.populate_family(basefamily,
|
||||||
providers,
|
elt,
|
||||||
dynamic,
|
)
|
||||||
dynamic_path,
|
basefamily.populate_informations()
|
||||||
)
|
basefamily.elt.information = self.objectspace.paths.get_providers_path()
|
||||||
basefamily.elt.information = providers
|
basefamily.elt.information.update(self.objectspace.paths.get_suppliers_path())
|
||||||
basefamily.populate_informations()
|
else:
|
||||||
self.baseelt = baseelt
|
path_prefixes = self.objectspace.paths.get_path_prefixes()
|
||||||
|
for path_prefix in path_prefixes:
|
||||||
|
space = self.objectspace.space.variables[path_prefix]
|
||||||
|
self.set_name(space)
|
||||||
|
baseprefix = Family(space,
|
||||||
|
self.text,
|
||||||
|
self.objectspace,
|
||||||
|
)
|
||||||
|
basefamily.add(baseprefix)
|
||||||
|
for elt in self.reorder_family(space):
|
||||||
|
self.populate_family(baseprefix,
|
||||||
|
elt,
|
||||||
|
)
|
||||||
|
baseprefix.populate_informations()
|
||||||
|
baseprefix.elt.information = self.objectspace.paths.get_providers_path(path_prefix)
|
||||||
|
baseprefix.elt.information.update(self.objectspace.paths.get_suppliers_path(path_prefix))
|
||||||
|
baseelt.name = normalize_family(self.cfg['base_option_name'])
|
||||||
|
baseelt.doc = self.cfg['base_option_name']
|
||||||
|
baseelt.reflector_object.get([], baseelt.doc, 'base') # pylint: disable=E1101
|
||||||
|
|
||||||
def reorder_family(self):
|
def reorder_family(self, space):
|
||||||
"""variable_namespace family has to be loaded before any other family
|
"""variable_namespace family has to be loaded before any other family
|
||||||
because `extra` family could use `variable_namespace` variables.
|
because `extra` family could use `variable_namespace` variables.
|
||||||
"""
|
"""
|
||||||
if hasattr(self.objectspace.space, 'variables'):
|
if hasattr(space, 'variables'):
|
||||||
variable_namespace = self.objectspace.rougailconfig['variable_namespace']
|
variable_namespace = self.objectspace.rougailconfig['variable_namespace']
|
||||||
if variable_namespace in self.objectspace.space.variables:
|
if variable_namespace in space.variables:
|
||||||
yield self.objectspace.space.variables[variable_namespace]
|
yield space.variables[variable_namespace]
|
||||||
for elt, value in self.objectspace.space.variables.items():
|
for elt, value in space.variables.items():
|
||||||
if elt != self.objectspace.rougailconfig['variable_namespace']:
|
if elt != self.objectspace.rougailconfig['variable_namespace']:
|
||||||
yield value
|
yield value
|
||||||
if hasattr(self.objectspace.space, 'services'):
|
if hasattr(space, 'services'):
|
||||||
yield self.objectspace.space.services
|
yield space.services
|
||||||
|
|
||||||
def populate_family(self,
|
def populate_family(self,
|
||||||
parent_family,
|
parent_family,
|
||||||
elt,
|
elt,
|
||||||
providers,
|
|
||||||
dynamic,
|
|
||||||
dynamic_path,
|
|
||||||
):
|
):
|
||||||
"""Populate family
|
"""Populate family
|
||||||
"""
|
"""
|
||||||
|
@ -134,21 +155,11 @@ class TiramisuReflector:
|
||||||
self.text,
|
self.text,
|
||||||
self.objectspace,
|
self.objectspace,
|
||||||
)
|
)
|
||||||
if not dynamic_path:
|
|
||||||
dynamic_path = elt.name
|
|
||||||
else:
|
|
||||||
dynamic_path = dynamic_path + '.' + elt.name
|
|
||||||
if dynamic or hasattr(elt, 'suffixes'):
|
|
||||||
dynamic_path += '{suffix}'
|
|
||||||
dynamic = True
|
|
||||||
parent_family.add(family)
|
parent_family.add(family)
|
||||||
for children in vars(elt).values():
|
for children in vars(elt).values():
|
||||||
if isinstance(children, self.objectspace.family):
|
if isinstance(children, self.objectspace.family):
|
||||||
self.populate_family(family,
|
self.populate_family(family,
|
||||||
children,
|
children,
|
||||||
providers,
|
|
||||||
dynamic,
|
|
||||||
dynamic_path,
|
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
if isinstance(children, dict):
|
if isinstance(children, dict):
|
||||||
|
@ -160,21 +171,13 @@ class TiramisuReflector:
|
||||||
continue
|
continue
|
||||||
if isinstance(child, self.objectspace.variable):
|
if isinstance(child, self.objectspace.variable):
|
||||||
self.set_name(child)
|
self.set_name(child)
|
||||||
sub_dynamic_path = dynamic_path + '.' + child.name
|
|
||||||
if dynamic:
|
|
||||||
sub_dynamic_path += '{suffix}'
|
|
||||||
family.add(Variable(child,
|
family.add(Variable(child,
|
||||||
self.text,
|
self.text,
|
||||||
self.objectspace,
|
self.objectspace,
|
||||||
providers,
|
|
||||||
sub_dynamic_path,
|
|
||||||
))
|
))
|
||||||
else:
|
else:
|
||||||
self.populate_family(family,
|
self.populate_family(family,
|
||||||
child,
|
child,
|
||||||
providers,
|
|
||||||
dynamic,
|
|
||||||
dynamic_path,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def set_name(self,
|
def set_name(self,
|
||||||
|
@ -182,14 +185,14 @@ class TiramisuReflector:
|
||||||
):
|
):
|
||||||
"""Set name
|
"""Set name
|
||||||
"""
|
"""
|
||||||
elt.reflector_name = f'option_{self.index}'
|
if not hasattr(elt, 'reflector_name'):
|
||||||
self.index += 1
|
self.objectspace.paths.set_name(elt, 'optiondescription_')
|
||||||
|
return elt.reflector_name
|
||||||
|
|
||||||
def get_text(self):
|
def get_text(self):
|
||||||
"""Get text
|
"""Get text
|
||||||
"""
|
"""
|
||||||
self.baseelt.reflector_object.get([]) # pylint: disable=E1101
|
return '\n'.join(self.text['header'] + self.text['option'] + self.text['optiondescription'])
|
||||||
return '\n'.join(self.text)
|
|
||||||
|
|
||||||
|
|
||||||
class Common:
|
class Common:
|
||||||
|
@ -207,7 +210,7 @@ class Common:
|
||||||
self.elt.reflector_object = self
|
self.elt.reflector_object = self
|
||||||
self.object_type = None
|
self.object_type = None
|
||||||
|
|
||||||
def get(self, calls):
|
def get(self, calls, parent_name, typ):
|
||||||
"""Get tiramisu's object
|
"""Get tiramisu's object
|
||||||
"""
|
"""
|
||||||
self_calls = calls.copy()
|
self_calls = calls.copy()
|
||||||
|
@ -220,12 +223,6 @@ class Common:
|
||||||
self.option_name = self.elt.reflector_name
|
self.option_name = self.elt.reflector_name
|
||||||
self.populate_attrib()
|
self.populate_attrib()
|
||||||
self.populate_informations()
|
self.populate_informations()
|
||||||
if hasattr(self.elt, 'provider'):
|
|
||||||
name = 'provider:' + self.elt.provider
|
|
||||||
if name in self.providers:
|
|
||||||
msg = f'provider {name} declare multiple time'
|
|
||||||
raise DictConsistencyError(msg, 79, self.elt.xmlfiles)
|
|
||||||
self.providers[name] = self.dynamic_path
|
|
||||||
return self.option_name
|
return self.option_name
|
||||||
|
|
||||||
def populate_attrib(self):
|
def populate_attrib(self):
|
||||||
|
@ -238,7 +235,13 @@ class Common:
|
||||||
if hasattr(self.elt, 'properties'):
|
if hasattr(self.elt, 'properties'):
|
||||||
keys['properties'] = self.properties_to_string(self.elt.properties)
|
keys['properties'] = self.properties_to_string(self.elt.properties)
|
||||||
attrib = ', '.join([f'{key}={value}' for key, value in keys.items()])
|
attrib = ', '.join([f'{key}={value}' for key, value in keys.items()])
|
||||||
self.text.append(f'{self.option_name} = {self.object_type}({attrib})')
|
if self.__class__.__name__ == 'Family':
|
||||||
|
#pouet
|
||||||
|
name = 'option'
|
||||||
|
#name = 'optiondescription'
|
||||||
|
else:
|
||||||
|
name = 'option'
|
||||||
|
self.text[name].append(f'{self.option_name} = {self.object_type}({attrib})')
|
||||||
|
|
||||||
def _populate_attrib(self,
|
def _populate_attrib(self,
|
||||||
keys: dict,
|
keys: dict,
|
||||||
|
@ -267,7 +270,7 @@ class Common:
|
||||||
) -> str:
|
) -> str:
|
||||||
"""Populate properties
|
"""Populate properties
|
||||||
"""
|
"""
|
||||||
option_name = child.source.reflector_object.get(self.calls)
|
option_name = child.source.reflector_object.get(self.calls, self.elt.path, 'property')
|
||||||
kwargs = (f"'condition': ParamOption({option_name}, todict=True, notraisepropertyerror=True), "
|
kwargs = (f"'condition': ParamOption({option_name}, todict=True, notraisepropertyerror=True), "
|
||||||
f"'expected': {self.populate_param(child.expected)}")
|
f"'expected': {self.populate_param(child.expected)}")
|
||||||
if child.inverse:
|
if child.inverse:
|
||||||
|
@ -289,7 +292,8 @@ class Common:
|
||||||
continue
|
continue
|
||||||
if isinstance(value, str):
|
if isinstance(value, str):
|
||||||
value = self.convert_str(value)
|
value = self.convert_str(value)
|
||||||
self.text.append(f"{self.option_name}.impl_set_information('{key}', {value})")
|
#pouet self.text['optiondescription'].append(f"{self.option_name}.impl_set_information('{key}', {value})")
|
||||||
|
self.text['option'].append(f"{self.option_name}.impl_set_information('{key}', {value})")
|
||||||
|
|
||||||
def populate_param(self,
|
def populate_param(self,
|
||||||
param,
|
param,
|
||||||
|
@ -301,7 +305,7 @@ class Common:
|
||||||
if param.type == 'string' and value is not None:
|
if param.type == 'string' and value is not None:
|
||||||
value = self.convert_str(value)
|
value = self.convert_str(value)
|
||||||
return f'ParamValue({value})'
|
return f'ParamValue({value})'
|
||||||
if param.type == 'variable':
|
if param.type in ['variable_name', 'variable']:
|
||||||
return self.build_option_param(param)
|
return self.build_option_param(param)
|
||||||
if param.type == 'information':
|
if param.type == 'information':
|
||||||
if hasattr(self.elt, 'multi') and self.elt.multi:
|
if hasattr(self.elt, 'multi') and self.elt.multi:
|
||||||
|
@ -322,11 +326,14 @@ class Common:
|
||||||
) -> str:
|
) -> str:
|
||||||
"""build variable parameters
|
"""build variable parameters
|
||||||
"""
|
"""
|
||||||
option_name = param.text.reflector_object.get(self.calls)
|
if param.type == 'variable':
|
||||||
|
option_name = param.text.reflector_object.get(self.calls, self.elt.path, 'param')
|
||||||
|
else:
|
||||||
|
option_name = param.text
|
||||||
params = [f'{option_name}']
|
params = [f'{option_name}']
|
||||||
if hasattr(param, 'suffix'):
|
if hasattr(param, 'suffix'):
|
||||||
param_type = 'ParamDynOption'
|
param_type = 'ParamDynOption'
|
||||||
family = param.family.reflector_object.get(self.calls)
|
family = param.family.reflector_object.get(self.calls, self.elt.path, 'suffix')
|
||||||
params.extend([f"'{param.suffix}'", f'{family}'])
|
params.extend([f"'{param.suffix}'", f'{family}'])
|
||||||
else:
|
else:
|
||||||
param_type = 'ParamOption'
|
param_type = 'ParamOption'
|
||||||
|
@ -342,11 +349,7 @@ class Variable(Common):
|
||||||
elt,
|
elt,
|
||||||
text,
|
text,
|
||||||
objectspace,
|
objectspace,
|
||||||
providers,
|
|
||||||
dynamic_path,
|
|
||||||
):
|
):
|
||||||
self.providers = providers
|
|
||||||
self.dynamic_path = dynamic_path
|
|
||||||
super().__init__(elt, text, objectspace)
|
super().__init__(elt, text, objectspace)
|
||||||
self.object_type = CONVERT_OPTION[elt.type]['opttype']
|
self.object_type = CONVERT_OPTION[elt.type]['opttype']
|
||||||
|
|
||||||
|
@ -354,11 +357,11 @@ class Variable(Common):
|
||||||
keys: dict,
|
keys: dict,
|
||||||
):
|
):
|
||||||
if hasattr(self.elt, 'opt'):
|
if hasattr(self.elt, 'opt'):
|
||||||
keys['opt'] = self.elt.opt.reflector_object.get(self.calls)
|
keys['opt'] = self.elt.opt.reflector_object.get(self.calls, self.elt.path, 'opt')
|
||||||
if hasattr(self.elt, 'choice'):
|
if hasattr(self.elt, 'choice'):
|
||||||
values = self.elt.choice
|
values = self.elt.choice
|
||||||
if values[0].type == 'variable':
|
if values[0].type == 'variable':
|
||||||
value = values[0].name.reflector_object.get(self.calls)
|
value = values[0].name.reflector_object.get(self.calls, self.elt.path, 'choice')
|
||||||
keys['values'] = f"Calculation(func.calc_value, Params((ParamOption({value}))))"
|
keys['values'] = f"Calculation(func.calc_value, Params((ParamOption({value}))))"
|
||||||
elif values[0].type == 'function':
|
elif values[0].type == 'function':
|
||||||
keys['values'] = self.calculation_value(values[0], [])
|
keys['values'] = self.calculation_value(values[0], [])
|
||||||
|
@ -447,6 +450,6 @@ class Family(Common):
|
||||||
keys: list,
|
keys: list,
|
||||||
) -> None:
|
) -> None:
|
||||||
if hasattr(self.elt, 'suffixes'):
|
if hasattr(self.elt, 'suffixes'):
|
||||||
dyn = self.elt.suffixes.reflector_object.get(self.calls)
|
dyn = self.elt.suffixes.reflector_object.get(self.calls, self.elt.path, 'suffixes')
|
||||||
keys['suffixes'] = f"Calculation(func.calc_value, Params((ParamOption({dyn}, notraisepropertyerror=True))))"
|
keys['suffixes'] = f"Calculation(func.calc_value, Params((ParamOption({dyn}, notraisepropertyerror=True))))"
|
||||||
keys['children'] = '[' + ', '.join([child.get(self.calls) for child in self.children]) + ']'
|
keys['children'] = '[' + ', '.join([child.get(self.calls, self.elt.path, 'child') for child in self.children]) + ']'
|
||||||
|
|
|
@ -50,6 +50,8 @@ def valid_variable_family_name(name: str,
|
||||||
def normalize_family(family_name: str) -> str:
|
def normalize_family(family_name: str) -> str:
|
||||||
"""replace space, accent, uppercase, ... by valid character
|
"""replace space, accent, uppercase, ... by valid character
|
||||||
"""
|
"""
|
||||||
|
if not family_name:
|
||||||
|
return
|
||||||
family_name = family_name.replace('-', '_').replace(' ', '_').replace('.', '_')
|
family_name = family_name.replace('-', '_').replace(' ', '_').replace('.', '_')
|
||||||
nfkd_form = normalize('NFKD', family_name)
|
nfkd_form = normalize('NFKD', family_name)
|
||||||
family_name = ''.join([c for c in nfkd_form if not combining(c)])
|
family_name = ''.join([c for c in nfkd_form if not combining(c)])
|
||||||
|
|
|
@ -66,9 +66,10 @@ class XMLReflector:
|
||||||
for filename in listdir(xmlfolder):
|
for filename in listdir(xmlfolder):
|
||||||
if not filename.endswith('.xml'):
|
if not filename.endswith('.xml'):
|
||||||
continue
|
continue
|
||||||
|
full_filename = join(xmlfolder, filename)
|
||||||
if filename in filenames:
|
if filename in filenames:
|
||||||
raise DictConsistencyError(_(f'duplicate xml file name {filename}'), 78, [xmlfolder])
|
raise DictConsistencyError(_(f'duplicate xml file name {filename}'), 78, [filenames[filename], full_filename])
|
||||||
filenames[filename] = join(xmlfolder, filename)
|
filenames[filename] = full_filename
|
||||||
if not filenames:
|
if not filenames:
|
||||||
raise DictConsistencyError(_('there is no XML file'), 77, [xmlfolder])
|
raise DictConsistencyError(_('there is no XML file'), 77, [xmlfolder])
|
||||||
file_names = list(filenames.keys())
|
file_names = list(filenames.keys())
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
<rougail version="0.10">
|
<rougail version="0.10">
|
||||||
<services>
|
<services>
|
||||||
<service name="tata">
|
<service name="tata">
|
||||||
</service>
|
</service>
|
||||||
</services>
|
</services>
|
||||||
</rougail>
|
</rougail>
|
||||||
|
|
|
@ -2,20 +2,25 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = BoolOption(name="activate", doc="activate", default=True)
|
option_1 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_4 = BoolOption(name="manage", doc="manage", default=True)
|
option_2 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
option_2 = OptionDescription(name="tata_service", doc="tata.service", children=[option_3, option_4])
|
optiondescription_4 = OptionDescription(name="tata_service", doc="tata.service", children=[option_1, option_2])
|
||||||
option_1 = OptionDescription(name="services", doc="services", children=[option_2], properties=frozenset({"hidden"}))
|
optiondescription_4.impl_set_information('type', "service")
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
optiondescription_3 = OptionDescription(name="services", doc="services", children=[optiondescription_4], properties=frozenset({"hidden"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3])
|
||||||
|
|
33
tests/dictionaries/00empty/tiramisu/multi.py
Normal file
33
tests/dictionaries/00empty/tiramisu/multi.py
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_1 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_2 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_7 = OptionDescription(name="tata_service", doc="tata.service", children=[option_1, option_2])
|
||||||
|
optiondescription_7.impl_set_information('type', "service")
|
||||||
|
optiondescription_6 = OptionDescription(name="services", doc="services", children=[optiondescription_7], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6])
|
||||||
|
option_3 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_4 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_10 = OptionDescription(name="tata_service", doc="tata.service", children=[option_3, option_4])
|
||||||
|
optiondescription_10.impl_set_information('type', "service")
|
||||||
|
optiondescription_9 = OptionDescription(name="services", doc="services", children=[optiondescription_10], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="2", doc="2", children=[optiondescription_9])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_8])
|
|
@ -2,19 +2,23 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"}))
|
option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = StrOption(name="myvar", doc="myvar", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))}))
|
option_1 = StrOption(name="myvar", doc="myvar", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3])
|
optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3])
|
||||||
|
|
29
tests/dictionaries/00load_autofreeze/tiramisu/multi.py
Normal file
29
tests/dictionaries/00load_autofreeze/tiramisu/multi.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_1 = StrOption(name="myvar", doc="myvar", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))}))
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2])
|
||||||
|
optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6])
|
||||||
|
option_4 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_3 = StrOption(name="myvar", doc="myvar", default="no", properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4])
|
||||||
|
optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7])
|
|
@ -2,19 +2,23 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"}))
|
option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"expert", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))}))
|
option_1 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"expert", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3])
|
optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3])
|
||||||
|
|
29
tests/dictionaries/00load_autofreezeexpert/tiramisu/multi.py
Normal file
29
tests/dictionaries/00load_autofreezeexpert/tiramisu/multi.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_1 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"expert", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))}))
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2])
|
||||||
|
optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6])
|
||||||
|
option_4 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_3 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"expert", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4])
|
||||||
|
optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7])
|
|
@ -2,20 +2,24 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"}))
|
option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"}))
|
||||||
option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "force_store_value", "mandatory"}))
|
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "force_store_value", "mandatory"}))
|
||||||
option_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"basic"}))
|
optiondescription_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"basic"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3])
|
optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4])
|
||||||
|
|
31
tests/dictionaries/00load_autosave/tiramisu/multi.py
Normal file
31
tests/dictionaries/00load_autosave/tiramisu/multi.py
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "force_store_value", "mandatory"}))
|
||||||
|
optiondescription_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2])
|
||||||
|
optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8])
|
||||||
|
option_4 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "force_store_value", "mandatory"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="general", doc="général", children=[option_6], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[option_4, optiondescription_5])
|
||||||
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9])
|
|
@ -2,20 +2,24 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"}))
|
option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"}))
|
||||||
option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "force_store_value", "mandatory"}))
|
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "force_store_value", "mandatory"}))
|
||||||
option_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"expert"}))
|
optiondescription_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"expert"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3])
|
optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4])
|
||||||
|
|
31
tests/dictionaries/00load_autosaveexpert/tiramisu/multi.py
Normal file
31
tests/dictionaries/00load_autosaveexpert/tiramisu/multi.py
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "force_store_value", "mandatory"}))
|
||||||
|
optiondescription_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"expert"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, optiondescription_2])
|
||||||
|
optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8])
|
||||||
|
option_4 = BoolOption(name="server_deployed", doc="server_deployed", default=True, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "force_store_value", "mandatory"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="general", doc="général", children=[option_6], properties=frozenset({"expert"}))
|
||||||
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[option_4, optiondescription_5])
|
||||||
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9])
|
|
@ -2,19 +2,23 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3])
|
||||||
|
|
29
tests/dictionaries/00load_comment/tiramisu/multi.py
Normal file
29
tests/dictionaries/00load_comment/tiramisu/multi.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6])
|
||||||
|
option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3])
|
||||||
|
optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7])
|
|
@ -2,20 +2,24 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
option_4 = StrOption(name="without_type", doc="without_type", default="non", properties=frozenset({"mandatory", "normal"}))
|
option_3 = StrOption(name="without_type", doc="without_type", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4])
|
||||||
|
|
31
tests/dictionaries/00load_notype/tiramisu/multi.py
Normal file
31
tests/dictionaries/00load_notype/tiramisu/multi.py
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
|
option_3 = StrOption(name="without_type", doc="without_type", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8])
|
||||||
|
option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
|
option_6 = StrOption(name="without_type", doc="without_type", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="general", doc="général", children=[option_5, option_6], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4])
|
||||||
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9])
|
|
@ -2,19 +2,23 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3])
|
||||||
|
|
29
tests/dictionaries/00load_save/tiramisu/multi.py
Normal file
29
tests/dictionaries/00load_save/tiramisu/multi.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6])
|
||||||
|
option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="general", doc="général", children=[option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3])
|
||||||
|
optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7])
|
|
@ -2,20 +2,24 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4])
|
||||||
|
|
31
tests/dictionaries/00load_subfolder/tiramisu/multi.py
Normal file
31
tests/dictionaries/00load_subfolder/tiramisu/multi.py
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
|
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="général", children=[option_2, option_3], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8])
|
||||||
|
option_5 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
|
option_6 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="general", doc="général", children=[option_5, option_6], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4])
|
||||||
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9])
|
|
@ -2,19 +2,23 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_2 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"}))
|
option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"}))
|
||||||
option_3 = StrOption(name="my_variable", doc="my_variable", default=Calculation(func.calc_val, Params((ParamValue("yes")))), properties=frozenset({"basic", "force_store_value", "hidden", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_2, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))}))
|
option_2 = StrOption(name="my_variable", doc="my_variable", default=Calculation(func.calc_val, Params((ParamValue("yes")))), properties=frozenset({"basic", "force_store_value", "hidden", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3])
|
optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3])
|
||||||
|
|
29
tests/dictionaries/01auto_autofreeze/tiramisu/multi.py
Normal file
29
tests/dictionaries/01auto_autofreeze/tiramisu/multi.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_1 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_2 = StrOption(name="my_variable", doc="my_variable", default=Calculation(func.calc_val, Params((ParamValue("yes")))), properties=frozenset({"basic", "force_store_value", "hidden", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_1, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))}))
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_1, option_2])
|
||||||
|
optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6])
|
||||||
|
option_3 = BoolOption(name="server_deployed", doc="server_deployed", default=False, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_4 = StrOption(name="my_variable", doc="my_variable", default=Calculation(func.calc_val, Params((ParamValue("yes")))), properties=frozenset({"basic", "force_store_value", "hidden", Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue(True)}))}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4])
|
||||||
|
optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7])
|
|
@ -2,20 +2,24 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
|
option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_3)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4])
|
||||||
|
|
31
tests/dictionaries/01auto_base/tiramisu/multi.py
Normal file
31
tests/dictionaries/01auto_base/tiramisu/multi.py
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_3)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8])
|
||||||
|
option_6 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_6)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4])
|
||||||
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9])
|
|
@ -2,20 +2,24 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params(())), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params(())), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))
|
||||||
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
|
option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4])
|
||||||
|
|
31
tests/dictionaries/01auto_withoutparam/tiramisu/multi.py
Normal file
31
tests/dictionaries/01auto_withoutparam/tiramisu/multi.py
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params(())), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))
|
||||||
|
option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8])
|
||||||
|
option_5 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params(())), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))
|
||||||
|
option_6 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4])
|
||||||
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9])
|
|
@ -2,19 +2,23 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = DomainnameOption(name="domain", doc="Description", default="my.domain.name", type='domainname', allow_ip=False, properties=frozenset({"mandatory", "normal"}))
|
option_2 = DomainnameOption(name="domain", doc="Description", default="my.domain.name", type='domainname', allow_ip=False, properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3])
|
||||||
|
|
29
tests/dictionaries/01base_domainname/tiramisu/multi.py
Normal file
29
tests/dictionaries/01base_domainname/tiramisu/multi.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = DomainnameOption(name="domain", doc="Description", default="my.domain.name", type='domainname', allow_ip=False, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6])
|
||||||
|
option_4 = DomainnameOption(name="domain", doc="Description", default="my.domain.name", type='domainname', allow_ip=False, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3])
|
||||||
|
optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7])
|
|
@ -2,33 +2,38 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_8 = FilenameOption(name="name", doc="name", default="/etc/file")
|
option_7 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_6 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6])
|
||||||
|
optiondescription_5.impl_set_information('source', "file")
|
||||||
|
option_10 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9])
|
optiondescription_8 = OptionDescription(name="file2", doc="file2", children=[option_10, option_9])
|
||||||
option_7.impl_set_information('source', "file")
|
optiondescription_8.impl_set_information('engine', "jinja2")
|
||||||
option_11 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
optiondescription_8.impl_set_information('source', "file2")
|
||||||
option_12 = BoolOption(name="activate", doc="activate", default=True)
|
optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8])
|
||||||
option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12])
|
option_3 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_10.impl_set_information('engine', "jinja2")
|
option_11 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
option_10.impl_set_information('source', "file2")
|
optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_11])
|
||||||
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10])
|
optiondescription_14.impl_set_information('type', "service")
|
||||||
option_13 = BoolOption(name="activate", doc="activate", default=True)
|
optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"}))
|
||||||
option_14 = BoolOption(name="manage", doc="manage", default=True)
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13])
|
||||||
option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_13, option_14])
|
|
||||||
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])
|
|
||||||
|
|
59
tests/dictionaries/01base_file/tiramisu/multi.py
Normal file
59
tests/dictionaries/01base_file/tiramisu/multi.py
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
option_9 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_8 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8])
|
||||||
|
optiondescription_7.impl_set_information('source', "file")
|
||||||
|
option_12 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_11 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_11])
|
||||||
|
optiondescription_10.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_10.impl_set_information('source', "file2")
|
||||||
|
optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10])
|
||||||
|
option_5 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_13 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_13])
|
||||||
|
optiondescription_26.impl_set_information('type', "service")
|
||||||
|
optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25])
|
||||||
|
option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3])
|
||||||
|
option_18 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_17 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_16 = OptionDescription(name="file", doc="file", children=[option_18, option_17])
|
||||||
|
optiondescription_16.impl_set_information('source', "file")
|
||||||
|
option_21 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_20 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_19 = OptionDescription(name="file2", doc="file2", children=[option_21, option_20])
|
||||||
|
optiondescription_19.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_19.impl_set_information('source', "file2")
|
||||||
|
optiondescription_15 = OptionDescription(name="files", doc="files", children=[optiondescription_16, optiondescription_19])
|
||||||
|
option_14 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_22 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_15, option_14, option_22])
|
||||||
|
optiondescription_30.impl_set_information('type', "service")
|
||||||
|
optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27])
|
|
@ -2,37 +2,42 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_15 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_8 = FilenameOption(name="name", doc="name", default="/etc/file")
|
option_7 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_6 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6])
|
||||||
|
optiondescription_5.impl_set_information('source', "file")
|
||||||
|
option_10 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9])
|
optiondescription_8 = OptionDescription(name="file2", doc="file2", children=[option_10, option_9])
|
||||||
option_7.impl_set_information('source', "file")
|
optiondescription_8.impl_set_information('engine', "jinja2")
|
||||||
option_11 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
optiondescription_8.impl_set_information('source', "file2")
|
||||||
option_12 = BoolOption(name="activate", doc="activate", default=True)
|
option_13 = FilenameOption(name="name", doc="name", default="/etc/file3")
|
||||||
option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12])
|
option_12 = BoolOption(name="activate", doc="activate", default=False)
|
||||||
option_10.impl_set_information('engine', "jinja2")
|
optiondescription_11 = OptionDescription(name="file3", doc="file3", children=[option_13, option_12])
|
||||||
option_10.impl_set_information('source', "file2")
|
optiondescription_11.impl_set_information('source', "file3")
|
||||||
option_14 = FilenameOption(name="name", doc="name", default="/etc/file3")
|
optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8, optiondescription_11])
|
||||||
option_15 = BoolOption(name="activate", doc="activate", default=False)
|
option_3 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_13 = OptionDescription(name="file3", doc="file3", children=[option_14, option_15])
|
option_14 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
option_13.impl_set_information('source', "file3")
|
optiondescription_17 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_14])
|
||||||
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10, option_13])
|
optiondescription_17.impl_set_information('type', "service")
|
||||||
option_16 = BoolOption(name="activate", doc="activate", default=True)
|
optiondescription_16 = OptionDescription(name="services", doc="services", children=[optiondescription_17], properties=frozenset({"hidden"}))
|
||||||
option_17 = BoolOption(name="manage", doc="manage", default=True)
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_16])
|
||||||
option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_16, option_17])
|
|
||||||
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])
|
|
||||||
|
|
67
tests/dictionaries/01base_file_disabled/tiramisu/multi.py
Normal file
67
tests/dictionaries/01base_file_disabled/tiramisu/multi.py
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_30 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
option_9 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_8 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8])
|
||||||
|
optiondescription_7.impl_set_information('source', "file")
|
||||||
|
option_12 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_11 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_11])
|
||||||
|
optiondescription_10.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_10.impl_set_information('source', "file2")
|
||||||
|
option_15 = FilenameOption(name="name", doc="name", default="/etc/file3")
|
||||||
|
option_14 = BoolOption(name="activate", doc="activate", default=False)
|
||||||
|
optiondescription_13 = OptionDescription(name="file3", doc="file3", children=[option_15, option_14])
|
||||||
|
optiondescription_13.impl_set_information('source', "file3")
|
||||||
|
optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10, optiondescription_13])
|
||||||
|
option_5 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_16 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_32 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_16])
|
||||||
|
optiondescription_32.impl_set_information('type', "service")
|
||||||
|
optiondescription_31 = OptionDescription(name="services", doc="services", children=[optiondescription_32], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_29 = OptionDescription(name="1", doc="1", children=[optiondescription_30, optiondescription_31])
|
||||||
|
option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_34 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3])
|
||||||
|
option_21 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_20 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_19 = OptionDescription(name="file", doc="file", children=[option_21, option_20])
|
||||||
|
optiondescription_19.impl_set_information('source', "file")
|
||||||
|
option_24 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_23 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_22 = OptionDescription(name="file2", doc="file2", children=[option_24, option_23])
|
||||||
|
optiondescription_22.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_22.impl_set_information('source', "file2")
|
||||||
|
option_27 = FilenameOption(name="name", doc="name", default="/etc/file3")
|
||||||
|
option_26 = BoolOption(name="activate", doc="activate", default=False)
|
||||||
|
optiondescription_25 = OptionDescription(name="file3", doc="file3", children=[option_27, option_26])
|
||||||
|
optiondescription_25.impl_set_information('source', "file3")
|
||||||
|
optiondescription_18 = OptionDescription(name="files", doc="files", children=[optiondescription_19, optiondescription_22, optiondescription_25])
|
||||||
|
option_17 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_28 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_36 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_18, option_17, option_28])
|
||||||
|
optiondescription_36.impl_set_information('type', "service")
|
||||||
|
optiondescription_35 = OptionDescription(name="services", doc="services", children=[optiondescription_36], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_33 = OptionDescription(name="2", doc="2", children=[optiondescription_34, optiondescription_35])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_29, optiondescription_33])
|
|
@ -2,33 +2,38 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_8 = FilenameOption(name="name", doc="name", default="/etc/file")
|
option_7 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_6 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6])
|
||||||
|
optiondescription_5.impl_set_information('source', "file")
|
||||||
|
option_10 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9])
|
optiondescription_8 = OptionDescription(name="file2", doc="file2", children=[option_10, option_9])
|
||||||
option_7.impl_set_information('source', "file")
|
optiondescription_8.impl_set_information('engine', "jinja2")
|
||||||
option_11 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
optiondescription_8.impl_set_information('source', "file2")
|
||||||
option_12 = BoolOption(name="activate", doc="activate", default=True)
|
optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8])
|
||||||
option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12])
|
option_3 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_10.impl_set_information('engine', "jinja2")
|
option_11 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
option_10.impl_set_information('source', "file2")
|
optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_11])
|
||||||
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10])
|
optiondescription_14.impl_set_information('type', "service")
|
||||||
option_13 = BoolOption(name="activate", doc="activate", default=True)
|
optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"}))
|
||||||
option_14 = BoolOption(name="manage", doc="manage", default=True)
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13])
|
||||||
option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_13, option_14])
|
|
||||||
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])
|
|
||||||
|
|
59
tests/dictionaries/01base_file_include/tiramisu/multi.py
Normal file
59
tests/dictionaries/01base_file_include/tiramisu/multi.py
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
option_9 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_8 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8])
|
||||||
|
optiondescription_7.impl_set_information('source', "file")
|
||||||
|
option_12 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_11 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_11])
|
||||||
|
optiondescription_10.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_10.impl_set_information('source', "file2")
|
||||||
|
optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10])
|
||||||
|
option_5 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_13 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_13])
|
||||||
|
optiondescription_26.impl_set_information('type', "service")
|
||||||
|
optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25])
|
||||||
|
option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3])
|
||||||
|
option_18 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_17 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_16 = OptionDescription(name="file", doc="file", children=[option_18, option_17])
|
||||||
|
optiondescription_16.impl_set_information('source', "file")
|
||||||
|
option_21 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_20 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_19 = OptionDescription(name="file2", doc="file2", children=[option_21, option_20])
|
||||||
|
optiondescription_19.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_19.impl_set_information('source', "file2")
|
||||||
|
optiondescription_15 = OptionDescription(name="files", doc="files", children=[optiondescription_16, optiondescription_19])
|
||||||
|
option_14 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_22 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_15, option_14, option_22])
|
||||||
|
optiondescription_30.impl_set_information('type', "service")
|
||||||
|
optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27])
|
|
@ -2,38 +2,43 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_15 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_8 = FilenameOption(name="name", doc="name", default="/etc/file")
|
option_7 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_6 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6])
|
||||||
|
optiondescription_5.impl_set_information('source', "file")
|
||||||
|
option_10 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9])
|
optiondescription_8 = OptionDescription(name="file2", doc="file2", children=[option_10, option_9])
|
||||||
option_7.impl_set_information('source', "file")
|
optiondescription_8.impl_set_information('engine', "jinja2")
|
||||||
option_11 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
optiondescription_8.impl_set_information('source', "file2")
|
||||||
|
option_13 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile")
|
||||||
option_12 = BoolOption(name="activate", doc="activate", default=True)
|
option_12 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12])
|
optiondescription_11 = OptionDescription(name="incfile", doc="incfile", children=[option_13, option_12])
|
||||||
option_10.impl_set_information('engine', "jinja2")
|
optiondescription_11.impl_set_information('included', "content")
|
||||||
option_10.impl_set_information('source', "file2")
|
optiondescription_11.impl_set_information('source', "incfile")
|
||||||
option_14 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile")
|
optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8, optiondescription_11])
|
||||||
option_15 = BoolOption(name="activate", doc="activate", default=True)
|
option_3 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_13 = OptionDescription(name="incfile", doc="incfile", children=[option_14, option_15])
|
option_14 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
option_13.impl_set_information('included', "content")
|
optiondescription_17 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_14])
|
||||||
option_13.impl_set_information('source', "incfile")
|
optiondescription_17.impl_set_information('type', "service")
|
||||||
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10, option_13])
|
optiondescription_16 = OptionDescription(name="services", doc="services", children=[optiondescription_17], properties=frozenset({"hidden"}))
|
||||||
option_16 = BoolOption(name="activate", doc="activate", default=True)
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_16])
|
||||||
option_17 = BoolOption(name="manage", doc="manage", default=True)
|
|
||||||
option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_16, option_17])
|
|
||||||
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])
|
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_30 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
option_9 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_8 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8])
|
||||||
|
optiondescription_7.impl_set_information('source', "file")
|
||||||
|
option_12 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_11 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_11])
|
||||||
|
optiondescription_10.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_10.impl_set_information('source', "file2")
|
||||||
|
option_15 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile")
|
||||||
|
option_14 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_13 = OptionDescription(name="incfile", doc="incfile", children=[option_15, option_14])
|
||||||
|
optiondescription_13.impl_set_information('included', "content")
|
||||||
|
optiondescription_13.impl_set_information('source', "incfile")
|
||||||
|
optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10, optiondescription_13])
|
||||||
|
option_5 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_16 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_32 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_16])
|
||||||
|
optiondescription_32.impl_set_information('type', "service")
|
||||||
|
optiondescription_31 = OptionDescription(name="services", doc="services", children=[optiondescription_32], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_29 = OptionDescription(name="1", doc="1", children=[optiondescription_30, optiondescription_31])
|
||||||
|
option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_34 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3])
|
||||||
|
option_21 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_20 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_19 = OptionDescription(name="file", doc="file", children=[option_21, option_20])
|
||||||
|
optiondescription_19.impl_set_information('source', "file")
|
||||||
|
option_24 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_23 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_22 = OptionDescription(name="file2", doc="file2", children=[option_24, option_23])
|
||||||
|
optiondescription_22.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_22.impl_set_information('source', "file2")
|
||||||
|
option_27 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile")
|
||||||
|
option_26 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_25 = OptionDescription(name="incfile", doc="incfile", children=[option_27, option_26])
|
||||||
|
optiondescription_25.impl_set_information('included', "content")
|
||||||
|
optiondescription_25.impl_set_information('source', "incfile")
|
||||||
|
optiondescription_18 = OptionDescription(name="files", doc="files", children=[optiondescription_19, optiondescription_22, optiondescription_25])
|
||||||
|
option_17 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_28 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_36 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_18, option_17, option_28])
|
||||||
|
optiondescription_36.impl_set_information('type', "service")
|
||||||
|
optiondescription_35 = OptionDescription(name="services", doc="services", children=[optiondescription_36], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_33 = OptionDescription(name="2", doc="2", children=[optiondescription_34, optiondescription_35])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_29, optiondescription_33])
|
|
@ -2,38 +2,43 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_15 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_8 = FilenameOption(name="name", doc="name", default="/etc/file")
|
option_7 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_6 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6])
|
||||||
|
optiondescription_5.impl_set_information('source', "file")
|
||||||
|
option_10 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9])
|
optiondescription_8 = OptionDescription(name="file2", doc="file2", children=[option_10, option_9])
|
||||||
option_7.impl_set_information('source', "file")
|
optiondescription_8.impl_set_information('engine', "jinja2")
|
||||||
option_11 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
optiondescription_8.impl_set_information('source', "file2")
|
||||||
|
option_13 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile")
|
||||||
option_12 = BoolOption(name="activate", doc="activate", default=True)
|
option_12 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12])
|
optiondescription_11 = OptionDescription(name="incfile", doc="incfile", children=[option_13, option_12])
|
||||||
option_10.impl_set_information('engine', "jinja2")
|
optiondescription_11.impl_set_information('included', "name")
|
||||||
option_10.impl_set_information('source', "file2")
|
optiondescription_11.impl_set_information('source', "incfile")
|
||||||
option_14 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile")
|
optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8, optiondescription_11])
|
||||||
option_15 = BoolOption(name="activate", doc="activate", default=True)
|
option_3 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_13 = OptionDescription(name="incfile", doc="incfile", children=[option_14, option_15])
|
option_14 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
option_13.impl_set_information('included', "name")
|
optiondescription_17 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_14])
|
||||||
option_13.impl_set_information('source', "incfile")
|
optiondescription_17.impl_set_information('type', "service")
|
||||||
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10, option_13])
|
optiondescription_16 = OptionDescription(name="services", doc="services", children=[optiondescription_17], properties=frozenset({"hidden"}))
|
||||||
option_16 = BoolOption(name="activate", doc="activate", default=True)
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_15, optiondescription_16])
|
||||||
option_17 = BoolOption(name="manage", doc="manage", default=True)
|
|
||||||
option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_16, option_17])
|
|
||||||
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])
|
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_30 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
option_9 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_8 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8])
|
||||||
|
optiondescription_7.impl_set_information('source', "file")
|
||||||
|
option_12 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_11 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_11])
|
||||||
|
optiondescription_10.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_10.impl_set_information('source', "file2")
|
||||||
|
option_15 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile")
|
||||||
|
option_14 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_13 = OptionDescription(name="incfile", doc="incfile", children=[option_15, option_14])
|
||||||
|
optiondescription_13.impl_set_information('included', "name")
|
||||||
|
optiondescription_13.impl_set_information('source', "incfile")
|
||||||
|
optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10, optiondescription_13])
|
||||||
|
option_5 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_16 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_32 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_16])
|
||||||
|
optiondescription_32.impl_set_information('type', "service")
|
||||||
|
optiondescription_31 = OptionDescription(name="services", doc="services", children=[optiondescription_32], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_29 = OptionDescription(name="1", doc="1", children=[optiondescription_30, optiondescription_31])
|
||||||
|
option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_34 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3])
|
||||||
|
option_21 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_20 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_19 = OptionDescription(name="file", doc="file", children=[option_21, option_20])
|
||||||
|
optiondescription_19.impl_set_information('source', "file")
|
||||||
|
option_24 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_23 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_22 = OptionDescription(name="file2", doc="file2", children=[option_24, option_23])
|
||||||
|
optiondescription_22.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_22.impl_set_information('source', "file2")
|
||||||
|
option_27 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile")
|
||||||
|
option_26 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_25 = OptionDescription(name="incfile", doc="incfile", children=[option_27, option_26])
|
||||||
|
optiondescription_25.impl_set_information('included', "name")
|
||||||
|
optiondescription_25.impl_set_information('source', "incfile")
|
||||||
|
optiondescription_18 = OptionDescription(name="files", doc="files", children=[optiondescription_19, optiondescription_22, optiondescription_25])
|
||||||
|
option_17 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_28 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_36 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_18, option_17, option_28])
|
||||||
|
optiondescription_36.impl_set_information('type', "service")
|
||||||
|
optiondescription_35 = OptionDescription(name="services", doc="services", children=[optiondescription_36], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_33 = OptionDescription(name="2", doc="2", children=[optiondescription_34, optiondescription_35])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_29, optiondescription_33])
|
|
@ -2,37 +2,42 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_16 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_8 = UsernameOption(name="group", doc="group", default="nobody")
|
option_7 = UsernameOption(name="group", doc="group", default="nobody")
|
||||||
option_9 = FilenameOption(name="name", doc="name", default="/etc/file")
|
option_8 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
option_10 = UsernameOption(name="owner", doc="owner", default="nobody")
|
option_9 = UsernameOption(name="owner", doc="owner", default="nobody")
|
||||||
|
option_6 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_8, option_9, option_6])
|
||||||
|
optiondescription_5.impl_set_information('source', "file")
|
||||||
|
option_12 = UsernameOption(name="group", doc="group", default="nobody")
|
||||||
|
option_13 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_14 = UsernameOption(name="owner", doc="owner", default="nobody")
|
||||||
option_11 = BoolOption(name="activate", doc="activate", default=True)
|
option_11 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11])
|
optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_13, option_14, option_11])
|
||||||
option_7.impl_set_information('source', "file")
|
optiondescription_10.impl_set_information('engine', "jinja2")
|
||||||
option_13 = UsernameOption(name="group", doc="group", default="nobody")
|
optiondescription_10.impl_set_information('source', "file2")
|
||||||
option_14 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_10])
|
||||||
option_15 = UsernameOption(name="owner", doc="owner", default="nobody")
|
option_3 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_16 = BoolOption(name="activate", doc="activate", default=True)
|
option_15 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
option_12 = OptionDescription(name="file2", doc="file2", children=[option_13, option_14, option_15, option_16])
|
optiondescription_18 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_15])
|
||||||
option_12.impl_set_information('engine', "jinja2")
|
optiondescription_18.impl_set_information('type', "service")
|
||||||
option_12.impl_set_information('source', "file2")
|
optiondescription_17 = OptionDescription(name="services", doc="services", children=[optiondescription_18], properties=frozenset({"hidden"}))
|
||||||
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_12])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_16, optiondescription_17])
|
||||||
option_17 = BoolOption(name="activate", doc="activate", default=True)
|
|
||||||
option_18 = BoolOption(name="manage", doc="manage", default=True)
|
|
||||||
option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_17, option_18])
|
|
||||||
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])
|
|
||||||
|
|
67
tests/dictionaries/01base_file_owner/tiramisu/multi.py
Normal file
67
tests/dictionaries/01base_file_owner/tiramisu/multi.py
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_32 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
option_9 = UsernameOption(name="group", doc="group", default="nobody")
|
||||||
|
option_10 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_11 = UsernameOption(name="owner", doc="owner", default="nobody")
|
||||||
|
option_8 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_10, option_11, option_8])
|
||||||
|
optiondescription_7.impl_set_information('source', "file")
|
||||||
|
option_14 = UsernameOption(name="group", doc="group", default="nobody")
|
||||||
|
option_15 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_16 = UsernameOption(name="owner", doc="owner", default="nobody")
|
||||||
|
option_13 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_12 = OptionDescription(name="file2", doc="file2", children=[option_14, option_15, option_16, option_13])
|
||||||
|
optiondescription_12.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_12.impl_set_information('source', "file2")
|
||||||
|
optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_12])
|
||||||
|
option_5 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_17 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_34 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_17])
|
||||||
|
optiondescription_34.impl_set_information('type', "service")
|
||||||
|
optiondescription_33 = OptionDescription(name="services", doc="services", children=[optiondescription_34], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_31 = OptionDescription(name="1", doc="1", children=[optiondescription_32, optiondescription_33])
|
||||||
|
option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_36 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3])
|
||||||
|
option_22 = UsernameOption(name="group", doc="group", default="nobody")
|
||||||
|
option_23 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_24 = UsernameOption(name="owner", doc="owner", default="nobody")
|
||||||
|
option_21 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_20 = OptionDescription(name="file", doc="file", children=[option_22, option_23, option_24, option_21])
|
||||||
|
optiondescription_20.impl_set_information('source', "file")
|
||||||
|
option_27 = UsernameOption(name="group", doc="group", default="nobody")
|
||||||
|
option_28 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_29 = UsernameOption(name="owner", doc="owner", default="nobody")
|
||||||
|
option_26 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_25 = OptionDescription(name="file2", doc="file2", children=[option_27, option_28, option_29, option_26])
|
||||||
|
optiondescription_25.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_25.impl_set_information('source', "file2")
|
||||||
|
optiondescription_19 = OptionDescription(name="files", doc="files", children=[optiondescription_20, optiondescription_25])
|
||||||
|
option_18 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_30 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_38 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_19, option_18, option_30])
|
||||||
|
optiondescription_38.impl_set_information('type', "service")
|
||||||
|
optiondescription_37 = OptionDescription(name="services", doc="services", children=[optiondescription_38], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_35 = OptionDescription(name="2", doc="2", children=[optiondescription_36, optiondescription_37])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_31, optiondescription_35])
|
|
@ -2,39 +2,44 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
option_4 = UsernameOption(name="owner", doc="owner", default="nobody", properties=frozenset({"mandatory", "normal"}))
|
option_3 = UsernameOption(name="owner", doc="owner", default="nobody", properties=frozenset({"mandatory", "normal"}))
|
||||||
option_5 = UsernameOption(name="group", doc="group", default="nobody", properties=frozenset({"mandatory", "normal"}))
|
option_4 = UsernameOption(name="group", doc="group", default="nobody", properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_18 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_10 = SymLinkOption(name="group", opt=option_5)
|
option_9 = SymLinkOption(name="group", opt=option_4)
|
||||||
option_11 = FilenameOption(name="name", doc="name", default="/etc/file")
|
option_10 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
option_12 = SymLinkOption(name="owner", opt=option_4)
|
option_11 = SymLinkOption(name="owner", opt=option_3)
|
||||||
|
option_8 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_10, option_11, option_8])
|
||||||
|
optiondescription_7.impl_set_information('source', "file")
|
||||||
|
option_14 = SymLinkOption(name="group", opt=option_4)
|
||||||
|
option_15 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_16 = SymLinkOption(name="owner", opt=option_3)
|
||||||
option_13 = BoolOption(name="activate", doc="activate", default=True)
|
option_13 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11, option_12, option_13])
|
optiondescription_12 = OptionDescription(name="file2", doc="file2", children=[option_14, option_15, option_16, option_13])
|
||||||
option_9.impl_set_information('source', "file")
|
optiondescription_12.impl_set_information('engine', "jinja2")
|
||||||
option_15 = SymLinkOption(name="group", opt=option_5)
|
optiondescription_12.impl_set_information('source', "file2")
|
||||||
option_16 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_12])
|
||||||
option_17 = SymLinkOption(name="owner", opt=option_4)
|
option_5 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_18 = BoolOption(name="activate", doc="activate", default=True)
|
option_17 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
option_14 = OptionDescription(name="file2", doc="file2", children=[option_15, option_16, option_17, option_18])
|
optiondescription_20 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_17])
|
||||||
option_14.impl_set_information('engine', "jinja2")
|
optiondescription_20.impl_set_information('type', "service")
|
||||||
option_14.impl_set_information('source', "file2")
|
optiondescription_19 = OptionDescription(name="services", doc="services", children=[optiondescription_20], properties=frozenset({"hidden"}))
|
||||||
option_8 = OptionDescription(name="files", doc="files", children=[option_9, option_14])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_18, optiondescription_19])
|
||||||
option_19 = BoolOption(name="activate", doc="activate", default=True)
|
|
||||||
option_20 = BoolOption(name="manage", doc="manage", default=True)
|
|
||||||
option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_19, option_20])
|
|
||||||
option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"}))
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6])
|
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_3 = UsernameOption(name="owner", doc="owner", default="nobody", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_4 = UsernameOption(name="group", doc="group", default="nobody", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3, option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_36 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
option_13 = SymLinkOption(name="group", opt=option_4)
|
||||||
|
option_14 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_15 = SymLinkOption(name="owner", opt=option_3)
|
||||||
|
option_12 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_11 = OptionDescription(name="file", doc="file", children=[option_13, option_14, option_15, option_12])
|
||||||
|
optiondescription_11.impl_set_information('source', "file")
|
||||||
|
option_18 = SymLinkOption(name="group", opt=option_4)
|
||||||
|
option_19 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_20 = SymLinkOption(name="owner", opt=option_3)
|
||||||
|
option_17 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_16 = OptionDescription(name="file2", doc="file2", children=[option_18, option_19, option_20, option_17])
|
||||||
|
optiondescription_16.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_16.impl_set_information('source', "file2")
|
||||||
|
optiondescription_10 = OptionDescription(name="files", doc="files", children=[optiondescription_11, optiondescription_16])
|
||||||
|
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_21 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_38 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_10, option_9, option_21])
|
||||||
|
optiondescription_38.impl_set_information('type', "service")
|
||||||
|
optiondescription_37 = OptionDescription(name="services", doc="services", children=[optiondescription_38], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_35 = OptionDescription(name="1", doc="1", children=[optiondescription_36, optiondescription_37])
|
||||||
|
option_6 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_7 = UsernameOption(name="owner", doc="owner", default="nobody", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_8 = UsernameOption(name="group", doc="group", default="nobody", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="general", doc="general", children=[option_6, option_7, option_8], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_40 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_5])
|
||||||
|
option_26 = SymLinkOption(name="group", opt=option_8)
|
||||||
|
option_27 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_28 = SymLinkOption(name="owner", opt=option_7)
|
||||||
|
option_25 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_24 = OptionDescription(name="file", doc="file", children=[option_26, option_27, option_28, option_25])
|
||||||
|
optiondescription_24.impl_set_information('source', "file")
|
||||||
|
option_31 = SymLinkOption(name="group", opt=option_8)
|
||||||
|
option_32 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_33 = SymLinkOption(name="owner", opt=option_7)
|
||||||
|
option_30 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_29 = OptionDescription(name="file2", doc="file2", children=[option_31, option_32, option_33, option_30])
|
||||||
|
optiondescription_29.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_29.impl_set_information('source', "file2")
|
||||||
|
optiondescription_23 = OptionDescription(name="files", doc="files", children=[optiondescription_24, optiondescription_29])
|
||||||
|
option_22 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_34 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_42 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_23, option_22, option_34])
|
||||||
|
optiondescription_42.impl_set_information('type', "service")
|
||||||
|
optiondescription_41 = OptionDescription(name="services", doc="services", children=[optiondescription_42], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_39 = OptionDescription(name="2", doc="2", children=[optiondescription_40, optiondescription_41])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_35, optiondescription_39])
|
|
@ -2,33 +2,38 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_8 = FilenameOption(name="name", doc="name", default="/etc/file")
|
option_7 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_6 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6])
|
||||||
|
optiondescription_5.impl_set_information('source', "file")
|
||||||
|
option_10 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9])
|
optiondescription_8 = OptionDescription(name="file2", doc="file2", children=[option_10, option_9])
|
||||||
option_7.impl_set_information('source', "file")
|
optiondescription_8.impl_set_information('engine', "jinja2")
|
||||||
option_11 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
optiondescription_8.impl_set_information('source', "file2")
|
||||||
option_12 = BoolOption(name="activate", doc="activate", default=True)
|
optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8])
|
||||||
option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12])
|
option_3 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_10.impl_set_information('engine', "jinja2")
|
option_11 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
option_10.impl_set_information('source', "file2")
|
optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_11])
|
||||||
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10])
|
optiondescription_14.impl_set_information('type', "service")
|
||||||
option_13 = BoolOption(name="activate", doc="activate", default=True)
|
optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"}))
|
||||||
option_14 = BoolOption(name="manage", doc="manage", default=True)
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13])
|
||||||
option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_13, option_14])
|
|
||||||
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])
|
|
||||||
|
|
59
tests/dictionaries/01base_file_patch/tiramisu/multi.py
Normal file
59
tests/dictionaries/01base_file_patch/tiramisu/multi.py
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
option_9 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_8 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8])
|
||||||
|
optiondescription_7.impl_set_information('source', "file")
|
||||||
|
option_12 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_11 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_11])
|
||||||
|
optiondescription_10.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_10.impl_set_information('source', "file2")
|
||||||
|
optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10])
|
||||||
|
option_5 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_13 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_13])
|
||||||
|
optiondescription_26.impl_set_information('type', "service")
|
||||||
|
optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25])
|
||||||
|
option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3])
|
||||||
|
option_18 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_17 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_16 = OptionDescription(name="file", doc="file", children=[option_18, option_17])
|
||||||
|
optiondescription_16.impl_set_information('source', "file")
|
||||||
|
option_21 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_20 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_19 = OptionDescription(name="file2", doc="file2", children=[option_21, option_20])
|
||||||
|
optiondescription_19.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_19.impl_set_information('source', "file2")
|
||||||
|
optiondescription_15 = OptionDescription(name="files", doc="files", children=[optiondescription_16, optiondescription_19])
|
||||||
|
option_14 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_22 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_15, option_14, option_22])
|
||||||
|
optiondescription_30.impl_set_information('type', "service")
|
||||||
|
optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27])
|
|
@ -2,33 +2,38 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_8 = FilenameOption(name="name", doc="name", default="/etc/file")
|
option_7 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_6 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_5 = OptionDescription(name="file", doc="file", children=[option_7, option_6])
|
||||||
|
optiondescription_5.impl_set_information('source', "file")
|
||||||
|
option_10 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9])
|
optiondescription_8 = OptionDescription(name="file2", doc="file2", children=[option_10, option_9])
|
||||||
option_7.impl_set_information('source', "file")
|
optiondescription_8.impl_set_information('engine', "jinja2")
|
||||||
option_11 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
optiondescription_8.impl_set_information('source', "file2")
|
||||||
option_12 = BoolOption(name="activate", doc="activate", default=True)
|
optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8])
|
||||||
option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12])
|
option_3 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_10.impl_set_information('engine', "jinja2")
|
option_11 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
option_10.impl_set_information('source', "file2")
|
optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_11])
|
||||||
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10])
|
optiondescription_14.impl_set_information('type', "service")
|
||||||
option_13 = BoolOption(name="activate", doc="activate", default=True)
|
optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"}))
|
||||||
option_14 = BoolOption(name="manage", doc="manage", default=True)
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13])
|
||||||
option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_13, option_14])
|
|
||||||
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])
|
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
option_9 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_8 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_7 = OptionDescription(name="file", doc="file", children=[option_9, option_8])
|
||||||
|
optiondescription_7.impl_set_information('source', "file")
|
||||||
|
option_12 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_11 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_10 = OptionDescription(name="file2", doc="file2", children=[option_12, option_11])
|
||||||
|
optiondescription_10.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_10.impl_set_information('source', "file2")
|
||||||
|
optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10])
|
||||||
|
option_5 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_13 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_13])
|
||||||
|
optiondescription_26.impl_set_information('type', "service")
|
||||||
|
optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25])
|
||||||
|
option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3])
|
||||||
|
option_18 = FilenameOption(name="name", doc="name", default="/etc/file")
|
||||||
|
option_17 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_16 = OptionDescription(name="file", doc="file", children=[option_18, option_17])
|
||||||
|
optiondescription_16.impl_set_information('source', "file")
|
||||||
|
option_21 = FilenameOption(name="name", doc="name", default="/etc/file2")
|
||||||
|
option_20 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_19 = OptionDescription(name="file2", doc="file2", children=[option_21, option_20])
|
||||||
|
optiondescription_19.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_19.impl_set_information('source', "file2")
|
||||||
|
optiondescription_15 = OptionDescription(name="files", doc="files", children=[optiondescription_16, optiondescription_19])
|
||||||
|
option_14 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_22 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_15, option_14, option_22])
|
||||||
|
optiondescription_30.impl_set_information('type', "service")
|
||||||
|
optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27])
|
|
@ -2,33 +2,38 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_8 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel")
|
option_7 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel")
|
||||||
|
option_6 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_5 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel", doc="systemd-makefs@dev-disk-by\\x2dpartlabel", children=[option_7, option_6])
|
||||||
|
optiondescription_5.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel")
|
||||||
|
option_10 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2")
|
||||||
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
option_9 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_7 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel", doc="systemd-makefs@dev-disk-by\\x2dpartlabel", children=[option_8, option_9])
|
optiondescription_8 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel2", doc="systemd-makefs@dev-disk-by\\x2dpartlabel2", children=[option_10, option_9])
|
||||||
option_7.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel")
|
optiondescription_8.impl_set_information('engine', "jinja2")
|
||||||
option_11 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2")
|
optiondescription_8.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel2")
|
||||||
option_12 = BoolOption(name="activate", doc="activate", default=True)
|
optiondescription_4 = OptionDescription(name="files", doc="files", children=[optiondescription_5, optiondescription_8])
|
||||||
option_10 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel2", doc="systemd-makefs@dev-disk-by\\x2dpartlabel2", children=[option_11, option_12])
|
option_3 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
option_10.impl_set_information('engine', "jinja2")
|
option_11 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
option_10.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel2")
|
optiondescription_14 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_4, option_3, option_11])
|
||||||
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10])
|
optiondescription_14.impl_set_information('type', "service")
|
||||||
option_13 = BoolOption(name="activate", doc="activate", default=True)
|
optiondescription_13 = OptionDescription(name="services", doc="services", children=[optiondescription_14], properties=frozenset({"hidden"}))
|
||||||
option_14 = BoolOption(name="manage", doc="manage", default=True)
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_12, optiondescription_13])
|
||||||
option_5 = OptionDescription(name="test_service", doc="test.service", children=[option_6, option_13, option_14])
|
|
||||||
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])
|
|
||||||
|
|
59
tests/dictionaries/01base_file_utfchar/tiramisu/multi.py
Normal file
59
tests/dictionaries/01base_file_utfchar/tiramisu/multi.py
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_24 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
option_9 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel")
|
||||||
|
option_8 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_7 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel", doc="systemd-makefs@dev-disk-by\\x2dpartlabel", children=[option_9, option_8])
|
||||||
|
optiondescription_7.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel")
|
||||||
|
option_12 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2")
|
||||||
|
option_11 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_10 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel2", doc="systemd-makefs@dev-disk-by\\x2dpartlabel2", children=[option_12, option_11])
|
||||||
|
optiondescription_10.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_10.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel2")
|
||||||
|
optiondescription_6 = OptionDescription(name="files", doc="files", children=[optiondescription_7, optiondescription_10])
|
||||||
|
option_5 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_13 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_26 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_6, option_5, option_13])
|
||||||
|
optiondescription_26.impl_set_information('type', "service")
|
||||||
|
optiondescription_25 = OptionDescription(name="services", doc="services", children=[optiondescription_26], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_23 = OptionDescription(name="1", doc="1", children=[optiondescription_24, optiondescription_25])
|
||||||
|
option_4 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_28 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3])
|
||||||
|
option_18 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel")
|
||||||
|
option_17 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_16 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel", doc="systemd-makefs@dev-disk-by\\x2dpartlabel", children=[option_18, option_17])
|
||||||
|
optiondescription_16.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel")
|
||||||
|
option_21 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2")
|
||||||
|
option_20 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
optiondescription_19 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel2", doc="systemd-makefs@dev-disk-by\\x2dpartlabel2", children=[option_21, option_20])
|
||||||
|
optiondescription_19.impl_set_information('engine', "jinja2")
|
||||||
|
optiondescription_19.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel2")
|
||||||
|
optiondescription_15 = OptionDescription(name="files", doc="files", children=[optiondescription_16, optiondescription_19])
|
||||||
|
option_14 = BoolOption(name="activate", doc="activate", default=True)
|
||||||
|
option_22 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
optiondescription_30 = OptionDescription(name="test_service", doc="test.service", children=[optiondescription_15, option_14, option_22])
|
||||||
|
optiondescription_30.impl_set_information('type', "service")
|
||||||
|
optiondescription_29 = OptionDescription(name="services", doc="services", children=[optiondescription_30], properties=frozenset({"hidden"}))
|
||||||
|
optiondescription_27 = OptionDescription(name="2", doc="2", children=[optiondescription_28, optiondescription_29])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_23, optiondescription_27])
|
|
@ -2,20 +2,24 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"}))
|
option_2 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"}))
|
||||||
option_4 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"}))
|
option_3 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4])
|
||||||
|
|
31
tests/dictionaries/01base_float/tiramisu/multi.py
Normal file
31
tests/dictionaries/01base_float/tiramisu/multi.py
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_3 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8])
|
||||||
|
option_5 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_6 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4])
|
||||||
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9])
|
|
@ -2,22 +2,26 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", properties=frozenset({"normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", properties=frozenset({"normal"}))
|
||||||
option_3.impl_set_information('help', "message with '")
|
option_2.impl_set_information('help', "message with '")
|
||||||
option_4 = StrOption(name="mode_conteneur_actif1", doc="Redefine description", properties=frozenset({"normal"}))
|
option_3 = StrOption(name="mode_conteneur_actif1", doc="Redefine description", properties=frozenset({"normal"}))
|
||||||
option_4.impl_set_information('help', "message with \"")
|
option_3.impl_set_information('help', "message with \"")
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4])
|
||||||
|
|
35
tests/dictionaries/01base_help_quote/tiramisu/multi.py
Normal file
35
tests/dictionaries/01base_help_quote/tiramisu/multi.py
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", properties=frozenset({"normal"}))
|
||||||
|
option_2.impl_set_information('help', "message with '")
|
||||||
|
option_3 = StrOption(name="mode_conteneur_actif1", doc="Redefine description", properties=frozenset({"normal"}))
|
||||||
|
option_3.impl_set_information('help', "message with \"")
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8])
|
||||||
|
option_5 = StrOption(name="mode_conteneur_actif", doc="Redefine description", properties=frozenset({"normal"}))
|
||||||
|
option_5.impl_set_information('help', "message with '")
|
||||||
|
option_6 = StrOption(name="mode_conteneur_actif1", doc="Redefine description", properties=frozenset({"normal"}))
|
||||||
|
option_6.impl_set_information('help', "message with \"")
|
||||||
|
optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4])
|
||||||
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9])
|
|
@ -2,19 +2,23 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3])
|
||||||
|
|
29
tests/dictionaries/01base_multi/tiramisu/multi.py
Normal file
29
tests/dictionaries/01base_multi/tiramisu/multi.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6])
|
||||||
|
option_4 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3])
|
||||||
|
optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7])
|
10
tests/dictionaries/01base_multi_notuniq/00-base.xml
Normal file
10
tests/dictionaries/01base_multi_notuniq/00-base.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<rougail version="0.10">
|
||||||
|
<variables>
|
||||||
|
<family name="general">
|
||||||
|
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True" multi="True" unique="False">
|
||||||
|
<value>non</value>
|
||||||
|
</variable>
|
||||||
|
</family>
|
||||||
|
</variables>
|
||||||
|
</rougail>
|
0
tests/dictionaries/01base_multi_notuniq/__init__.py
Normal file
0
tests/dictionaries/01base_multi_notuniq/__init__.py
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"rougail.general.mode_conteneur_actif": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": [
|
||||||
|
"non"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"rougail.general.mode_conteneur_actif": [
|
||||||
|
"non"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"rougail.general.mode_conteneur_actif": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": [
|
||||||
|
"non"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
24
tests/dictionaries/01base_multi_notuniq/tiramisu/base.py
Normal file
24
tests/dictionaries/01base_multi_notuniq/tiramisu/base.py
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", "notunique"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3])
|
29
tests/dictionaries/01base_multi_notuniq/tiramisu/multi.py
Normal file
29
tests/dictionaries/01base_multi_notuniq/tiramisu/multi.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", "notunique"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6])
|
||||||
|
option_4 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", "notunique"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3])
|
||||||
|
optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7])
|
10
tests/dictionaries/01base_multi_uniq/00-base.xml
Normal file
10
tests/dictionaries/01base_multi_uniq/00-base.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<rougail version="0.10">
|
||||||
|
<variables>
|
||||||
|
<family name="general">
|
||||||
|
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True" multi="True" unique="True">
|
||||||
|
<value>non</value>
|
||||||
|
</variable>
|
||||||
|
</family>
|
||||||
|
</variables>
|
||||||
|
</rougail>
|
0
tests/dictionaries/01base_multi_uniq/__init__.py
Normal file
0
tests/dictionaries/01base_multi_uniq/__init__.py
Normal file
8
tests/dictionaries/01base_multi_uniq/makedict/after.json
Normal file
8
tests/dictionaries/01base_multi_uniq/makedict/after.json
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"rougail.general.mode_conteneur_actif": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": [
|
||||||
|
"non"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
5
tests/dictionaries/01base_multi_uniq/makedict/base.json
Normal file
5
tests/dictionaries/01base_multi_uniq/makedict/base.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"rougail.general.mode_conteneur_actif": [
|
||||||
|
"non"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"rougail.general.mode_conteneur_actif": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": [
|
||||||
|
"non"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
24
tests/dictionaries/01base_multi_uniq/tiramisu/base.py
Normal file
24
tests/dictionaries/01base_multi_uniq/tiramisu/base.py
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", "unique"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_3])
|
29
tests/dictionaries/01base_multi_uniq/tiramisu/multi.py
Normal file
29
tests/dictionaries/01base_multi_uniq/tiramisu/multi.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", "unique"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6])
|
||||||
|
option_4 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", "unique"}))
|
||||||
|
optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3])
|
||||||
|
optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7])
|
|
@ -2,21 +2,25 @@ from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
class func:
|
class func:
|
||||||
pass
|
pass
|
||||||
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
|
||||||
_spec = _spec_from_loader(_loader.name, _loader)
|
def _load_functions(path):
|
||||||
_func = _module_from_spec(_spec)
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
_loader.exec_module(_func)
|
loader = _SourceFileLoader('func', path)
|
||||||
for function in dir(_func):
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
if function.startswith('_'):
|
func_ = _module_from_spec(spec)
|
||||||
continue
|
loader.exec_module(func_)
|
||||||
setattr(func, function, getattr(_func, function))
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
try:
|
try:
|
||||||
from tiramisu3 import *
|
from tiramisu3 import *
|
||||||
except:
|
except:
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
option_3 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"}))
|
option_2 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"}))
|
||||||
option_4 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"}))
|
option_3 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"}))
|
||||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"}))
|
||||||
option_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2])
|
optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4])
|
||||||
option_0.impl_set_information('provider:float', "rougail.general.float")
|
option_0.impl_set_information('provider:float', "rougail.general.float")
|
||||||
|
|
33
tests/dictionaries/01base_provider/tiramisu/multi.py
Normal file
33
tests/dictionaries/01base_provider/tiramisu/multi.py
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_3 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2, option_3], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1])
|
||||||
|
optiondescription_7 = OptionDescription(name="1", doc="1", children=[optiondescription_8])
|
||||||
|
optiondescription_7.impl_set_information('provider:float', "rougail.general.float")
|
||||||
|
option_5 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_6 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="general", doc="general", children=[option_5, option_6], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_4])
|
||||||
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10])
|
||||||
|
optiondescription_9.impl_set_information('provider:float', "rougail.general.float")
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_7, optiondescription_9])
|
6
tests/dictionaries/01base_provider_extra/00-base.xml
Normal file
6
tests/dictionaries/01base_provider_extra/00-base.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<rougail version="0.10">
|
||||||
|
<variables>
|
||||||
|
<variable name="float" type="float" description="Description"/>
|
||||||
|
</variables>
|
||||||
|
</rougail>
|
0
tests/dictionaries/01base_provider_extra/__init__.py
Normal file
0
tests/dictionaries/01base_provider_extra/__init__.py
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<rougail version="0.10">
|
||||||
|
<variables>
|
||||||
|
<family name="example">
|
||||||
|
<variable name="description" type="string" provider="example"/>
|
||||||
|
</family>
|
||||||
|
</variables>
|
||||||
|
</rougail>
|
10
tests/dictionaries/01base_provider_extra/makedict/after.json
Normal file
10
tests/dictionaries/01base_provider_extra/makedict/after.json
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"rougail.float": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
"extra.example.description": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": null
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"rougail.float": null,
|
||||||
|
"extra.example.description": null
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"rougail.float": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
"extra.example.description": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": null
|
||||||
|
}
|
||||||
|
}
|
27
tests/dictionaries/01base_provider_extra/tiramisu/base.py
Normal file
27
tests/dictionaries/01base_provider_extra/tiramisu/base.py
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||||
|
class func:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _load_functions(path):
|
||||||
|
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||||
|
loader = _SourceFileLoader('func', path)
|
||||||
|
spec = _spec_from_loader(loader.name, loader)
|
||||||
|
func_ = _module_from_spec(spec)
|
||||||
|
loader.exec_module(func_)
|
||||||
|
for function in dir(func_):
|
||||||
|
if function.startswith('_'):
|
||||||
|
continue
|
||||||
|
setattr(func, function, getattr(func_, function))
|
||||||
|
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_1 = FloatOption(name="float", doc="Description", properties=frozenset({"normal"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="rougail", doc="Rougail", children=[option_1])
|
||||||
|
option_3 = StrOption(name="description", doc="description", properties=frozenset({"normal"}))
|
||||||
|
optiondescription_2 = OptionDescription(name="example", doc="example", children=[option_3], properties=frozenset({"normal"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="extra", doc="extra", children=[optiondescription_2])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_4, optiondescription_5])
|
||||||
|
option_0.impl_set_information('provider:example', "extra.example.description")
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue