add in RougailConfig auto_freeze_variable

This commit is contained in:
Emmanuel Garette 2021-02-14 18:42:16 +01:00
parent ab3713383f
commit d1a39e5183
33 changed files with 148 additions and 176 deletions

View File

@ -65,3 +65,7 @@ Le répertoire de temporaire est géré dans la clef "tmp_dir" et a comme valeur
## Le répertoire de destination des fichiers générés ## Le répertoire de destination des fichiers générés
Le répertoire de destination des fichiers générés est géré dans la clef "destinations_dir" et a comme valeur par défaut : "/srv/rougail/destinations". Le répertoire de destination des fichiers générés est géré dans la clef "destinations_dir" et a comme valeur par défaut : "/srv/rougail/destinations".
## La variable auto_freeze
La propriété auto_freeze n'est appliqué que une variable spécifique passe à True. Par défaut le nom de la variable est "instancied_module", mais il est possible de changer le nom de cette variable via la clef "auto_freeze_variable".

View File

@ -6,20 +6,17 @@ Le nom et la description de la famille et des variables qu'elle contient sera en
Par exemple : Par exemple :
``` ```
<family name='my_family'> <variable name='varname' multi="True">
<variable name='varname' multi="True"> <value>val1</value>
<value>val1</value> <value>val2</value>
<value>val2</value> </variable>
</variable> <family name="my_dyn_family_" dynamic="varname" description="Describe ">
</family> <variable name="my_dyn_var_"/>
<family name='my_dyn_family_' dynamic="varname description="Describe "">
<variable name='my_dyn_var_'/>
</family> </family>
``` ```
Créera trois familles : Créera deux familles :
- la famille : "my_family"
- la famille dynamique : "my_dyn_family_val1" avec la description "Describe val1" - la famille dynamique : "my_dyn_family_val1" avec la description "Describe val1"
- la famille dynamique : "my_dyn_family_val2" avec la description "Describe val2" - la famille dynamique : "my_dyn_family_val2" avec la description "Describe val2"

View File

@ -56,7 +56,7 @@ Pour définir le [mode](../mode.md) :
## Famille invisible ## Famille invisible
Il est possible de cacher une famille, ainsi toutes les variables et des familles inclusent dans cette famille. Il est possible de cacher une famille, ainsi que toutes les variables et des familles inclusent dans cette famille.
Cacher une famille signifie qu'elle ne sera pas visible lorsqu'on modifie la configuration du service. Cacher une famille signifie qu'elle ne sera pas visible lorsqu'on modifie la configuration du service.
Par contre ces variables sont accessibles lorsqu'on va utiliser ces variables. Par contre ces variables sont accessibles lorsqu'on va utiliser ces variables.

View File

@ -2,5 +2,3 @@
- [Une variable](simple.md) - [Une variable](simple.md)
- [Variable meneuse ou suiveuse](leadership.md) - [Variable meneuse ou suiveuse](leadership.md)
FIXME <!ATTLIST variable test CDATA #IMPLIED>

View File

