valid_enum is now choice
This commit is contained in:
parent
d7a1a52ebb
commit
b35d930d7e
@ -1,5 +1,4 @@
|
||||
# Les vérifications des valeurs
|
||||
|
||||
- [Fonction de vérification](function.md)
|
||||
- [Les variables à choix](valid_enum.md)
|
||||
- [Réfinition](redefine.md)
|
||||
|
@ -1,46 +0,0 @@
|
||||
# Les variables à choix
|
||||
|
||||
Une variable à choix est d'abord une variable avec une [fonction check](function.md).
|
||||
|
||||
## Les variables à choix simple
|
||||
|
||||
Il est possible d'imposer une liste de valeur pour une variable particulière :
|
||||
|
||||
```
|
||||
<check name="valid_enum">
|
||||
<param>yes</param>
|
||||
<param>no</param>
|
||||
<param>maybe</param>
|
||||
<target>my_variable</target>
|
||||
</check>
|
||||
```
|
||||
|
||||
Dans ce cas, seule les valeurs proposés sont possible pour cette variable.
|
||||
|
||||
Par défaut, cette variable est obligatoire. Cela signifie qu'il n'est pas possible de spécifier "None" à cette variable.
|
||||
|
||||
## Les variables à choix avec valeur None
|
||||
|
||||
Il y a deux possibilités pour avoir une valeur "None" dans les choix :
|
||||
|
||||
- rendre la variable non obligatoire, cela va ajouter un choix "None" dans la liste :
|
||||
|
||||
```
|
||||
<variable name="my_variable" mandatory="False">
|
||||
```
|
||||
|
||||
Ou en ajoutant le paramètre "None" :
|
||||
|
||||
```
|
||||
<check name="valid_enum">
|
||||
<param>yes</param>
|
||||
<param>no</param>
|
||||
<param type='nil'/>
|
||||
<param>maybe</param>
|
||||
<target>my_variable</target>
|
||||
</check>
|
||||
```
|
||||
|
||||
## La valeur par défaut
|
||||
|
||||
Si aucune valeur n'est spécifié pour la variable, automatiquement le premier choix va est placé comme valeur par défaut.
|
@ -116,7 +116,6 @@ Les variables booléans sont par défaut obligatoire. Pour qu'une variable bool
|
||||
```
|
||||
|
||||
Les variables avec une valeur par défaut (non calculée) sont également automatiquement obligatoire.
|
||||
[Les variables à choix](../check/valid_enum.md) sans choix "None" sont également automatiquement obligatoire.
|
||||
|
||||
## Valeur par défaut d'une variable
|
||||
|
||||
|
28
doc/variable/choice.md
Normal file
28
doc/variable/choice.md
Normal file
@ -0,0 +1,28 @@
|
||||
# Les variables à choix
|
||||
|
||||
## Les variables à choix simple
|
||||
|
||||
Il est possible d'imposer une liste de valeur pour une variable particulière :
|
||||
|
||||
```
|
||||
<variable name="my_variable" type="choice">
|
||||
<choice>val1</choice>
|
||||
<choice>val2</choice>
|
||||
<choice>val3</choice>
|
||||
</variable>
|
||||
```
|
||||
|
||||
Dans ce cas, seules les valeurs proposées sont possibles pour cette variable. Mais il est possible de mettre la valeur "None".
|
||||
|
||||
## Les variables à choix avec valeur
|
||||
|
||||
Si on précise une valeur, la variable passe obligatoire et la valeur "None" n'est plus autorisé :
|
||||
|
||||
```
|
||||
<variable name="my_variable" type="choice">
|
||||
<choice>val1</choice>
|
||||
<choice>val2</choice>
|
||||
<choice>val3</choice>
|
||||
<value>val1</value>
|
||||
</variable>
|
||||
```
|
@ -33,7 +33,7 @@ from rougail.utils import load_modules
|
||||
from rougail.i18n import _
|
||||
from rougail.error import DictConsistencyError, display_xmlfiles
|
||||
|
||||
INTERNAL_FUNCTIONS = ['valid_enum', 'valid_in_network', 'valid_differ', 'valid_entier']
|
||||
INTERNAL_FUNCTIONS = ['valid_in_network', 'valid_differ', 'valid_entier']
|
||||
|
||||
class Annotator(TargetAnnotator, ParamAnnotator):
|
||||
"""Annotate check
|
||||
@ -58,21 +58,11 @@ class Annotator(TargetAnnotator, ParamAnnotator):
|
||||
self.convert_target(self.objectspace.space.constraints.check)
|
||||
self.convert_param(self.objectspace.space.constraints.check)
|
||||
self.check_check()
|
||||
self.check_valid_enum()
|
||||
self.check_change_warning()
|
||||
self.convert_valid_entier()
|
||||
self.convert_check()
|
||||
del objectspace.space.constraints.check
|
||||
|
||||
def valid_type_validation(self,
|
||||
obj,
|
||||
) -> None:
|
||||
variable_type = None
|
||||
if obj.name == 'valid_enum':
|
||||
for target in obj.target:
|
||||
variable_type = target.name.type
|
||||
return variable_type
|
||||
|
||||
def check_check(self): # pylint: disable=R0912
|
||||
"""valid and manage <check>
|
||||
"""
|
||||
@ -87,119 +77,6 @@ class Annotator(TargetAnnotator, ParamAnnotator):
|
||||
for idx in remove_indexes:
|
||||
del self.objectspace.space.constraints.check[idx]
|
||||
|
||||
def check_valid_enum(self):
|
||||
"""verify valid_enum
|
||||
"""
|
||||
remove_indexes = []
|
||||
for idx, check in enumerate(self.objectspace.space.constraints.check):
|
||||
if check.name != 'valid_enum':
|
||||
continue
|
||||
for target in check.target:
|
||||
if target.name.path in self.objectspace.valid_enums:
|
||||
check_xmlfiles = display_xmlfiles(self.objectspace.valid_enums\
|
||||
[target.name.path]['xmlfiles'])
|
||||
msg = _(f'valid_enum already set in {check_xmlfiles} '
|
||||
f'for "{target.name.name}", you may have forget remove_check')
|
||||
raise DictConsistencyError(msg, 3, check.xmlfiles)
|
||||
if not hasattr(check, 'param'):
|
||||
msg = _(f'param is mandatory for a valid_enum of variable "{target.name.name}"')
|
||||
raise DictConsistencyError(msg, 4, check.xmlfiles)
|
||||
variable_type = target.name.type
|
||||
values = self._set_valid_enum(target.name,
|
||||
check,
|
||||
)
|
||||
if values:
|
||||
if hasattr(target.name, 'value'):
|
||||
# check value
|
||||
self.check_valid_enum_value(target.name, values)
|
||||
else:
|
||||
# no value, set the first choice as default value
|
||||
new_value = self.objectspace.value(check.xmlfiles)
|
||||
new_value.name = values[0]
|
||||
new_value.type = variable_type
|
||||
target.name.value = [new_value]
|
||||
remove_indexes.append(idx)
|
||||
remove_indexes.sort(reverse=True)
|
||||
for idx in remove_indexes:
|
||||
del self.objectspace.space.constraints.check[idx]
|
||||
|
||||
def _set_valid_enum(self,
|
||||
variable,
|
||||
check,
|
||||
) -> List[Any]:
|
||||
# build choice
|
||||
variable.values = []
|
||||
variable.ori_type = variable.type
|
||||
variable.type = 'choice'
|
||||
|
||||
has_variable = False
|
||||
values = []
|
||||
has_nil = False
|
||||
is_function = False
|
||||
for param in check.param:
|
||||
if has_variable:
|
||||
msg = _(f'only one "variable" parameter is allowed for valid_enum '
|
||||
f'of variable "{variable.name}"')
|
||||
raise DictConsistencyError(msg, 5, param.xmlfiles)
|
||||
if param.type == 'function':
|
||||
is_function = True
|
||||
choice = self.objectspace.choice(variable.xmlfiles)
|
||||
choice.name = param.text
|
||||
choice.type = 'function'
|
||||
choice.param = []
|
||||
variable.values.append(choice)
|
||||
continue
|
||||
if is_function:
|
||||
variable.values[0].param.append(param)
|
||||
continue
|
||||
param_type = variable.ori_type
|
||||
if param.type == 'variable':
|
||||
has_variable = True
|
||||
if param.optional is True:
|
||||
msg = _(f'optional parameter in valid_enum for variable "{variable.name}" '
|
||||
f'is not allowed')
|
||||
raise DictConsistencyError(msg, 14, param.xmlfiles)
|
||||
if not param.text.multi:
|
||||
msg = _(f'only multi "variable" parameter is allowed for valid_enum '
|
||||
f'of variable "{variable.name}"')
|
||||
raise DictConsistencyError(msg, 6, param.xmlfiles)
|
||||
param_type = 'variable'
|
||||
elif param.type == 'nil':
|
||||
has_nil = True
|
||||
values.append(param.text)
|
||||
choice = self.objectspace.choice(variable.xmlfiles)
|
||||
choice.name = param.text
|
||||
choice.type = param_type
|
||||
variable.values.append(choice)
|
||||
if is_function:
|
||||
return None
|
||||
if 'mandatory' not in vars(variable):
|
||||
variable.mandatory = not has_nil
|
||||
elif variable.mandatory is False:
|
||||
choice = self.objectspace.choice(variable.xmlfiles)
|
||||
choice.name = None
|
||||
choice.type = 'nil'
|
||||
variable.values.append(choice)
|
||||
if has_variable:
|
||||
return None
|
||||
self.objectspace.valid_enums[variable.path] = {'type': variable.ori_type,
|
||||
'values': values,
|
||||
'xmlfiles': check.xmlfiles,
|
||||
}
|
||||
return values
|
||||
|
||||
@staticmethod
|
||||
def check_valid_enum_value(variable,
|
||||
values,
|
||||
) -> None:
|
||||
"""check that values in valid_enum are valid
|
||||
"""
|
||||
for value in variable.value:
|
||||
if value.name not in values:
|
||||
msg = _(f'value "{value.name}" of variable "{variable.name}" is not in list '
|
||||
f'of all expected values ({values})')
|
||||
raise DictConsistencyError(msg, 15, value.xmlfiles)
|
||||
|
||||
def check_change_warning(self):
|
||||
"""convert level to "warnings_only"
|
||||
"""
|
||||
|
@ -67,7 +67,7 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk):
|
||||
obj,
|
||||
) -> None:
|
||||
if obj.source.type == 'choice':
|
||||
return obj.source.ori_type
|
||||
return None
|
||||
return obj.source.type
|
||||
|
||||
def convert_auto_freeze(self):
|
||||
|
@ -132,16 +132,17 @@ class ParamAnnotator:
|
||||
msg = _(f'parameter has incompatible type "{param.type}" '
|
||||
f'with type "{variable_type}"')
|
||||
raise DictConsistencyError(msg, 7, param.xmlfiles)
|
||||
try:
|
||||
option = CONVERT_OPTION[variable_type]
|
||||
param.text = option.get('func', str)(param.text)
|
||||
getattr(tiramisu, option['opttype'])('test',
|
||||
'Object to valid value',
|
||||
param.text,
|
||||
**option.get('initkwargs', {}),
|
||||
)
|
||||
except ValueError as err:
|
||||
msg = _(f'unable to change type of value "{param.text}" '
|
||||
f'is not a valid "{variable_type}"')
|
||||
raise DictConsistencyError(msg, 13, param.xmlfiles) from err
|
||||
if variable_type != 'choice':
|
||||
try:
|
||||
option = CONVERT_OPTION[variable_type]
|
||||
param.text = option.get('func', str)(param.text)
|
||||
getattr(tiramisu, option['opttype'])('test',
|
||||
'Object to valid value',
|
||||
param.text,
|
||||
**option.get('initkwargs', {}),
|
||||
)
|
||||
except ValueError as err:
|
||||
msg = _(f'unable to change type of value "{param.text}" '
|
||||
f'is not a valid "{variable_type}"')
|
||||
raise DictConsistencyError(msg, 13, param.xmlfiles) from err
|
||||
param.type = variable_type
|
||||
|
@ -41,6 +41,7 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||
return
|
||||
self.objectspace = objectspace
|
||||
self.convert_value()
|
||||
self.add_choice_nil()
|
||||
|
||||
def convert_value(self) -> None:
|
||||
"""convert value
|
||||
@ -83,8 +84,22 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||
variable.default_multi = variable.value[0].name
|
||||
else:
|
||||
if len(variable.value) > 1:
|
||||
msg = _(f'the non multi variable "{variable.name}" cannot have '
|
||||
msg = _(f'the none multi variable "{variable.name}" cannot have '
|
||||
'more than one value')
|
||||
raise DictConsistencyError(msg, 68, variable.xmlfiles)
|
||||
variable.default = variable.value[0].name
|
||||
del variable.value
|
||||
|
||||
def add_choice_nil(self) -> None:
|
||||
for variable in self.get_variables():
|
||||
if variable.type != 'choice':
|
||||
continue
|
||||
is_none = False
|
||||
for choice in variable.choice:
|
||||
if choice.type == 'nil':
|
||||
is_none = True
|
||||
if not variable.mandatory and not is_none:
|
||||
choice = self.objectspace.choice(variable.xmlfiles)
|
||||
choice.name = None
|
||||
choice.type = 'nil'
|
||||
variable.choice.append(choice)
|
||||
|
@ -62,11 +62,6 @@ CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int),
|
||||
}
|
||||
|
||||
|
||||
FORCE_CHOICE = {'schedule': ['none', 'daily', 'weekly', 'monthly'],
|
||||
'schedulemod': ['pre', 'post'],
|
||||
}
|
||||
|
||||
|
||||
class Walk:
|
||||
"""Walk to objectspace to find variable or family
|
||||
"""
|
||||
@ -154,36 +149,49 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||
del variable.value[idx]
|
||||
if not variable.value:
|
||||
del variable.value
|
||||
if hasattr(variable, 'choice'):
|
||||
if variable.type != 'choice':
|
||||
msg = _(f'choice for the variable "{variable.name}" not allowed with "{variable.type}" type')
|
||||
raise DictConsistencyError(msg, 3, variable.xmlfiles)
|
||||
values = []
|
||||
choice_type = None
|
||||
for choice in variable.choice:
|
||||
if choice_type == 'variable':
|
||||
msg = _(f'only one "variable" choice is allowed '
|
||||
f'the variable "{variable.name}"')
|
||||
raise DictConsistencyError(msg, 5, choice.xmlfiles)
|
||||
if choice.type == 'nil':
|
||||
choice.name = None
|
||||
elif choice.type == 'variable':
|
||||
choice.name = self.objectspace.paths.get_variable(choice.name)
|
||||
if not choice.name.multi:
|
||||
msg = _(f'only multi "variable" is allowed for a choice '
|
||||
f'of variable "{variable.name}"')
|
||||
raise DictConsistencyError(msg, 6, choice.xmlfiles)
|
||||
else:
|
||||
if not hasattr(choice, 'name'):
|
||||
msg = _(f'choice for variable "{variable.name}" must have a value')
|
||||
raise DictConsistencyError(msg, 14, choice.xmlfiles)
|
||||
choice.name = CONVERT_OPTION.get(choice.type, {}).get('func', str)(choice.name)
|
||||
if choice_type is None:
|
||||
choice_type = choice.type
|
||||
values.append(choice.name)
|
||||
if choice_type not in ['function', 'variable'] and hasattr(variable, 'value'):
|
||||
for value in variable.value:
|
||||
if value.name not in values:
|
||||
msg = _(f'value "{value.name}" of variable "{variable.name}" is not in list '
|
||||
f'of all expected values ({values})')
|
||||
raise DictConsistencyError(msg, 15, value.xmlfiles)
|
||||
ref_choice = variable.choice[0]
|
||||
self.objectspace.valid_enums[variable.path] = {'type': ref_choice.type,
|
||||
'values': values,
|
||||
'xmlfiles': ref_choice.xmlfiles,
|
||||
}
|
||||
elif variable.type == 'choice':
|
||||
msg = _(f'choice is mandatory for the variable "{variable.name}" with choice type')
|
||||
raise DictConsistencyError(msg, 4, variable.xmlfiles)
|
||||
variable.doc = variable.description
|
||||
del variable.description
|
||||
self._convert_valid_enum(variable)
|
||||
|
||||
def _convert_valid_enum(self,
|
||||
variable,
|
||||
):
|
||||
"""some types are, in fact, choices
|
||||
convert this kind of variables into choice
|
||||
"""
|
||||
if variable.type in FORCE_CHOICE:
|
||||
if not hasattr(self.objectspace.space, 'constraints'):
|
||||
xmlfiles = variable.xmlfiles
|
||||
self.objectspace.space.constraints = self.objectspace.constraints(xmlfiles)
|
||||
self.objectspace.space.constraints.namespace = variable.namespace
|
||||
if not hasattr(self.objectspace.space.constraints, 'check'):
|
||||
self.objectspace.space.constraints.check = []
|
||||
check = self.objectspace.check(variable.xmlfiles)
|
||||
check.name = 'valid_enum'
|
||||
target = self.objectspace.target(variable.xmlfiles)
|
||||
target.name = variable.path
|
||||
check.target = [target]
|
||||
check.namespace = variable.namespace
|
||||
check.param = []
|
||||
for value in FORCE_CHOICE[variable.type]:
|
||||
param = self.objectspace.param(variable.xmlfiles)
|
||||
param.text = value
|
||||
check.param.append(param)
|
||||
self.objectspace.space.constraints.check.append(check)
|
||||
variable.type = 'string'
|
||||
|
||||
def convert_test(self):
|
||||
"""Convert variable tests value
|
||||
|
@ -87,9 +87,9 @@
|
||||
<!ATTLIST family leadership (True|False) "False">
|
||||
<!ATTLIST family provider CDATA #IMPLIED>
|
||||
|
||||
<!ELEMENT variable (value*)>
|
||||
<!ELEMENT variable ((choice*|value*)*)>
|
||||
<!ATTLIST variable name CDATA #REQUIRED>
|
||||
<!ATTLIST variable type (number|float|string|password|mail|boolean|filename|date|unix_user|ip|local_ip|netmask|network|broadcast|netbios|domainname|hostname|web_address|port|mac|cidr|network_cidr|schedule|schedulemod) "string">
|
||||
<!ATTLIST variable type (number|float|string|password|mail|boolean|filename|date|unix_user|ip|local_ip|netmask|network|broadcast|netbios|domainname|hostname|web_address|port|mac|cidr|network_cidr|choice) "string">
|
||||
<!ATTLIST variable description CDATA #IMPLIED>
|
||||
<!ATTLIST variable help CDATA #IMPLIED>
|
||||
<!ATTLIST variable hidden (True|False) "False">
|
||||
@ -101,6 +101,7 @@
|
||||
<!ATTLIST variable auto_freeze (True|False) "False">
|
||||
<!ATTLIST variable auto_save (True|False) "False">
|
||||
<!ATTLIST variable mode CDATA #IMPLIED>
|
||||
<!ATTLIST variable remove_choice (True|False) "False">
|
||||
<!ATTLIST variable remove_check (True|False) "False">
|
||||
<!ATTLIST variable remove_condition (True|False) "False">
|
||||
<!ATTLIST variable remove_fill (True|False) "False">
|
||||
@ -108,6 +109,11 @@
|
||||
<!ATTLIST variable test CDATA #IMPLIED>
|
||||
|
||||
<!ELEMENT value (#PCDATA)>
|
||||
<!ATTLIST value type (string|number|nil|boolean) #IMPLIED>
|
||||
|
||||
<!ELEMENT choice (#PCDATA | param)*>
|
||||
<!ATTLIST choice type (string|number|nil|boolean|function|variable) "string">
|
||||
<!ATTLIST choice name CDATA #IMPLIED>
|
||||
|
||||
<!ELEMENT constraints ((fill*|check*|condition*)*)>
|
||||
|
||||
|
@ -40,7 +40,7 @@ FORCE_UNREDEFINABLES = ('value',)
|
||||
# RougailObjSpace's elements that shall not be modify
|
||||
UNREDEFINABLE = ('multi', 'type',)
|
||||
# RougailObjSpace's elements that did not created automaticly
|
||||
FORCE_ELEMENTS = ('choice', 'property_', 'information')
|
||||
FORCE_ELEMENTS = ('property_', 'information')
|
||||
# XML text are convert has name
|
||||
FORCED_TEXT_ELTS_AS_NAME = ('choice', 'property', 'value',)
|
||||
|
||||
@ -410,6 +410,8 @@ class RougailObjSpace:
|
||||
"""Rougail object tree manipulations
|
||||
"""
|
||||
if child.tag == 'variable':
|
||||
if child.attrib.get('remove_choice', False):
|
||||
variableobj.choice = []
|
||||
if child.attrib.get('remove_check', False):
|
||||
self.remove_check(variableobj.name)
|
||||
if child.attrib.get('remove_condition', False):
|
||||
@ -424,14 +426,15 @@ class RougailObjSpace:
|
||||
def remove_check(self, name):
|
||||
"""Remove a check with a specified target
|
||||
"""
|
||||
remove_checks = []
|
||||
for idx, check in enumerate(self.space.constraints.check): # pylint: disable=E1101
|
||||
for target in check.target:
|
||||
if target.name == name:
|
||||
remove_checks.append(idx)
|
||||
remove_checks.sort(reverse=True)
|
||||
for idx in remove_checks:
|
||||
self.space.constraints.check.pop(idx) # pylint: disable=E1101
|
||||
if hasattr(self.space.constraints, 'check'):
|
||||
remove_checks = []
|
||||
for idx, check in enumerate(self.space.constraints.check): # pylint: disable=E1101
|
||||
for target in check.target:
|
||||
if target.name == name:
|
||||
remove_checks.append(idx)
|
||||
remove_checks.sort(reverse=True)
|
||||
for idx in remove_checks:
|
||||
self.space.constraints.check.pop(idx) # pylint: disable=E1101
|
||||
|
||||
def remove_condition(self,
|
||||
name: str,
|
||||
|
@ -243,7 +243,7 @@ class Common:
|
||||
):
|
||||
"""Populate variable parameters
|
||||
"""
|
||||
if param.type in ['number', 'boolean', 'nil', 'string', 'port']:
|
||||
if param.type in ['number', 'boolean', 'nil', 'string', 'port', 'choice']:
|
||||
value = param.text
|
||||
if param.type == 'string' and value is not None:
|
||||
value = self.convert_str(value)
|
||||
@ -298,13 +298,13 @@ class Variable(Common):
|
||||
):
|
||||
if hasattr(self.elt, 'opt'):
|
||||
keys['opt'] = self.elt.opt.reflector_object.get()
|
||||
if hasattr(self.elt, 'values'):
|
||||
values = self.elt.values
|
||||
if hasattr(self.elt, 'choice'):
|
||||
values = self.elt.choice
|
||||
if values[0].type == 'variable':
|
||||
value = values[0].name.reflector_object.get()
|
||||
keys['values'] = f"Calculation(func.calc_value, Params((ParamOption({value}))))"
|
||||
elif values[0].type == 'function':
|
||||
keys['values'] = self.calculation_value(self.elt.values[0], [])
|
||||
keys['values'] = self.calculation_value(values[0], [])
|
||||
else:
|
||||
keys['values'] = str(tuple([val.name for val in values]))
|
||||
if hasattr(self.elt, 'multi') and self.elt.multi:
|
||||
|
@ -115,20 +115,105 @@ class RougailUpgrade:
|
||||
variables = root.find('variables')
|
||||
if variables is None:
|
||||
return root
|
||||
constraints = root.find('constraints')
|
||||
if constraints is None:
|
||||
return root
|
||||
groups = []
|
||||
for constraint in constraints:
|
||||
if constraint.tag == 'group':
|
||||
constraints.remove(constraint)
|
||||
groups.append(constraint)
|
||||
if not groups:
|
||||
return root
|
||||
paths = self._get_path_variables(variables,
|
||||
namespace == self.rougailconfig['variable_namespace'],
|
||||
namespace,
|
||||
)
|
||||
constraints = root.find('constraints')
|
||||
# convert schedule and schedulemod
|
||||
for variable in paths.values():
|
||||
variable = variable['variable']
|
||||
if variable.tag != 'variable':
|
||||
continue
|
||||
if 'type' in variable.attrib and variable.attrib['type'] in ['schedule', 'schedulemod']:
|
||||
if variable.attrib['type'] == 'schedule':
|
||||
choices = ('none', 'daily', 'weekly', 'monthly')
|
||||
else:
|
||||
choices = ('pre', 'post')
|
||||
variable.attrib['type'] = 'choice'
|
||||
has_value = False
|
||||
for value in variable:
|
||||
if value.tag == 'value':
|
||||
has_value = True
|
||||
break
|
||||
for name in choices:
|
||||
choice = SubElement(variable, 'choice')
|
||||
choice.text = name
|
||||
if not has_value:
|
||||
value = SubElement(variable, 'value')
|
||||
value.text = choices[0]
|
||||
variable.attrib['mandatory'] = 'True'
|
||||
|
||||
# convert choice option
|
||||
valid_enums = []
|
||||
if constraints is not None:
|
||||
for constraint in constraints:
|
||||
if constraint.tag == 'check' and constraint.attrib['name'] == 'valid_enum':
|
||||
constraints.remove(constraint)
|
||||
valid_enums.append(constraint)
|
||||
for valid_enum in valid_enums:
|
||||
targets = []
|
||||
for target in valid_enum:
|
||||
if target.tag != 'target':
|
||||
continue
|
||||
if target.text in paths:
|
||||
# not in paths if it's optional
|
||||
# but not check it
|
||||
targets.append(paths[target.text]['variable'])
|
||||
params = []
|
||||
function_param = None
|
||||
for param in valid_enum:
|
||||
if param.tag != 'param':
|
||||
continue
|
||||
if 'type' in param.attrib and param.attrib['type'] == 'function':
|
||||
function_param = param.text
|
||||
continue
|
||||
params.append(param)
|
||||
first_choice = None
|
||||
for target in targets:
|
||||
if function_param is not None:
|
||||
function = SubElement(target, 'choice', type='function', name=function_param)
|
||||
for param in params:
|
||||
if function_param is not None:
|
||||
function.append(param)
|
||||
else:
|
||||
choice = SubElement(target, 'choice')
|
||||
if first_choice is None:
|
||||
first_choice = choice
|
||||
choice.text = param.text
|
||||
if 'type' not in param.attrib and param.text is None:
|
||||
choice_type = 'nil'
|
||||
elif 'type' in param.attrib:
|
||||
choice_type = param.attrib['type']
|
||||
elif 'type' in target.attrib:
|
||||
choice_type = target.attrib['type']
|
||||
else:
|
||||
choice_type = 'string'
|
||||
choice.attrib['type'] = choice_type
|
||||
has_value = False
|
||||
for target in targets:
|
||||
if 'remove_check' in target.attrib:
|
||||
target.attrib['remove_choice'] = target.attrib['remove_check']
|
||||
for target in targets:
|
||||
for value in target:
|
||||
if value.tag == 'value':
|
||||
has_value = True
|
||||
if 'type' in target.attrib:
|
||||
value.attrib['type'] = target.attrib['type']
|
||||
if first_choice is not None and not has_value:
|
||||
value = SubElement(target, 'value')
|
||||
value.attrib['type'] = first_choice.attrib['type']
|
||||
value.text = first_choice.text
|
||||
for target in targets:
|
||||
if 'remove_choice' not in target.attrib or target.attrib['remove_choice'] != 'True':
|
||||
target.attrib['type'] = 'choice'
|
||||
# convert group to leadership
|
||||
groups = []
|
||||
if constraints is not None:
|
||||
for constraint in constraints:
|
||||
if constraint.tag == 'group':
|
||||
constraints.remove(constraint)
|
||||
groups.append(constraint)
|
||||
for group in groups:
|
||||
if group.attrib['leader'] in paths:
|
||||
leader_obj = paths[group.attrib['leader']]
|
||||
@ -184,6 +269,8 @@ class RougailUpgrade:
|
||||
subpath = path + '.'
|
||||
else:
|
||||
subpath = ''
|
||||
if variable.tag not in ['variable', 'family']:
|
||||
continue
|
||||
subpath += variable.attrib['name']
|
||||
if variable.tag == 'family':
|
||||
self._get_path_variables(variable, is_variable_namespace, subpath, dico)
|
||||
|
@ -7,17 +7,16 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="number" description="enumvar" help="bla bla bla"/>
|
||||
<variable name="enumvar" type="choice" description="enumvar" help="bla bla bla">
|
||||
<choice type="number">1</choice>
|
||||
<choice type="number">2</choice>
|
||||
<choice type="number">3</choice>
|
||||
<value type="number">1</value>
|
||||
</variable>
|
||||
<variable name="test_variable" type="number" description="test variable"/>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>1</param>
|
||||
<param>2</param>
|
||||
<param>3</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
<condition name="hidden_if_in" source="enumvar">
|
||||
<param>4</param>
|
||||
<target type="variable">test_variable</target>
|
||||
|
@ -2,8 +2,11 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="condition" type="string" description="No change">
|
||||
<value>tous</value>
|
||||
<variable name="condition" type="choice" description="No change">
|
||||
<value type="string">tous</value>
|
||||
<choice type="string">tous</choice>
|
||||
<choice type="string">authentifié</choice>
|
||||
<choice type="string">aucun</choice>
|
||||
</variable>
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>tous</value>
|
||||
@ -14,12 +17,6 @@
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>tous</param>
|
||||
<param>authentifié</param>
|
||||
<param>aucun</param>
|
||||
<target>condition</target>
|
||||
</check>
|
||||
<condition name="disabled_if_in" source="condition">
|
||||
<param type="variable">mode_conteneur_actif</param>
|
||||
<target type="variable">mode_conteneur_actif2</target>
|
||||
|
@ -2,8 +2,11 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="condition" type="string" description="No change">
|
||||
<value>tous</value>
|
||||
<variable name="condition" type="choice" description="No change">
|
||||
<value type="string">tous</value>
|
||||
<choice type="string">tous</choice>
|
||||
<choice type="string">authentifié</choice>
|
||||
<choice type="string">aucun</choice>
|
||||
</variable>
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>aucun</value>
|
||||
@ -14,12 +17,6 @@
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>tous</param>
|
||||
<param>authentifié</param>
|
||||
<param>aucun</param>
|
||||
<target>condition</target>
|
||||
</check>
|
||||
<condition name="disabled_if_in" source="condition">
|
||||
<param type="variable">mode_conteneur_actif</param>
|
||||
<target type="variable">mode_conteneur_actif2</target>
|
||||
|
@ -2,8 +2,11 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="condition" type="string" description="No change">
|
||||
<value>tous</value>
|
||||
<variable name="condition" type="choice" description="No change">
|
||||
<value type="string">tous</value>
|
||||
<choice type="string">tous</choice>
|
||||
<choice type="string">authentifié</choice>
|
||||
<choice type="string">aucun</choice>
|
||||
</variable>
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>non</value>
|
||||
@ -14,12 +17,6 @@
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>tous</param>
|
||||
<param>authentifié</param>
|
||||
<param>aucun</param>
|
||||
<target>condition</target>
|
||||
</check>
|
||||
<condition name="hidden_if_in" source="condition">
|
||||
<param>tous</param>
|
||||
<param>authentifié</param>
|
||||
|
@ -2,8 +2,11 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="condition" type="string" description="No change">
|
||||
<value>tous</value>
|
||||
<variable name="condition" type="choice" description="No change">
|
||||
<value type="string">tous</value>
|
||||
<choice type="string">tous</choice>
|
||||
<choice type="string">authentifié</choice>
|
||||
<choice type="string">aucun</choice>
|
||||
</variable>
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
||||
<value>non</value>
|
||||
@ -14,12 +17,6 @@
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>tous</param>
|
||||
<param>authentifié</param>
|
||||
<param>aucun</param>
|
||||
<target>condition</target>
|
||||
</check>
|
||||
<condition name="hidden_if_in" source="condition">
|
||||
<param>oui</param>
|
||||
<param>non</param>
|
||||
|
@ -2,8 +2,11 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="condition" type="string" description="No change">
|
||||
<value>tous</value>
|
||||
<variable name="condition" type="choice" description="No change">
|
||||
<value type="string">tous</value>
|
||||
<choice type="string">tous</choice>
|
||||
<choice type="string">authentifié</choice>
|
||||
<choice type="string">aucun</choice>
|
||||
</variable>
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>tous</value>
|
||||
@ -14,12 +17,6 @@
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>tous</param>
|
||||
<param>authentifié</param>
|
||||
<param>aucun</param>
|
||||
<target>condition</target>
|
||||
</check>
|
||||
<condition name="hidden_if_in" source="condition">
|
||||
<param type="variable">mode_conteneur_actif</param>
|
||||
<target type="variable">mode_conteneur_actif2</target>
|
||||
|
@ -2,8 +2,11 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="condition" type="string" description="No change">
|
||||
<value>tous</value>
|
||||
<variable name="condition" type="choice" description="No change">
|
||||
<value type="string">tous</value>
|
||||
<choice type="string">tous</choice>
|
||||
<choice type="string">authentifié</choice>
|
||||
<choice type="string">aucun</choice>
|
||||
</variable>
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>non</value>
|
||||
@ -14,12 +17,6 @@
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>tous</param>
|
||||
<param>authentifié</param>
|
||||
<param>aucun</param>
|
||||
<target>condition</target>
|
||||
</check>
|
||||
<condition name="hidden_if_not_in" source="condition">
|
||||
<param>oui</param>
|
||||
<param>non</param>
|
||||
|
@ -2,8 +2,11 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="condition" type="string" description="No change">
|
||||
<value>tous</value>
|
||||
<variable name="condition" type="choice" description="No change">
|
||||
<value type="string">tous</value>
|
||||
<choice type="string">tous</choice>
|
||||
<choice type="string">authentifié</choice>
|
||||
<choice type="string">aucun</choice>
|
||||
</variable>
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
||||
<value>non</value>
|
||||
@ -14,12 +17,6 @@
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>tous</param>
|
||||
<param>authentifié</param>
|
||||
<param>aucun</param>
|
||||
<target>condition</target>
|
||||
</check>
|
||||
<condition name="mandatory_if_not_in" source="condition">
|
||||
<param>oui</param>
|
||||
<param>non</param>
|
||||
|
@ -7,18 +7,14 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="string" description="multi" help="bla bla bla">
|
||||
<value>c</value>
|
||||
<variable name="enumvar" type="choice" description="multi" help="bla bla bla">
|
||||
<value type="string">c</value>
|
||||
<choice type="string">a</choice>
|
||||
<choice type="string">b</choice>
|
||||
<choice type="string">c</choice>
|
||||
<choice type="string">é</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param>c</param>
|
||||
<param>é</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -7,17 +7,13 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="string" description="multi" help="bla bla bla">
|
||||
<value>c</value>
|
||||
<variable name="enumvar" type="choice" description="multi" help="bla bla bla">
|
||||
<value type="string">c</value>
|
||||
<choice type="string">a</choice>
|
||||
<choice type="string">b</choice>
|
||||
<choice type="string">c</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param>c</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -7,17 +7,13 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" mandatory="False">
|
||||
<variable name="enumvar" mandatory="False" type="choice">
|
||||
<value>c</value>
|
||||
<choice type="string">a</choice>
|
||||
<choice type="string">b</choice>
|
||||
<choice type="string">c</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param>c</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -7,26 +7,19 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar2" type="string" description="multi">
|
||||
<value>c</value>
|
||||
<variable name="enumvar2" type="choice" description="multi">
|
||||
<value type="string">c</value>
|
||||
<choice type="string">a</choice>
|
||||
<choice type="string">b</choice>
|
||||
<choice type="string">c</choice>
|
||||
</variable>
|
||||
<variable name="enumvar" type="string" description="multi" help="bla bla bla">
|
||||
<value>c</value>
|
||||
<variable name="enumvar" type="choice" description="multi" help="bla bla bla">
|
||||
<value type="string">c</value>
|
||||
<choice type="string">a</choice>
|
||||
<choice type="string">b</choice>
|
||||
<choice type="string">c</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param>c</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param>c</param>
|
||||
<target>enumvar2</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -2,16 +2,12 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" redefine="True" remove_check="True">
|
||||
<variable name="enumvar" redefine="True" remove_check="True" remove_choice="True">
|
||||
<value>c</value>
|
||||
<choice type="string">a</choice>
|
||||
<choice type="string">c</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>c</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -7,17 +7,15 @@
|
||||
</variable>
|
||||
<family name="leader" description="leader" leadership="True">
|
||||
<variable name="leader" type="string" description="leader" multi="True"/>
|
||||
<variable name="follower1" type="string" description="follower1"/>
|
||||
<variable name="follower1" type="choice" description="follower1">
|
||||
<choice type="string">a</choice>
|
||||
<choice type="string">b</choice>
|
||||
<choice type="string">c</choice>
|
||||
<value type="string">a</value>
|
||||
</variable>
|
||||
<variable name="follower2" type="string" description="follower2"/>
|
||||
</family>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param>c</param>
|
||||
<target>follower1</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -8,15 +8,13 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="string" description="multi" mandatory="True"/>
|
||||
<variable name="enumvar" type="choice" description="multi" mandatory="True">
|
||||
<choice type="string">a</choice>
|
||||
<choice type="string">b</choice>
|
||||
<choice type="string">c</choice>
|
||||
<value type="string">a</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param>c</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -5,15 +5,13 @@
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>non</value>
|
||||
</variable>
|
||||
<variable name="multi" type="string" description="multi" multi="True"/>
|
||||
<variable name="multi" type="choice" description="multi" multi="True">
|
||||
<choice type="string">a</choice>
|
||||
<choice type="string">b</choice>
|
||||
<choice type="string">c</choice>
|
||||
<value type="string">a</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param>c</param>
|
||||
<target>multi</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -7,17 +7,13 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="string" description="multi" help="bla bla bla" mandatory="False">
|
||||
<value>b</value>
|
||||
<variable name="enumvar" type="choice" description="multi" help="bla bla bla" mandatory="False">
|
||||
<value type="string">b</value>
|
||||
<choice type="string">a</choice>
|
||||
<choice type="string">b</choice>
|
||||
<choice type="nil"/>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param/>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -13,7 +13,7 @@ except:
|
||||
from tiramisu import *
|
||||
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"}))
|
||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"}))
|
||||
option_5 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', '', None), default="b", properties=frozenset({"expert"}))
|
||||
option_5 = ChoiceOption(name="enumvar", doc="multi", values=('a', 'b', None), default="b", properties=frozenset({"expert"}))
|
||||
option_5.impl_set_information('help', "bla bla bla")
|
||||
option_4 = OptionDescription(name="enumfam", doc="enumfam", children=[option_5], properties=frozenset({"expert"}))
|
||||
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_4])
|
||||
|
@ -7,15 +7,13 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="number" description="enumvar" help="bla bla bla"/>
|
||||
<variable name="enumvar" type="choice" description="enumvar" help="bla bla bla">
|
||||
<choice type="number">1</choice>
|
||||
<choice type="number">2</choice>
|
||||
<choice type="number">3</choice>
|
||||
<value type="number">1</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>1</param>
|
||||
<param>2</param>
|
||||
<param>3</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -7,17 +7,13 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="number" description="enumvar" help="bla bla bla">
|
||||
<value>3</value>
|
||||
<variable name="enumvar" type="choice" description="enumvar" help="bla bla bla">
|
||||
<value type="number">3</value>
|
||||
<choice type="number">1</choice>
|
||||
<choice type="number">2</choice>
|
||||
<choice type="number">3</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>1</param>
|
||||
<param>2</param>
|
||||
<param>3</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -7,13 +7,11 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="string" description="multi" help="bla bla bla"/>
|
||||
<variable name="enumvar" type="choice" description="multi" help="bla bla bla">
|
||||
<choice type="nil"/>
|
||||
<value type="nil"/>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param type="nil"/>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -7,13 +7,11 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="string" description="multi" help="bla bla bla"/>
|
||||
<variable name="enumvar" type="choice" description="multi" help="bla bla bla">
|
||||
<choice type="nil"/>
|
||||
<value type="nil"/>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param type="nil"/>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -7,15 +7,13 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="string" description="multi" help="bla bla bla"/>
|
||||
<variable name="enumvar" type="choice" description="multi" help="bla bla bla">
|
||||
<choice type="string">quote'</choice>
|
||||
<choice type="string">quote"</choice>
|
||||
<choice type="string">quote"'</choice>
|
||||
<value type="string">quote'</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>quote'</param>
|
||||
<param>quote"</param>
|
||||
<param>quote"'</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -2,17 +2,13 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>b</value>
|
||||
<variable name="mode_conteneur_actif" type="choice" description="No change">
|
||||
<value type="string">b</value>
|
||||
<choice type="string">a</choice>
|
||||
<choice type="string">b</choice>
|
||||
<choice type="string">c</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param>c</param>
|
||||
<target>mode_conteneur_actif</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -7,8 +7,10 @@
|
||||
</services>
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="condition" type="string" description="No change">
|
||||
<value>non</value>
|
||||
<variable name="condition" type="choice" description="No change">
|
||||
<value type="string">non</value>
|
||||
<choice type="string">non</choice>
|
||||
<choice type="string">statique</choice>
|
||||
</variable>
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
||||
<value>non</value>
|
||||
@ -19,11 +21,6 @@
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>non</param>
|
||||
<param>statique</param>
|
||||
<target>condition</target>
|
||||
</check>
|
||||
<condition name="disabled_if_not_in" source="condition">
|
||||
<param>statique</param>
|
||||
<target type="filelist">afilllist</target>
|
||||
|
@ -2,17 +2,14 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="var" type="number" description="New variable">
|
||||
<value>9</value>
|
||||
<variable name="var" type="choice" description="New variable">
|
||||
<value type="number">9</value>
|
||||
<choice type="function" name="trange">
|
||||
<param type="number">0</param>
|
||||
<param type="number">10</param>
|
||||
</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param type="function">trange</param>
|
||||
<param type="number">0</param>
|
||||
<param type="number">10</param>
|
||||
<target>var</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -2,8 +2,9 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>a</value>
|
||||
<variable name="mode_conteneur_actif" type="choice" description="No change">
|
||||
<value type="string">a</value>
|
||||
<choice type="variable">var</choice>
|
||||
</variable>
|
||||
<variable name="var" type="string" description="New variable" multi="True">
|
||||
<value>a</value>
|
||||
@ -12,10 +13,5 @@
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param type="variable">var</param>
|
||||
<target>mode_conteneur_actif</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -10,16 +10,15 @@
|
||||
<variable name="mode_conteneur_actif2" type="string" description="No change">
|
||||
<value>non</value>
|
||||
</variable>
|
||||
<variable name="mode_conteneur_actif3" type="string" description="No change"/>
|
||||
<variable name="mode_conteneur_actif3" type="choice" description="No change">
|
||||
<choice type="string">a</choice>
|
||||
<choice type="string">b</choice>
|
||||
<choice type="string">c</choice>
|
||||
<value type="string">a</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param>c</param>
|
||||
<target>mode_conteneur_actif3</target>
|
||||
</check>
|
||||
<condition name="disabled_if_in" source="mode_conteneur_actif3">
|
||||
<param>d</param>
|
||||
<target type="variable">mode_conteneur_actif</target>
|
||||
|
@ -1,16 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True"/>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param>c</param>
|
||||
<target>mode_conteneur_actif</target>
|
||||
</check>
|
||||
</constraints>
|
||||
</rougail>
|
@ -1,10 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="mode_conteneur_actif" redefine="True" remove_check="True">
|
||||
<value>non</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
</rougail>
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"rougail.general.mode_conteneur_actif": {
|
||||
"owner": "default",
|
||||
"value": "non"
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"rougail.general.mode_conteneur_actif": "non"
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"rougail.general.mode_conteneur_actif": {
|
||||
"owner": "default",
|
||||
"value": "non"
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
from importlib.machinery import SourceFileLoader
|
||||
from importlib.util import spec_from_loader, module_from_spec
|
||||
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
||||
spec = spec_from_loader(loader.name, loader)
|
||||
func = module_from_spec(spec)
|
||||
loader.exec_module(func)
|
||||
for key, value in dict(locals()).items():
|
||||
if key != ['SourceFileLoader', 'func']:
|
||||
setattr(func, key, value)
|
||||
try:
|
||||
from tiramisu3 import *
|
||||
except:
|
||||
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 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
|
||||
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
@ -2,15 +2,13 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True"/>
|
||||
<variable name="mode_conteneur_actif" type="choice" description="Redefine description" hidden="True">
|
||||
<choice type="string">a</choice>
|
||||
<choice type="string">b</choice>
|
||||
<choice type="string">c</choice>
|
||||
<value type="string">a</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param>c</param>
|
||||
<target>mode_conteneur_actif</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -2,14 +2,12 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="mode_conteneur_actif" redefine="True" remove_check="True"/>
|
||||
<variable name="mode_conteneur_actif" redefine="True" remove_check="True" remove_choice="True">
|
||||
<choice type="string">a</choice>
|
||||
<choice type="string">b</choice>
|
||||
<value type="string">a</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<target>mode_conteneur_actif</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -5,9 +5,17 @@
|
||||
<variable name="description" type="string">
|
||||
<value>Exportation de la base de ejabberd</value>
|
||||
</variable>
|
||||
<variable name="day" type="schedule"/>
|
||||
<variable name="mode" type="schedulemod">
|
||||
<variable name="day" type="choice" mandatory="True">
|
||||
<choice>none</choice>
|
||||
<choice>daily</choice>
|
||||
<choice>weekly</choice>
|
||||
<choice>monthly</choice>
|
||||
<value>none</value>
|
||||
</variable>
|
||||
<variable name="mode" type="choice" mandatory="True">
|
||||
<value>pre</value>
|
||||
<choice>pre</choice>
|
||||
<choice>post</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
@ -5,9 +5,17 @@
|
||||
<variable name="description" type="string">
|
||||
<value>Exportation de la base de ejabberd</value>
|
||||
</variable>
|
||||
<variable name="day" type="schedule" help="Test help"/>
|
||||
<variable name="mode" type="schedulemod">
|
||||
<variable name="day" type="choice" help="Test help" mandatory="True">
|
||||
<choice>none</choice>
|
||||
<choice>daily</choice>
|
||||
<choice>weekly</choice>
|
||||
<choice>monthly</choice>
|
||||
<value>none</value>
|
||||
</variable>
|
||||
<variable name="mode" type="choice" mandatory="True">
|
||||
<value>pre</value>
|
||||
<choice>pre</choice>
|
||||
<choice>post</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
@ -6,17 +6,12 @@
|
||||
<variable name="description" type="string" multi="True">
|
||||
<value>test</value>
|
||||
</variable>
|
||||
<variable name="mode" type="string">
|
||||
<variable name="mode" type="choice">
|
||||
<choice>pre</choice>
|
||||
<choice>post</choice>
|
||||
<value>pre</value>
|
||||
</variable>
|
||||
</family>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>pre</param>
|
||||
<param>post</param>
|
||||
<target>extra.ejabberd.description.mode</target>
|
||||
</check>
|
||||
</constraints>
|
||||
</rougail>
|
||||
|
@ -5,9 +5,17 @@
|
||||
<variable name="description" type="string">
|
||||
<value>Exportation de la base de ejabberd</value>
|
||||
</variable>
|
||||
<variable name="day" type="schedule"/>
|
||||
<variable name="mode" type="schedulemod">
|
||||
<variable name="day" type="choice" mandatory="True">
|
||||
<choice>none</choice>
|
||||
<choice>daily</choice>
|
||||
<choice>weekly</choice>
|
||||
<choice>monthly</choice>
|
||||
<value>none</value>
|
||||
</variable>
|
||||
<variable name="mode" type="choice" mandatory="True">
|
||||
<value>pre</value>
|
||||
<choice>pre</choice>
|
||||
<choice>post</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
@ -5,8 +5,18 @@
|
||||
<variable name="description" type="string">
|
||||
<value>Exportation de la base de ejabberd</value>
|
||||
</variable>
|
||||
<variable name="day" type="schedule" mandatory="True"/>
|
||||
<variable name="mode" type="schedulemod" mandatory="True"/>
|
||||
<variable name="day" type="choice" mandatory="True">
|
||||
<choice>none</choice>
|
||||
<choice>daily</choice>
|
||||
<choice>weekly</choice>
|
||||
<choice>monthly</choice>
|
||||
<value>none</value>
|
||||
</variable>
|
||||
<variable name="mode" type="choice" mandatory="True">
|
||||
<choice>pre</choice>
|
||||
<choice>post</choice>
|
||||
<value>pre</value>
|
||||
</variable>
|
||||
<variable name="var1" type="string" mandatory="True"/>
|
||||
</family>
|
||||
</variables>
|
||||
|
@ -5,9 +5,17 @@
|
||||
<variable name="description" type="string">
|
||||
<value>Exportation de la base de ejabberd</value>
|
||||
</variable>
|
||||
<variable name="day" type="schedule"/>
|
||||
<variable name="mode" type="schedulemod">
|
||||
<variable name="day" type="choice" mandatory="True">
|
||||
<choice>none</choice>
|
||||
<choice>daily</choice>
|
||||
<choice>weekly</choice>
|
||||
<choice>monthly</choice>
|
||||
<value>none</value>
|
||||
</variable>
|
||||
<variable name="mode" type="choice" mandatory="True">
|
||||
<value>pre</value>
|
||||
<choice>pre</choice>
|
||||
<choice>post</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
@ -5,9 +5,17 @@
|
||||
<variable name="description" type="string">
|
||||
<value>Exportation de la base de ejabberd</value>
|
||||
</variable>
|
||||
<variable name="day" type="schedule"/>
|
||||
<variable name="mode" type="schedulemod">
|
||||
<variable name="day" type="choice" mandatory="True">
|
||||
<choice>none</choice>
|
||||
<choice>daily</choice>
|
||||
<choice>weekly</choice>
|
||||
<choice>monthly</choice>
|
||||
<value>none</value>
|
||||
</variable>
|
||||
<variable name="mode" type="choice" mandatory="True">
|
||||
<value>pre</value>
|
||||
<choice>pre</choice>
|
||||
<choice>post</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
@ -5,9 +5,17 @@
|
||||
<variable name="description" type="string">
|
||||
<value>Exportation de la base de ejabberd</value>
|
||||
</variable>
|
||||
<variable name="day" type="schedule"/>
|
||||
<variable name="mode" type="schedulemod">
|
||||
<variable name="day" type="choice" mandatory="True">
|
||||
<choice>none</choice>
|
||||
<choice>daily</choice>
|
||||
<choice>weekly</choice>
|
||||
<choice>monthly</choice>
|
||||
<value>none</value>
|
||||
</variable>
|
||||
<variable name="mode" type="choice" mandatory="True">
|
||||
<value>pre</value>
|
||||
<choice>pre</choice>
|
||||
<choice>post</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
@ -5,9 +5,17 @@
|
||||
<variable name="description" type="string">
|
||||
<value>Exportation de la base de ejabberd</value>
|
||||
</variable>
|
||||
<variable name="day" type="schedule"/>
|
||||
<variable name="mode" type="schedulemod">
|
||||
<variable name="day" type="choice" mandatory="True">
|
||||
<choice>none</choice>
|
||||
<choice>daily</choice>
|
||||
<choice>weekly</choice>
|
||||
<choice>monthly</choice>
|
||||
<value>none</value>
|
||||
</variable>
|
||||
<variable name="mode" type="choice" mandatory="True">
|
||||
<value>pre</value>
|
||||
<choice>pre</choice>
|
||||
<choice>post</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
@ -5,9 +5,17 @@
|
||||
<variable name="description" type="string">
|
||||
<value>Exportation de la base de ejabberd</value>
|
||||
</variable>
|
||||
<variable name="day" type="schedule"/>
|
||||
<variable name="mode" type="schedulemod">
|
||||
<variable name="day" type="choice" mandatory="True">
|
||||
<choice>none</choice>
|
||||
<choice>daily</choice>
|
||||
<choice>weekly</choice>
|
||||
<choice>monthly</choice>
|
||||
<value>none</value>
|
||||
</variable>
|
||||
<variable name="mode" type="choice" mandatory="True">
|
||||
<value>pre</value>
|
||||
<choice>pre</choice>
|
||||
<choice>post</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
@ -5,9 +5,17 @@
|
||||
<variable name="description" type="string">
|
||||
<value>Exportation de la base de ejabberd</value>
|
||||
</variable>
|
||||
<variable name="day" type="schedule"/>
|
||||
<variable name="mode" type="schedulemod">
|
||||
<variable name="day" type="choice" mandatory="True">
|
||||
<choice>none</choice>
|
||||
<choice>daily</choice>
|
||||
<choice>weekly</choice>
|
||||
<choice>monthly</choice>
|
||||
<value>none</value>
|
||||
</variable>
|
||||
<variable name="mode" type="choice" mandatory="True">
|
||||
<value>pre</value>
|
||||
<choice>pre</choice>
|
||||
<choice>post</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
@ -5,9 +5,17 @@
|
||||
<variable name="description" type="string">
|
||||
<value>Exportation de la base de ejabberd</value>
|
||||
</variable>
|
||||
<variable name="day" type="schedule"/>
|
||||
<variable name="mode" type="schedulemod">
|
||||
<variable name="day" type="choice" mandatory="True">
|
||||
<choice>none</choice>
|
||||
<choice>daily</choice>
|
||||
<choice>weekly</choice>
|
||||
<choice>monthly</choice>
|
||||
<value>none</value>
|
||||
</variable>
|
||||
<variable name="mode" type="choice" mandatory="True">
|
||||
<value>pre</value>
|
||||
<choice>pre</choice>
|
||||
<choice>post</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
@ -7,17 +7,16 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="number" description="enumvar" help="bla bla bla"/>
|
||||
<variable name="enumvar" type="choice" description="enumvar" help="bla bla bla">
|
||||
<choice type="number">1</choice>
|
||||
<choice type="number">2</choice>
|
||||
<choice type="number">3</choice>
|
||||
<value type="number">1</value>
|
||||
</variable>
|
||||
<variable name="test_variable" type="number" description="test variable"/>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>1</param>
|
||||
<param>2</param>
|
||||
<param>3</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
<condition name="hidden_if_in" source="condition">
|
||||
<param>4</param>
|
||||
<target type="variable">test_variable</target>
|
||||
|
@ -1,32 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general" mode="expert">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>non</value>
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar2" type="string" description="multi">
|
||||
<value>c</value>
|
||||
</variable>
|
||||
<variable name="enumvar" type="string" description="multi" help="bla bla bla">
|
||||
<value>c</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param>c</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param>c</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
</rougail>
|
@ -1,17 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" redefine="True">
|
||||
<value>c</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>c</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
</rougail>
|
@ -2,8 +2,10 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>a</value>
|
||||
<variable name="mode_conteneur_actif" type="choice" description="No change">
|
||||
<value type="string">a</value>
|
||||
<choice type="variable">var</choice>
|
||||
<choice type="string">d</choice>
|
||||
</variable>
|
||||
<variable name="var" type="string" description="New variable" multi="True">
|
||||
<value>a</value>
|
||||
@ -12,11 +14,5 @@
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param type="variable">var</param>
|
||||
<param>d</param>
|
||||
<target>mode_conteneur_actif</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -2,8 +2,10 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>a</value>
|
||||
<variable name="mode_conteneur_actif" type="choice" description="No change">
|
||||
<value type="string">a</value>
|
||||
<choice type="variable">var</choice>
|
||||
<choice type="variable">var2</choice>
|
||||
</variable>
|
||||
<variable name="var" type="string" description="New variable" multi="True">
|
||||
<value>a</value>
|
||||
@ -17,11 +19,5 @@
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param type="variable">var</param>
|
||||
<param type="variable">var2</param>
|
||||
<target>mode_conteneur_actif</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -7,15 +7,10 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="string" description="enumvar">
|
||||
<value>non</value>
|
||||
<variable name="enumvar" type="choice" description="multi" help="bla bla bla">
|
||||
<value type="string">c</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param type="number">1</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
@ -2,18 +2,14 @@
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>a</value>
|
||||
<variable name="mode_conteneur_actif" type="choice" description="No change">
|
||||
<value type="string">a</value>
|
||||
<choice type="variable">var</choice>
|
||||
</variable>
|
||||
<variable name="var" type="string" description="New variable">
|
||||
<value>a</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param type="variable">var</param>
|
||||
<target>mode_conteneur_actif</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -9,12 +9,11 @@
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="string" description="multi" help="bla bla bla">
|
||||
<value>c</value>
|
||||
<choice type="string">a</choice>
|
||||
<choice type="string">b</choice>
|
||||
<choice type="string">c</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
@ -7,13 +7,11 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="number" description="enumvar" help="bla bla bla"/>
|
||||
<variable name="enumvar" type="choice" description="enumvar" help="bla bla bla">
|
||||
<choice type="number"/>
|
||||
<value type="number"/>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param type="number"/>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
||||
|
@ -5,9 +5,17 @@
|
||||
<variable name="description" type="string">
|
||||
<value>Exportation de la base de ejabberd</value>
|
||||
</variable>
|
||||
<variable name="day" type="schedule"/>
|
||||
<variable name="mode" type="schedulemod">
|
||||
<variable name="day" type="choice" mandatory="True">
|
||||
<choice>none</choice>
|
||||
<choice>daily</choice>
|
||||
<choice>weekly</choice>
|
||||
<choice>monthly</choice>
|
||||
<value>none</value>
|
||||
</variable>
|
||||
<variable name="mode" type="choice" mandatory="True">
|
||||
<value>pre</value>
|
||||
<choice>pre</choice>
|
||||
<choice>post</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
@ -7,17 +7,13 @@
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="string" description="enumvar">
|
||||
<value>a</value>
|
||||
<variable name="enumvar" type="choice" description="enumvar">
|
||||
<value type="string">a</value>
|
||||
<choice type="string">1</choice>
|
||||
<choice type="string">2</choice>
|
||||
<choice type="string">3</choice>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>1</param>
|
||||
<param>2</param>
|
||||
<param>3</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
</rougail>
|
@ -1,21 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general" mode="expert">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>non</value>
|
||||
</variable>
|
||||
</family>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="enumvar" type="number" description="enumvar"/>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param>a</param>
|
||||
<param>b</param>
|
||||
<param>c</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
</rougail>
|
@ -1,15 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="enumfam" mode="expert">
|
||||
<variable name="str" multi="True"/>
|
||||
<variable name="enumvar" type="number"/>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param type="variable">str</param>
|
||||
<target>enumvar</target>
|
||||
</check>
|
||||
</constraints>
|
||||
</rougail>
|
@ -1,21 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail version="0.10">
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>a</value>
|
||||
</variable>
|
||||
<variable name="var" type="string" description="New variable" multi="True">
|
||||
<value>a</value>
|
||||
<value>b</value>
|
||||
<value>c</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_enum">
|
||||
<param type="variable" optional="True">var</param>
|
||||
<target>mode_conteneur_actif</target>
|
||||
</check>
|
||||
</constraints>
|
||||
</rougail>
|
Loading…
Reference in New Issue
Block a user