@ -36,10 +36,10 @@ Une variable a un type. Ce type permet de définir les valeurs acceptées par ce
- string : chaine de caractère (type par défaut) - string : chaine de caractère (type par défaut)
- number : un nombre - number : un nombre
- float : un chiffre flottant - float : un chiffre flottant
- boolean : True ou False si aucune valeur n'est défini la valeur par défaut cette variable sera True - boolean : "True" ou "False", si aucune valeur n'est défini la valeur par défaut de cette variable sera "True"
- password : un mot de passe - password : un mot de passe
- mail : une adresse mail - mail : une adresse mail
- filename : nom de fichier au sens Unix (exemple : '/etc/passwd') - filename : nom de fichier au sens Unix (exemple : "/etc/passwd")
- date : une date au format "%Y-%m-%d" (exemple : "2021-01-30") - date : une date au format "%Y-%m-%d" (exemple : "2021-01-30")
- unix_user : nom d'utilisateur au sens Unix - unix_user : nom d'utilisateur au sens Unix
- ip : n'importe quelle adresse IPv4 - ip : n'importe quelle adresse IPv4
@ -91,7 +91,7 @@ Pour définir le [mode](../mode.md) :
Il est possible de cacher une variable. Il est possible de cacher une variable.
Cacher une variable signifie qu'elle ne sera pas visible lorsqu'on modifie la configuration du service. Cacher une variable signifie qu'elle ne sera pas visible lorsqu'on modifie la configuration du service.
Par contre cette variable sont accessibles lorsqu'on va l'utiliser. Par contre cette variable sera accessibles lorsqu'on va l'utiliser.
Pour cacher une variable : Pour cacher une variable :
@ -215,3 +215,5 @@ Par exemple, si la valeur de cette variable est issue d'un calcul, la valeur ne
Ces variables sont généralement des variables obligatoires. En effet ces variable ne sont en lecteur seul que si elles sont une valeurs. Ces variables sont généralement des variables obligatoires. En effet ces variable ne sont en lecteur seul que si elles sont une valeurs.
Une [variable meneuse ou suiveuse](leadership.md) ne peut pas avoir la propriété auto_freeze. Une [variable meneuse ou suiveuse](leadership.md) ne peut pas avoir la propriété auto_freeze.
FIXME <!ATTLIST variable test CDATA #IMPLIED>

View File

@ -35,8 +35,6 @@ from .target import TargetAnnotator
from .param import ParamAnnotator from .param import ParamAnnotator
from .variable import Walk from .variable import Walk
FREEZE_AUTOFREEZE_VARIABLE = 'module_instancie'
class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk): class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
"""Annotate condition """Annotate condition
@ -72,35 +70,30 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
def convert_auto_freeze(self): def convert_auto_freeze(self):
"""convert auto_freeze """convert auto_freeze
only if FREEZE_AUTOFREEZE_VARIABLE == 'oui' this variable is frozen only if auto_freeze_variable is True this variable is frozen
""" """
for variable in self.get_variables(): for variable in self.get_variables():
self._convert_auto_freeze(variable) if not variable.auto_freeze:
continue
def _convert_auto_freeze(self, if variable.namespace != RougailConfig['variable_namespace']:
variable: 'self.objectspace.variable', msg = _(f'auto_freeze is not allowed in extra "{variable.namespace}"')
) -> None: raise DictConsistencyError(msg, 49, variable.xmlfiles)
if not variable.auto_freeze: new_condition = self.objectspace.condition(variable.xmlfiles)
return new_condition.name = 'auto_frozen_if_not_in'
if variable.namespace != RougailConfig['variable_namespace']: new_condition.namespace = variable.namespace
msg = _(f'auto_freeze is not allowed in extra "{variable.namespace}"') new_condition.source = RougailConfig['auto_freeze_variable']
raise DictConsistencyError(msg, 49, variable.xmlfiles) new_param = self.objectspace.param(variable.xmlfiles)
new_condition = self.objectspace.condition(variable.xmlfiles) new_param.text = True
new_condition.name = 'auto_frozen_if_not_in' new_condition.param = [new_param]
new_condition.namespace = variable.namespace new_target = self.objectspace.target(variable.xmlfiles)
new_condition.source = FREEZE_AUTOFREEZE_VARIABLE new_target.type = 'variable'
new_param = self.objectspace.param(variable.xmlfiles) new_target.name = variable.name
new_param.text = 'oui' new_condition.target = [new_target]
new_condition.param = [new_param] if not hasattr(self.objectspace.space, 'constraints'):
new_target = self.objectspace.target(variable.xmlfiles) self.objectspace.space.constraints = self.objectspace.constraints(variable.xmlfiles)
new_target.type = 'variable' if not hasattr(self.objectspace.space.constraints, 'condition'):
new_target.name = variable.name self.objectspace.space.constraints.condition = []
new_condition.target = [new_target] self.objectspace.space.constraints.condition.append(new_condition)
if not hasattr(self.objectspace.space, 'constraints'):
self.objectspace.space.constraints = self.objectspace.constraints(variable.xmlfiles)
if not hasattr(self.objectspace.space.constraints, 'condition'):
self.objectspace.space.constraints.condition = []
self.objectspace.space.constraints.condition.append(new_condition)
def check_source_target(self): def check_source_target(self):
"""verify that source != target in condition """verify that source != target in condition

View File

@ -90,9 +90,6 @@ class Walk:
yield follower yield follower
continue continue
yield variable yield variable
# if hasattr(family, 'family'):
# for fam in family.family.values():
# yield from self._get_variables(fam, with_leadership)
def get_families(self): def get_families(self):
"""Iter all families from the objectspace """Iter all families from the objectspace

View File

@ -39,6 +39,7 @@ RougailConfig = {'dictionaries_dir': [join(ROUGAILROOT, 'dictionaries')],
'destinations_dir': join(ROUGAILROOT, 'destinations'), 'destinations_dir': join(ROUGAILROOT, 'destinations'),
'tmp_dir': join(ROUGAILROOT, 'tmp'), 'tmp_dir': join(ROUGAILROOT, 'tmp'),
'dtdfilename': join(DTDDIR, 'rougail.dtd'), 'dtdfilename': join(DTDDIR, 'rougail.dtd'),
'variable_namespace': 'rougail',
'functions_file': join(ROUGAILROOT, 'functions.py'), 'functions_file': join(ROUGAILROOT, 'functions.py'),
'variable_namespace': 'rougail',
'auto_freeze_variable': 'instanciated_module',
} }

View File

@ -1,14 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<rougail> <rougail>
<variables> <variables>
<family name="général"> <variable name="myvar" auto_freeze="True">
<variable name="mode_conteneur_actif" type="string" description="No change" auto_freeze="True"> <value>no</value>
<value>non</value> </variable>
</variable> <variable name="instanciated_module" type="boolean">
<variable name="module_instancie" type="string" description="No change"> <value>False</value>
<value>non</value> </variable>
</variable>
</family>
</variables> </variables>
</rougail> </rougail>
<!-- vim: ts=4 sw=4 expandtab <!-- vim: ts=4 sw=4 expandtab

View File

@ -1 +1 @@
{"rougail.general.mode_conteneur_actif": "non", "rougail.general.module_instancie": "non"} {"rougail.myvar": "no", "rougail.instanciated_module": false}

View File

@ -11,8 +11,7 @@ try:
from tiramisu3 import * from tiramisu3 import *
except: except:
from tiramisu import * from tiramisu import *
option_4 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) option_3 = BoolOption(name="instanciated_module", doc="instanciated_module", default=False, properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"auto_freeze", "basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_4, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) option_2 = StrOption(name="myvar", doc="myvar", default="no", properties=frozenset({"auto_freeze", "force_store_value", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue(True), 'reverse_condition': ParamValue(True)}))}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"basic"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3])
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View File

@ -1,14 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<rougail> <rougail>
<variables> <variables>
<family name="général"> <variable name="my_var" auto_freeze="True" mode="expert">
<variable name="mode_conteneur_actif" type="string" description="No change" auto_freeze="True" mode="expert"> <value>no</value>
<value>non</value> </variable>
</variable> <variable name="instanciated_module" type="boolean">
<variable name="module_instancie" type="string" description="No change"> <value>False</value>
<value>non</value> </variable>
</variable>
</family>
</variables> </variables>
</rougail> </rougail>
<!-- vim: ts=4 sw=4 expandtab <!-- vim: ts=4 sw=4 expandtab

View File

@ -1 +1 @@
{"rougail.general.mode_conteneur_actif": "non", "rougail.general.module_instancie": "non"} {"rougail.my_var": "no", "rougail.instanciated_module": false}

View File

@ -11,8 +11,7 @@ try:
from tiramisu3 import * from tiramisu3 import *
except: except:
from tiramisu import * from tiramisu import *
option_4 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) option_3 = BoolOption(name="instanciated_module", doc="instanciated_module", default=False, properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"auto_freeze", "expert", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_4, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) option_2 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"auto_freeze", "expert", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue(True), 'reverse_condition': ParamValue(True)}))}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3])
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View File

@ -1,19 +1,17 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<rougail> <rougail>
<variables> <variables>
<family name="general"> <variable name="instanciated_module" type="boolean">
<variable name="module_instancie" type="string" description="No change"> <value>no</value>
<value>non</value> </variable>
</variable> <variable name="my_variable" auto_freeze="True" hidden="True">
<variable name="mode_conteneur_actif" type="string" description="No change" auto_freeze="True" hidden="True"> <value>no</value>
<value>non</value> </variable>
</variable>
</family>
</variables> </variables>
<constraints> <constraints>
<fill name="calc_val"> <fill name="calc_val">
<param>oui</param> <param>yes</param>
<target>mode_conteneur_actif</target> <target>my_variable</target>
</fill> </fill>
</constraints> </constraints>
</rougail> </rougail>

View File

@ -1 +1 @@
{"rougail.general.module_instancie": "non", "rougail.general.mode_conteneur_actif": "oui"} {"rougail.instanciated_module": false, "rougail.my_variable": "yes"}

View File

@ -11,8 +11,7 @@ try:
from tiramisu3 import * from tiramisu3 import *
except: except:
from tiramisu import * from tiramisu import *
option_3 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) option_2 = BoolOption(name="instanciated_module", doc="instanciated_module", default=False, properties=frozenset({"mandatory", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"auto_freeze", "basic", "force_store_value", "frozen", "hidden", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) option_3 = StrOption(name="my_variable", doc="my_variable", default=Calculation(func.calc_val, Params((ParamValue("yes")))), properties=frozenset({"auto_freeze", "force_store_value", "frozen", "hidden", "normal", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_2, todict=True), 'expected': ParamValue(True), 'reverse_condition': ParamValue(True)}))}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"basic"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3])
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View File

@ -1,23 +1,21 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<rougail> <rougail>
<variables> <variables>
<family name="general"> <variable name="my_var1" auto_freeze="True">
<variable name="mode_conteneur_actif" type="string" description="No change" auto_freeze="True"> <value>no</value>
<value>non</value> </variable>
</variable> <variable name="my_var2">
<variable name="mode_conteneur_actif1" type="string" description="No change"> <value>no</value>
<value>non</value> </variable>
</variable> <variable name="instanciated_module" type="boolean">
<variable name="module_instancie" type="string" description="No change"> <value>False</value>
<value>non</value> </variable>
</variable>
</family>
</variables> </variables>
<constraints> <constraints>
<fill name="calc_val"> <fill name="calc_val">
<param type="variable">mode_conteneur_actif1</param> <param type="variable">my_var2</param>
<target>mode_conteneur_actif</target> <target>my_var1</target>
</fill> </fill>
</constraints> </constraints>
</rougail> </rougail>

View File

@ -1 +1 @@
{"rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif1": "non", "rougail.general.module_instancie": "non"} {"rougail.my_var1": "no", "rougail.my_var2": "no", "rougail.instanciated_module": false}

View File

@ -11,9 +11,8 @@ 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="my_var2", doc="my_var2", default="no", properties=frozenset({"mandatory", "normal"}))
option_5 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) option_4 = BoolOption(name="instanciated_module", doc="instanciated_module", default=False, 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({"auto_freeze", "basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_5, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) option_2 = StrOption(name="my_var1", doc="my_var1", default=Calculation(func.calc_val, Params((ParamOption(option_3)))), properties=frozenset({"auto_freeze", "force_store_value", "normal", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_4, todict=True), 'expected': ParamValue(True), 'reverse_condition': ParamValue(True)}))}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"basic"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3, option_4])
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View File

@ -1,23 +1,21 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<rougail> <rougail>
<variables> <variables>
<family name="general"> <variable name="instanciated_module" type="boolean">
<variable name="module_instancie" type="string" description="No change"> <value>False</value>
<value>non</value> </variable>
</variable> <variable name="my_var" type="string" auto_freeze="True">
<variable name="mode_conteneur_actif" type="string" description="No change" auto_freeze="True"> <value>no</value>
<value>non</value> </variable>
</variable>
</family>
</variables> </variables>
<constraints> <constraints>
<fill name="calc_val"> <fill name="calc_val">
<param>oui</param> <param>yes</param>
<target>mode_conteneur_actif</target> <target>my_var</target>
</fill> </fill>
<condition name="hidden_if_in" source="module_instancie"> <condition name="hidden_if_in" source="instanciated_module">
<param>oui</param> <param>True</param>
<target type="variable">mode_conteneur_actif</target> <target type="variable">my_var</target>
</condition> </condition>
</constraints> </constraints>
</rougail> </rougail>

View File

@ -1 +1 @@
{"rougail.general.module_instancie": "non", "rougail.general.mode_conteneur_actif": "oui"} {"rougail.instanciated_module": false, "rougail.my_var": "yes"}

View File

@ -11,8 +11,7 @@ try:
from tiramisu3 import * from tiramisu3 import *
except: except:
from tiramisu import * from tiramisu import *
option_3 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) option_2 = BoolOption(name="instanciated_module", doc="instanciated_module", default=False, properties=frozenset({"mandatory", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"auto_freeze", "basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) option_3 = StrOption(name="my_var", doc="my_var", default=Calculation(func.calc_val, Params((ParamValue("yes")))), properties=frozenset({"auto_freeze", "force_store_value", "normal", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_2, todict=True), 'expected': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_2, todict=True), 'expected': ParamValue(True), 'reverse_condition': ParamValue(True)}))}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"basic"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3])
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View File

@ -1,30 +1,28 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<rougail> <rougail>
<variables> <variables>
<family name="general"> <variable name="my_var" auto_freeze="True">
<variable name="mode_conteneur_actif" type="string" description="No change" auto_freeze="True"> <value>no</value>
<value>non</value> </variable>
</variable> <variable name="condition">
<variable name="condition" type="string" description="No change"> <value>no</value>
<value>non</value> </variable>
</variable> <variable name="my_var1" hidden="True">
<variable name="mode_conteneur_actif1" type="string" description="No change" hidden="True"> <value>no</value>
<value>non</value> </variable>
</variable> <variable name="my_var2">
<variable name="mode_conteneur_actif2" type="string" description="No change"> <value>no</value>
<value>non</value> </variable>
</variable> <variable name="instanciated_module" type="boolean" hidden="True">
<variable name="module_instancie" type="string" description="No change" hidden="True"> <value>False</value>
<value>non</value> </variable>
</variable>
</family>
</variables> </variables>
<constraints> <constraints>
<condition name="disabled_if_in" source="condition"> <condition name="disabled_if_in" source="condition">
<param>oui</param> <param>yes</param>
<target type="variable">mode_conteneur_actif1</target> <target type="variable">my_var1</target>
<target type="variable">mode_conteneur_actif2</target> <target type="variable">my_var2</target>
</condition> </condition>
</constraints> </constraints>
</rougail> </rougail>

View File

@ -1,8 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<rougail> <rougail>
<variables> <variables>
<family name="general"> <variable name="condition" redefine="True" remove_condition="True"/>
<variable name="condition" redefine="True" remove_condition="True"/>
</family>
</variables> </variables>
</rougail> </rougail>

View File

@ -1 +1 @@
{"rougail.general.mode_conteneur_actif": "non", "rougail.general.condition": "non", "rougail.general.mode_conteneur_actif1": "non", "rougail.general.mode_conteneur_actif2": "non", "rougail.general.module_instancie": "non"} {"rougail.my_var": "no", "rougail.condition": "no", "rougail.my_var1": "no", "rougail.my_var2": "no", "rougail.instanciated_module": false}

View File

@ -11,11 +11,10 @@ try:
from tiramisu3 import * from tiramisu3 import *
except: except:
from tiramisu import * from tiramisu import *
option_7 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) option_6 = BoolOption(name="instanciated_module", doc="instanciated_module", default=False, properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"auto_freeze", "basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_7, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) option_2 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"auto_freeze", "force_store_value", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_6, todict=True), 'expected': ParamValue(True), 'reverse_condition': ParamValue(True)}))}))
option_4 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) option_3 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"}))
option_5 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) option_4 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_6 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) option_5 = StrOption(name="my_var2", doc="my_var2", default="no", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5, option_6, option_7], properties=frozenset({"basic"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3, option_4, option_5, option_6])
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View File

@ -2,14 +2,14 @@
<rougail> <rougail>
<variables> <variables>
<family name="général"> <family name="général">
<variable name="mode_conteneur_actif" type="string" description="No change" auto_freeze="True"> <variable name="my_var" auto_freeze="True">
<value>non</value> <value>no</value>
</variable> </variable>
<variable name="activer_ejabberd" type="string" description="No change" hidden="True"> <variable name="my_var1" hidden="True">
<value>non</value> <value>no</value>
</variable> </variable>
<variable name="module_instancie" type="string" description="No change" hidden="True"> <variable name="instanciated_module" type="boolean" hidden="True">
<value>non</value> <value>False</value>
</variable> </variable>
</family> </family>
</variables> </variables>

View File

@ -1 +1 @@
{"rougail.general.mode_conteneur_actif": "non", "rougail.general.activer_ejabberd": "non", "rougail.general.module_instancie": "non", "extra.ejabberd.description": "Exportation de la base de ejabberd", "extra.ejabberd.day": "none", "extra.ejabberd.mode": "pre", "extra1.external.description": "test"} {"rougail.general.my_var": "no", "rougail.general.my_var1": "no", "rougail.general.instanciated_module": false, "extra.ejabberd.description": "Exportation de la base de ejabberd", "extra.ejabberd.day": "none", "extra.ejabberd.mode": "pre", "extra1.external.description": "test"}

View File

@ -11,9 +11,9 @@ try:
from tiramisu3 import * from tiramisu3 import *
except: except:
from tiramisu import * from tiramisu import *
option_5 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) option_5 = BoolOption(name="instanciated_module", doc="instanciated_module", default=False, properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"auto_freeze", "basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_5, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))})) option_3 = StrOption(name="my_var", doc="my_var", default="no", properties=frozenset({"auto_freeze", "basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_5, todict=True), 'expected': ParamValue(True), 'reverse_condition': ParamValue(True)}))}))
option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) option_4 = StrOption(name="my_var1", doc="my_var1", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4, option_5], properties=frozenset({"basic"})) option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4, option_5], properties=frozenset({"basic"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_8 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) option_8 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"}))

View File

@ -2,7 +2,7 @@
<rougail> <rougail>
<variables> <variables>
<family name="général"> <family name="général">
<variable name="mode_conteneur_actif" type="string" description="No change" auto_freeze="True"> <variable name="mode_conteneur_actif" type="string" description="No change">
<value>non</value> <value>non</value>
</variable> </variable>
<variable name="activer_ejabberd" type="string" description="No change" hidden="True"> <variable name="activer_ejabberd" type="string" description="No change" hidden="True">

View File

@ -11,10 +11,10 @@ try:
from tiramisu3 import * from tiramisu3 import *
except: except:
from tiramisu import * from tiramisu import *
option_5 = StrOption(name="module_instancie", 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({"mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"auto_freeze", "basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_5, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))}))
option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) option_4 = StrOption(name="activer_ejabberd", 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, option_5], properties=frozenset({"basic"})) option_5 = StrOption(name="module_instancie", 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, option_5], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_8 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"})) option_8 = StrOption(name="description", doc="description", default="Exportation de la base de ejabberd", properties=frozenset({"mandatory", "normal"}))
option_9 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default="none", properties=frozenset({"mandatory", "normal"})) option_9 = ChoiceOption(name="day", doc="day", values=('none', 'daily', 'weekly', 'monthly'), default="none", properties=frozenset({"mandatory", "normal"}))

View File

@ -2,10 +2,10 @@
<rougail> <rougail>
<variables> <variables>
<family name="general"> <family name="general">
<variable name="module_instancie" type="string" description="No change"/> <variable name="instanciated_module" type="boolean"/>
<variable name="leader" type="string" description="leader" auto_freeze="True" multi="True"/> <variable name="leader" description="leader" auto_freeze="True" multi="True"/>
<variable name="follower1" type="string" description="follower1" multi="True"/> <variable name="follower1" multi="True"/>
<variable name="follower2" type="string" description="follower2" multi="True"/> <variable name="follower2" multi="True"/>
</family> </family>
</variables> </variables>