This commit is contained in:
Emmanuel Garette 2020-07-24 14:59:09 +02:00
parent 17e09354fa
commit d18248544c
110 changed files with 1451 additions and 1093 deletions

File diff suppressed because it is too large Load diff

View file

@ -129,9 +129,11 @@
<!ATTLIST check level (error|warning) "error"> <!ATTLIST check level (error|warning) "error">
<!ELEMENT condition ((target | param)+ )> <!ELEMENT condition ((target | param)+ )>
<!ATTLIST condition name CDATA #REQUIRED> <!ATTLIST condition name (disabled_if_in|disabled_if_not_in|hidden_if_in|auto_hidden_if_not_in|hidden_if_not_in|mandatory_if_in|mandatory_if_not_in) #REQUIRED>
<!ATTLIST condition source CDATA #REQUIRED> <!ATTLIST condition source CDATA #REQUIRED>
<!ATTLIST condition fallback (True|False) "False"> <!ATTLIST condition fallback (True|False) "False">
<!ATTLIST condition force_condition_on_fallback (True|False) "False">
<!ATTLIST condition force_inverse_condition_on_fallback (True|False) "False">
<!ELEMENT group (follower+)> <!ELEMENT group (follower+)>
<!ATTLIST group leader CDATA #REQUIRED> <!ATTLIST group leader CDATA #REQUIRED>

View file

@ -27,8 +27,8 @@ from collections import OrderedDict
from lxml.etree import Element, SubElement # pylint: disable=E0611 from lxml.etree import Element, SubElement # pylint: disable=E0611
from .i18n import _ from .i18n import _
from .xmlreflector import XMLReflector, HIGH_COMPATIBILITY from .xmlreflector import XMLReflector
from .annotator import ERASED_ATTRIBUTES, ServiceAnnotator, SpaceAnnotator from .annotator import ERASED_ATTRIBUTES, SpaceAnnotator
from .utils import normalize_family from .utils import normalize_family
from .error import OperationError, SpaceObjShallNotBeUpdated, DictConsistencyError from .error import OperationError, SpaceObjShallNotBeUpdated, DictConsistencyError
from .path import Path from .path import Path
@ -183,7 +183,7 @@ class CreoleObjSpace:
family_names.append(child.attrib['name']) family_names.append(child.attrib['name'])
if child.tag == 'variables': if child.tag == 'variables':
child.attrib['name'] = namespace child.attrib['name'] = namespace
if HIGH_COMPATIBILITY and child.tag == 'value' and child.text == None: if child.tag == 'value' and child.text == None:
# FIXME should not be here # FIXME should not be here
continue continue
# variable objects creation # variable objects creation
@ -444,8 +444,6 @@ class CreoleObjSpace:
): ):
redefine = self.convert_boolean(child.attrib.get('redefine', False)) redefine = self.convert_boolean(child.attrib.get('redefine', False))
has_value = hasattr(variableobj, 'value') has_value = hasattr(variableobj, 'value')
if HIGH_COMPATIBILITY and has_value:
has_value = len(child) != 1 or child[0].text != None
if redefine is True and child.tag == 'variable' and has_value and len(child) != 0: if redefine is True and child.tag == 'variable' and has_value and len(child) != 0:
del variableobj.value del variableobj.value
for attr, val in child.attrib.items(): for attr, val in child.attrib.items():
@ -522,7 +520,6 @@ class CreoleObjSpace:
variableobj.path = self.paths.get_family_path(family_name, namespace) variableobj.path = self.paths.get_family_path(family_name, namespace)
def space_visitor(self, eosfunc_file): # pylint: disable=C0111 def space_visitor(self, eosfunc_file): # pylint: disable=C0111
ServiceAnnotator(self)
SpaceAnnotator(self, eosfunc_file) SpaceAnnotator(self, eosfunc_file)
def save(self, filename, force_no_save=False): def save(self, filename, force_no_save=False):

View file

@ -13,6 +13,7 @@ class Path:
def __init__(self): def __init__(self):
self.variables = {} self.variables = {}
self.families = {} self.families = {}
self.full_paths = {}
# Family # Family
def add_family(self, def add_family(self,
@ -20,7 +21,12 @@ class Path:
name: str, name: str,
variableobj: str, variableobj: str,
) -> str: # pylint: disable=C0111 ) -> str: # pylint: disable=C0111
self.families[name] = dict(name=name, if '.' not in name and namespace == variable_namespace:
full_name = '.'.join([namespace, name])
self.full_paths[name] = full_name
else:
full_name = name
self.families[full_name] = dict(name=name,
namespace=namespace, namespace=namespace,
variableobj=variableobj, variableobj=variableobj,
) )
@ -29,24 +35,26 @@ class Path:
name: str, name: str,
current_namespace: str, current_namespace: str,
) -> str: # pylint: disable=C0111 ) -> str: # pylint: disable=C0111
if current_namespace is None: # pragma: no cover name = normalize_family(name,
raise OperationError('current_namespace must not be None')
dico = self.families[normalize_family(name,
check_name=False, check_name=False,
allow_dot=True, allow_dot=True,
)] )
if '.' not in name and current_namespace == variable_namespace and name in self.full_paths:
name = self.full_paths[name]
if current_namespace is None: # pragma: no cover
raise OperationError('current_namespace must not be None')
dico = self.families[name]
if dico['namespace'] != variable_namespace and current_namespace != dico['namespace']: if dico['namespace'] != variable_namespace and current_namespace != dico['namespace']:
raise DictConsistencyError(_('A family located in the {} namespace ' raise DictConsistencyError(_('A family located in the {} namespace '
'shall not be used in the {} namespace').format( 'shall not be used in the {} namespace').format(
dico['namespace'], current_namespace)) dico['namespace'], current_namespace))
path = dico['name'] return dico['name']
if dico['namespace'] is not None and '.' not in dico['name']:
path = '.'.join([dico['namespace'], path])
return path
def get_family_obj(self, def get_family_obj(self,
name: str, name: str,
) -> 'Family': # pylint: disable=C0111 ) -> 'Family': # pylint: disable=C0111
if '.' not in name and name in self.full_paths:
name = self.full_paths[name]
if name not in self.families: if name not in self.families:
raise DictConsistencyError(_('unknown family {}').format(name)) raise DictConsistencyError(_('unknown family {}').format(name))
dico = self.families[name] dico = self.families[name]
@ -59,7 +67,6 @@ class Path:
name: str, name: str,
leader_name: str, leader_name: str,
) -> None: # pylint: disable=C0111 ) -> None: # pylint: disable=C0111
if namespace != variable_namespace:
# need rebuild path and move object in new path # need rebuild path and move object in new path
old_path = namespace + '.' + leader_family_name + '.' + name old_path = namespace + '.' + leader_family_name + '.' + name
dico = self._get_variable(old_path) dico = self._get_variable(old_path)
@ -71,6 +78,9 @@ class Path:
False, False,
dico['variableobj'], dico['variableobj'],
) )
if namespace == variable_namespace:
self.full_paths[name] = new_path
else:
name = new_path name = new_path
dico = self._get_variable(name) dico = self._get_variable(name)
if dico['leader'] != None: if dico['leader'] != None:
@ -89,11 +99,14 @@ class Path:
is_dynamic: bool, is_dynamic: bool,
variableobj, variableobj,
) -> str: # pylint: disable=C0111 ) -> str: # pylint: disable=C0111
if namespace == variable_namespace or '.' in name: if '.' not in name:
varname = name full_name = '.'.join([namespace, family, name])
self.full_paths[name] = full_name
else: else:
varname = '.'.join([namespace, family, name]) full_name = name
self.variables[varname] = dict(name=name, if namespace == variable_namespace:
name = name.rsplit('.', 1)[1]
self.variables[full_name] = dict(name=name,
family=family, family=family,
namespace=namespace, namespace=namespace,
leader=None, leader=None,
@ -154,6 +167,8 @@ class Path:
def path_is_defined(self, def path_is_defined(self,
name: str, name: str,
) -> str: # pylint: disable=C0111 ) -> str: # pylint: disable=C0111
if '.' not in name and name not in self.variables and name in self.full_paths:
return True
return name in self.variables return name in self.variables
def _get_variable(self, def _get_variable(self,
@ -161,14 +176,20 @@ class Path:
with_suffix: bool=False, with_suffix: bool=False,
) -> str: ) -> str:
if name not in self.variables: if name not in self.variables:
if name.startswith(f'{variable_namespace}.'): if name not in self.variables:
name = name.split('.')[-1] if '.' not in name and name in self.full_paths:
name = self.full_paths[name]
if name not in self.variables: if name not in self.variables:
for var_name, variable in self.variables.items(): for var_name, variable in self.variables.items():
if variable['is_dynamic'] and name.startswith(var_name): if variable['is_dynamic'] and name.startswith(var_name):
return variable, name[len(var_name):] return variable, name[len(var_name):]
if '.' not in name:
for var_name, path in self.full_paths.items():
if name.startswith(var_name):
variable = self.variables[self.full_paths[var_name]]
if variable['is_dynamic']:
return variable, name[len(var_name):]
raise DictConsistencyError(_('unknown option {}').format(name)) raise DictConsistencyError(_('unknown option {}').format(name))
if with_suffix: if with_suffix:
return self.variables[name], None return self.variables[name], None
return self.variables[name] return self.variables[name]

View file

@ -8,7 +8,6 @@ from lxml.etree import DTD, parse, tostring # , XMLParser
from .i18n import _ from .i18n import _
from .error import DictConsistencyError from .error import DictConsistencyError
HIGH_COMPATIBILITY = True
class XMLReflector(object): class XMLReflector(object):
"""Helper class for loading the Creole XML file, """Helper class for loading the Creole XML file,

View file

@ -8,7 +8,7 @@
<variable name="mode_conteneur_actif" type="oui/non" description="No change" hidden="True"> <variable name="mode_conteneur_actif" type="oui/non" description="No change" hidden="True">
<value>non</value> <value>non</value>
</variable> </variable>
<variable name="autosavevar" type="string" description="autosave variable" hidden="True" auto_save="True"/> <variable name="autosavevar" type="string" description="autosave variable" auto_save="True"/>
</family> </family>
<separators/> <separators/>
</variables> </variables>

View file

@ -17,8 +17,8 @@
<property>force_store_value</property> <property>force_store_value</property>
<property>mandatory</property> <property>mandatory</property>
<property>basic</property> <property>basic</property>
<property expected="oui" inverse="False" source="rougail.general.mode_conteneur_actif" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="rougail.general.mode_conteneur_actif" type="calculation">hidden</property> <property expected="oui" inverse="False" source="rougail.general.mode_conteneur_actif" type="calculation">hidden</property>
<property expected="oui" inverse="False" source="rougail.general.mode_conteneur_actif" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="rougail.general.mode_conteneur_actif" type="calculation">force_default_on_freeze</property> <property expected="oui" inverse="False" source="rougail.general.mode_conteneur_actif" type="calculation">force_default_on_freeze</property>
<value name="calc_val" type="calculation"> <value name="calc_val" type="calculation">
<param type="string">oui</param> <param type="string">oui</param>

View file

@ -3,7 +3,7 @@ from rougail.tiramisu import ConvertDynOptionDescription
import imp import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py') func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = ChoiceOption(properties=frozenset(['force_default_on_freeze', 'frozen', 'hidden', 'mandatory', 'normal']), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non')) option_3 = ChoiceOption(properties=frozenset(['force_default_on_freeze', 'frozen', 'hidden', 'mandatory', 'normal']), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non'))
option_4 = StrOption(properties=frozenset(['force_store_value', 'mandatory', 'basic', Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='autosave variable', multi=False, name='autosavevar', default=Calculation(func.calc_val, Params((ParamValue("oui")), kwargs={}))) option_4 = StrOption(properties=frozenset(['force_store_value', 'mandatory', 'basic', Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='autosave variable', multi=False, name='autosavevar', default=Calculation(func.calc_val, Params((ParamValue("oui")), kwargs={})))
option_2 = OptionDescription(doc='général', name='general', properties=frozenset(['basic']), children=[option_3, option_4]) option_2 = OptionDescription(doc='général', name='general', properties=frozenset(['basic']), children=[option_3, option_4])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2]) option_1 = OptionDescription(doc='rougail', name='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

@ -9,8 +9,8 @@
<value>non</value> <value>non</value>
</variable> </variable>
</family> </family>
<family name="leadermode" mode="expert"> <family name="leadermode">
<variable name="leader" type="string" description="leader" multi="True" hidden="True"/> <variable name="leader" type="string" description="leader" multi="True" mode="expert"/>
<variable name="follower1" type="string" description="follower1"/> <variable name="follower1" type="string" description="follower1"/>
<variable name="follower2" type="string" description="follower2"/> <variable name="follower2" type="string" description="follower2"/>
</family> </family>

View file

@ -14,24 +14,17 @@
<family doc="leadermode" name="leadermode"> <family doc="leadermode" name="leadermode">
<property>expert</property> <property>expert</property>
<leader doc="leader" name="leader"> <leader doc="leader" name="leader">
<property>hidden</property>
<property>expert</property> <property>expert</property>
<variable doc="leader" multi="True" name="leader" type="string"> <variable doc="leader" multi="True" name="leader" type="string">
<property>force_default_on_freeze</property>
<property>frozen</property>
<property>mandatory</property> <property>mandatory</property>
<value name="calc_list" type="calculation"> <value name="calc_list" type="calculation">
<param name="valeur" type="string">valfill</param> <param name="valeur" type="string">valfill</param>
</value> </value>
</variable> </variable>
<variable doc="follower1" multi="False" name="follower1" type="string"> <variable doc="follower1" multi="False" name="follower1" type="string">
<property>force_default_on_freeze</property>
<property>frozen</property>
<property>expert</property> <property>expert</property>
</variable> </variable>
<variable doc="follower2" multi="False" name="follower2" type="string"> <variable doc="follower2" multi="False" name="follower2" type="string">
<property>force_default_on_freeze</property>
<property>frozen</property>
<property>expert</property> <property>expert</property>
</variable> </variable>
</leader> </leader>

View file

@ -4,10 +4,10 @@ import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py') func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = ChoiceOption(properties=frozenset(['mandatory', 'expert']), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non')) option_3 = ChoiceOption(properties=frozenset(['mandatory', 'expert']), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non'))
option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['expert']), children=[option_3]) option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['expert']), children=[option_3])
option_6 = StrOption(properties=frozenset(['force_default_on_freeze', 'frozen', 'mandatory']), doc='leader', multi=True, name='leader', default=Calculation(func.calc_list, Params((), kwargs={'valeur': ParamValue("valfill")}))) option_6 = StrOption(properties=frozenset(['mandatory']), doc='leader', multi=True, name='leader', default=Calculation(func.calc_list, Params((), kwargs={'valeur': ParamValue("valfill")})))
option_7 = StrOption(properties=frozenset(['force_default_on_freeze', 'frozen', 'expert']), doc='follower1', multi=True, name='follower1') option_7 = StrOption(properties=frozenset(['expert']), doc='follower1', multi=True, name='follower1')
option_8 = StrOption(properties=frozenset(['force_default_on_freeze', 'frozen', 'expert']), doc='follower2', multi=True, name='follower2') option_8 = StrOption(properties=frozenset(['expert']), doc='follower2', multi=True, name='follower2')
option_5 = Leadership(doc='leader', name='leader', properties=frozenset(['hidden', 'expert']), children=[option_6, option_7, option_8]) option_5 = Leadership(doc='leader', name='leader', properties=frozenset(['expert']), children=[option_6, option_7, option_8])
option_4 = OptionDescription(doc='leadermode', name='leadermode', properties=frozenset(['expert']), children=[option_5]) option_4 = OptionDescription(doc='leadermode', name='leadermode', properties=frozenset(['expert']), children=[option_5])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2, option_4]) option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2, option_4])
option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1]) option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1])

View file

@ -0,0 +1,31 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services/>
<variables>
<family name="general" mode="expert">
<variable name="mode_conteneur_actif" type="oui/non" description="No change">
<value>non</value>
</variable>
</family>
<family name="leadermode">
<variable name="leader" type="string" description="leader" multi="True" hidden="True"/>
<variable name="follower1" type="string" description="follower1"/>
<variable name="follower2" type="string" description="follower2"/>
</family>
</variables>
<constraints>
<fill name="calc_list" target="leader">
<param name="valeur">valfill</param>
</fill>
<group leader="leader">
<follower>follower1</follower>
<follower>follower2</follower>
</group>
</constraints>
<help/>
</rougail>

View file

@ -0,0 +1 @@
{"rougail.general.mode_conteneur_actif": "non", "rougail.leadermode.leader.leader": [], "rougail.leadermode.leader.follower1": [], "rougail.leadermode.leader.follower2": []}

View file

@ -0,0 +1,40 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<family doc="rougail" name="rougail">
<family doc="general" name="general">
<property>expert</property>
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>expert</property>
<value type="string">non</value>
</variable>
</family>
<family doc="leadermode" name="leadermode">
<property>normal</property>
<leader doc="leader" name="leader">
<property>hidden</property>
<property>normal</property>
<variable doc="leader" multi="True" name="leader" type="string">
<property>force_default_on_freeze</property>
<property>frozen</property>
<property>mandatory</property>
<value name="calc_list" type="calculation">
<param name="valeur" type="string">valfill</param>
</value>
</variable>
<variable doc="follower1" multi="False" name="follower1" type="string">
<property>force_default_on_freeze</property>
<property>frozen</property>
<property>normal</property>
</variable>
<variable doc="follower2" multi="False" name="follower2" type="string">
<property>force_default_on_freeze</property>
<property>frozen</property>
<property>normal</property>
</variable>
</leader>
</family>
</family>
</rougail>

View file

@ -0,0 +1,13 @@
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = ChoiceOption(properties=frozenset(['mandatory', 'expert']), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non'))
option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['expert']), children=[option_3])
option_6 = StrOption(properties=frozenset(['force_default_on_freeze', 'frozen', 'mandatory']), doc='leader', multi=True, name='leader', default=Calculation(func.calc_list, Params((), kwargs={'valeur': ParamValue("valfill")})))
option_7 = StrOption(properties=frozenset(['force_default_on_freeze', 'frozen', 'normal']), doc='follower1', multi=True, name='follower1')
option_8 = StrOption(properties=frozenset(['force_default_on_freeze', 'frozen', 'normal']), doc='follower2', multi=True, name='follower2')
option_5 = Leadership(doc='leader', name='leader', properties=frozenset(['hidden', 'normal']), children=[option_6, option_7, option_8])
option_4 = OptionDescription(doc='leadermode', name='leadermode', properties=frozenset(['normal']), children=[option_5])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2, option_4])
option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1])

View file

@ -0,0 +1,32 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services/>
<variables>
<family name="general" mode="expert">
<variable name="mode_conteneur_actif" type="oui/non" description="No change">
<value>non</value>
</variable>
</family>
<family name="leadermode">
<variable name="leader" type="string" description="leader" multi="True"/>
<variable name="follower1" type="string" description="follower1"/>
<variable name="follower2" type="string" description="follower2"/>
</family>
</variables>
<constraints>
<group leader="leader">
<follower>follower1</follower>
<follower>follower2</follower>
</group>
<condition name="hidden_if_in" source="mode_conteneur_actif">
<param>non</param>
<target type="variable">leader</target>
</condition>
</constraints>
<help/>
</rougail>

View file

@ -0,0 +1 @@
{"rougail.general.mode_conteneur_actif": "non", "rougail.leadermode.leader.leader": [], "rougail.leadermode.leader.follower1": [], "rougail.leadermode.leader.follower2": []}

View file

@ -0,0 +1,36 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<family doc="rougail" name="rougail">
<family doc="general" name="general">
<property>expert</property>
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>expert</property>
<value type="string">non</value>
</variable>
</family>
<family doc="leadermode" name="leadermode">
<property>normal</property>
<leader doc="leader" name="leader">
<property>normal</property>
<property expected="non" inverse="False" source="rougail.general.mode_conteneur_actif" type="calculation">hidden</property>
<variable doc="leader" multi="True" name="leader" type="string">
<property expected="non" inverse="False" source="rougail.general.mode_conteneur_actif" type="calculation">frozen</property>
<property expected="non" inverse="False" source="rougail.general.mode_conteneur_actif" type="calculation">force_default_on_freeze</property>
</variable>
<variable doc="follower1" multi="False" name="follower1" type="string">
<property>normal</property>
<property expected="non" inverse="False" source="rougail.general.mode_conteneur_actif" type="calculation">frozen</property>
<property expected="non" inverse="False" source="rougail.general.mode_conteneur_actif" type="calculation">force_default_on_freeze</property>
</variable>
<variable doc="follower2" multi="False" name="follower2" type="string">
<property>normal</property>
<property expected="non" inverse="False" source="rougail.general.mode_conteneur_actif" type="calculation">frozen</property>
<property expected="non" inverse="False" source="rougail.general.mode_conteneur_actif" type="calculation">force_default_on_freeze</property>
</variable>
</leader>
</family>
</family>
</rougail>

View file

@ -0,0 +1,13 @@
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = ChoiceOption(properties=frozenset(['mandatory', 'expert']), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non'))
option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['expert']), children=[option_3])
option_6 = StrOption(properties=frozenset([Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('non')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('non')}))]), doc='leader', multi=True, name='leader')
option_7 = StrOption(properties=frozenset(['normal', Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('non')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('non')}))]), doc='follower1', multi=True, name='follower1')
option_8 = StrOption(properties=frozenset(['normal', Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('non')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('non')}))]), doc='follower2', multi=True, name='follower2')
option_5 = Leadership(doc='leader', name='leader', properties=frozenset(['normal', Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('non')}))]), children=[option_6, option_7, option_8])
option_4 = OptionDescription(doc='leadermode', name='leadermode', properties=frozenset(['normal']), children=[option_5])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2, option_4])
option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1])

View file

@ -0,0 +1,38 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services/>
<variables>
<family name="general">
<variable name="condition" type="oui/non" description="No change">
<value>non</value>
</variable>
<variable name="mode_conteneur_actif" type="oui/non" description="No change">
<value>non</value>
</variable>
<variable name="mode_conteneur_actif2" type="oui/non" description="No change">
<value>non</value>
</variable>
</family>
<separators/>
</variables>
<constraints>
<condition name="disabled_if_not_in" source="condition">
<param>oui</param>
<target type="variable">mode_conteneur_actif</target>
<target type="variable">mode_conteneur_actif2</target>
<target type="filelist">afilllist</target>
</condition>
<condition name="disabled_if_not_in" source="activer_client_ldap" fallback="True">
<param>non</param>
<target type="variable">mode_conteneur_actif</target>
</condition>
</constraints>
<help/>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View file

@ -0,0 +1 @@
{"rougail.general.condition": "non"}

View file

@ -0,0 +1,31 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<family doc="rougail" name="rougail">
<family doc="general" name="general">
<property>normal</property>
<variable doc="No change" multi="False" name="condition" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="True" source="rougail.general.condition" type="calculation">disabled</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="True" source="rougail.general.condition" type="calculation">disabled</property>
<value type="string">non</value>
</variable>
</family>
</family>
</rougail>

View file

@ -0,0 +1,10 @@
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='condition', default='non', values=('oui', 'non'))
option_4 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))]), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non'))
option_5 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))]), doc='No change', multi=False, name='mode_conteneur_actif2', default='non', values=('oui', 'non'))
option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2])
option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1])

View file

@ -0,0 +1,38 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services/>
<variables>
<family name="general">
<variable name="condition" type="oui/non" description="No change">
<value>non</value>
</variable>
<variable name="mode_conteneur_actif" type="oui/non" description="No change">
<value>non</value>
</variable>
<variable name="mode_conteneur_actif2" type="oui/non" description="No change">
<value>non</value>
</variable>
</family>
<separators/>
</variables>
<constraints>
<condition name="disabled_if_not_in" source="condition" force_inverse_condition_on_fallback="True">
<param>oui</param>
<target type="variable">mode_conteneur_actif</target>
<target type="variable">mode_conteneur_actif2</target>
<target type="filelist">afilllist</target>
</condition>
<condition name="disabled_if_not_in" source="activer_client_ldap" fallback="True">
<param>non</param>
<target type="variable">mode_conteneur_actif</target>
</condition>
</constraints>
<help/>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View file

@ -0,0 +1 @@
{"rougail.general.condition": "non"}

View file

@ -0,0 +1,31 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<family doc="rougail" name="rougail">
<family doc="general" name="general">
<property>normal</property>
<variable doc="No change" multi="False" name="condition" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="True" source="rougail.general.condition" type="calculation">disabled</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="True" source="rougail.general.condition" type="calculation">disabled</property>
<value type="string">non</value>
</variable>
</family>
</family>
</rougail>

View file

@ -0,0 +1,10 @@
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='condition', default='non', values=('oui', 'non'))
option_4 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))]), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non'))
option_5 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))]), doc='No change', multi=False, name='mode_conteneur_actif2', default='non', values=('oui', 'non'))
option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2])
option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1])

View file

@ -16,7 +16,6 @@
<property>disabled</property> <property>disabled</property>
<property>mandatory</property> <property>mandatory</property>
<property>normal</property> <property>normal</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">disabled</property>
<value type="string">non</value> <value type="string">non</value>
</variable> </variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice"> <variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice">

View file

@ -3,7 +3,7 @@ from rougail.tiramisu import ConvertDynOptionDescription
import imp import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py') func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='condition', default='non', values=('oui', 'non')) option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='condition', default='non', values=('oui', 'non'))
option_4 = ChoiceOption(properties=frozenset(['disabled', 'mandatory', 'normal', Calculation(calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non')) option_4 = ChoiceOption(properties=frozenset(['disabled', 'mandatory', 'normal']), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non'))
option_5 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif2', default='non', values=('oui', 'non')) option_5 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif2', default='non', values=('oui', 'non'))
option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5]) option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2]) option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2])

View file

@ -0,0 +1,38 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services/>
<variables>
<family name="general">
<variable name="condition" type="oui/non" description="No change">
<value>non</value>
</variable>
<variable name="mode_conteneur_actif" type="oui/non" description="No change">
<value>non</value>
</variable>
<variable name="mode_conteneur_actif2" type="oui/non" description="No change">
<value>non</value>
</variable>
</family>
<separators/>
</variables>
<constraints>
<condition name="disabled_if_in" source="condition">
<param>oui</param>
<target type="variable">mode_conteneur_actif</target>
<target type="variable">mode_conteneur_actif2</target>
<target type="filelist">afilllist</target>
</condition>
<condition name="disabled_if_in" source="activer_client_ldap" fallback="True" force_condition_on_fallback="True">
<param>non</param>
<target type="variable">mode_conteneur_actif</target>
</condition>
</constraints>
<help/>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View file

@ -0,0 +1 @@
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non"}

View file

@ -0,0 +1,31 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<family doc="rougail" name="rougail">
<family doc="general" name="general">
<property>normal</property>
<variable doc="No change" multi="False" name="condition" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">disabled</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">disabled</property>
<value type="string">non</value>
</variable>
</family>
</family>
</rougail>

View file

@ -0,0 +1,10 @@
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='condition', default='non', values=('oui', 'non'))
option_4 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non'))
option_5 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif2', default='non', values=('oui', 'non'))
option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2])
option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1])

View file

@ -8,10 +8,10 @@
<variable name="condition" type="oui/non" description="No change"> <variable name="condition" type="oui/non" description="No change">
<value>non</value> <value>non</value>
</variable> </variable>
<variable name="mode_conteneur_actif" type="oui/non" description="No change" hidden="True"> <variable name="mode_conteneur_actif" type="oui/non" description="No change">
<value>non</value> <value>non</value>
</variable> </variable>
<variable name="mode_conteneur_actif2" type="oui/non" description="No change" hidden="True"> <variable name="mode_conteneur_actif2" type="oui/non" description="No change">
<value>non</value> <value>non</value>
</variable> </variable>
</family> </family>

View file

@ -15,8 +15,8 @@
<choice type="string">non</choice> <choice type="string">non</choice>
<property>mandatory</property> <property>mandatory</property>
<property>normal</property> <property>normal</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">hidden</property> <property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">hidden</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property> <property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property>
<value type="string">non</value> <value type="string">non</value>
</variable> </variable>
@ -25,8 +25,8 @@
<choice type="string">non</choice> <choice type="string">non</choice>
<property>mandatory</property> <property>mandatory</property>
<property>normal</property> <property>normal</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">hidden</property> <property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">hidden</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property> <property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property>
<value type="string">non</value> <value type="string">non</value>
</variable> </variable>

View file

@ -3,8 +3,8 @@ from rougail.tiramisu import ConvertDynOptionDescription
import imp import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py') func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='condition', default='non', values=('oui', 'non')) option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='condition', default='non', values=('oui', 'non'))
option_4 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non')) option_4 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non'))
option_5 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif2', default='non', values=('oui', 'non')) option_5 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif2', default='non', values=('oui', 'non'))
option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5]) option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2]) option_1 = OptionDescription(doc='rougail', name='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

@ -8,10 +8,10 @@
<variable name="condition" type="oui/non" description="No change"> <variable name="condition" type="oui/non" description="No change">
<value>non</value> <value>non</value>
</variable> </variable>
<variable name="mode_conteneur_actif" type="oui/non" description="No change" hidden="True"> <variable name="mode_conteneur_actif" type="oui/non" description="No change">
<value>non</value> <value>non</value>
</variable> </variable>
<variable name="mode_conteneur_actif2" type="oui/non" description="No change" hidden="True"> <variable name="mode_conteneur_actif2" type="oui/non" description="No change">
<value>non</value> <value>non</value>
</variable> </variable>
</family> </family>

View file

@ -15,8 +15,8 @@
<choice type="string">non</choice> <choice type="string">non</choice>
<property>mandatory</property> <property>mandatory</property>
<property>normal</property> <property>normal</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">hidden</property> <property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">hidden</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property> <property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property>
<value name="calc_val" type="calculation"> <value name="calc_val" type="calculation">
<param type="string">non</param> <param type="string">non</param>
@ -27,8 +27,8 @@
<choice type="string">non</choice> <choice type="string">non</choice>
<property>mandatory</property> <property>mandatory</property>
<property>normal</property> <property>normal</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">hidden</property> <property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">hidden</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property> <property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property>
<value type="string">non</value> <value type="string">non</value>
</variable> </variable>

View file

@ -3,8 +3,8 @@ from rougail.tiramisu import ConvertDynOptionDescription
import imp import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py') func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='condition', default='non', values=('oui', 'non')) option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='condition', default='non', values=('oui', 'non'))
option_4 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif', default=Calculation(func.calc_val, Params((ParamValue("non")), kwargs={})), values=('oui', 'non')) option_4 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif', default=Calculation(func.calc_val, Params((ParamValue("non")), kwargs={})), values=('oui', 'non'))
option_5 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif2', default='non', values=('oui', 'non')) option_5 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif2', default='non', values=('oui', 'non'))
option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5]) option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2]) option_1 = OptionDescription(doc='rougail', name='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

@ -8,10 +8,10 @@
<variable name="condition" type="string" description="No change"> <variable name="condition" type="string" description="No change">
<value>tous</value> <value>tous</value>
</variable> </variable>
<variable name="mode_conteneur_actif" type="oui/non" description="No change" hidden="True"> <variable name="mode_conteneur_actif" type="oui/non" description="No change">
<value>non</value> <value>non</value>
</variable> </variable>
<variable name="mode_conteneur_actif2" type="oui/non" description="No change" hidden="True"> <variable name="mode_conteneur_actif2" type="oui/non" description="No change">
<value>non</value> <value>non</value>
</variable> </variable>
</family> </family>

View file

@ -16,11 +16,11 @@
<choice type="string">non</choice> <choice type="string">non</choice>
<property>mandatory</property> <property>mandatory</property>
<property>normal</property> <property>normal</property>
<property expected="tous" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="tous" inverse="False" source="rougail.general.condition" type="calculation">hidden</property> <property expected="tous" inverse="False" source="rougail.general.condition" type="calculation">hidden</property>
<property expected="tous" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="tous" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property> <property expected="tous" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property>
<property expected="authentifié" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="authentifié" inverse="False" source="rougail.general.condition" type="calculation">hidden</property> <property expected="authentifié" inverse="False" source="rougail.general.condition" type="calculation">hidden</property>
<property expected="authentifié" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="authentifié" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property> <property expected="authentifié" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property>
<value type="string">non</value> <value type="string">non</value>
</variable> </variable>
@ -29,11 +29,11 @@
<choice type="string">non</choice> <choice type="string">non</choice>
<property>mandatory</property> <property>mandatory</property>
<property>normal</property> <property>normal</property>
<property expected="tous" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="tous" inverse="False" source="rougail.general.condition" type="calculation">hidden</property> <property expected="tous" inverse="False" source="rougail.general.condition" type="calculation">hidden</property>
<property expected="tous" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="tous" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property> <property expected="tous" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property>
<property expected="authentifié" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="authentifié" inverse="False" source="rougail.general.condition" type="calculation">hidden</property> <property expected="authentifié" inverse="False" source="rougail.general.condition" type="calculation">hidden</property>
<property expected="authentifié" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="authentifié" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property> <property expected="authentifié" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property>
<value type="string">non</value> <value type="string">non</value>
</variable> </variable>

View file

@ -3,8 +3,8 @@ from rougail.tiramisu import ConvertDynOptionDescription
import imp import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py') func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='condition', default='tous', values=('tous', 'authentifié', 'aucun')) option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='condition', default='tous', values=('tous', 'authentifié', 'aucun'))
option_4 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')})), Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')}))]), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non')) option_4 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')})), Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')}))]), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non'))
option_5 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')})), Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')}))]), doc='No change', multi=False, name='mode_conteneur_actif2', default='non', values=('oui', 'non')) option_5 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('tous')})), Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')})), Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('authentifié')}))]), doc='No change', multi=False, name='mode_conteneur_actif2', default='non', values=('oui', 'non'))
option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5]) option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2]) option_1 = OptionDescription(doc='rougail', name='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

@ -0,0 +1,39 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services/>
<variables>
<family name="Général">
<variable name="condition" type="oui/non" description="No change">
<value>non</value>
</variable>
<variable name="mode_conteneur_actif" type="oui/non" description="No change" >
<value>non</value>
</variable>
<variable name="mode_conteneur_actif2" type="oui/non" description="No change">
<value>non</value>
</variable>
</family>
<family name="Général2">
<variable name="mode_conteneur_actif3" type="oui/non" description="No change" hidden="True">
<value>non</value>
</variable>
</family>
<separators/>
</variables>
<constraints>
<condition name="hidden_if_in" source="condition">
<param>oui</param>
<target type="variable">mode_conteneur_actif</target>
<target type="variable">mode_conteneur_actif2</target>
<target type="family">Général2</target>
</condition>
</constraints>
<help/>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View file

@ -0,0 +1 @@
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", "rougail.general2.mode_conteneur_actif3": "non"}

View file

@ -0,0 +1,51 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<family doc="rougail" name="rougail">
<family doc="Général" name="general">
<property>normal</property>
<variable doc="No change" multi="False" name="condition" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">hidden</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">hidden</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property>
<value type="string">non</value>
</variable>
</family>
<family doc="Général2" name="general2">
<property>normal</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">hidden</property>
<variable doc="No change" multi="False" name="mode_conteneur_actif3" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>force_default_on_freeze</property>
<property>frozen</property>
<property>hidden</property>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">force_default_on_freeze</property>
<value type="string">non</value>
</variable>
</family>
</family>
</rougail>

View file

@ -0,0 +1,12 @@
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='condition', default='non', values=('oui', 'non'))
option_4 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non'))
option_5 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif2', default='non', values=('oui', 'non'))
option_2 = OptionDescription(doc='Général', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5])
option_7 = ChoiceOption(properties=frozenset(['force_default_on_freeze', 'frozen', 'hidden', 'mandatory', 'normal', Calculation(calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')})), Calculation(calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif3', default='non', values=('oui', 'non'))
option_6 = OptionDescription(doc='Général2', name='general2', properties=frozenset(['normal', Calculation(calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), children=[option_7])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2, option_6])
option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1])

View file

@ -8,10 +8,10 @@
<variable name="condition" type="oui/non" description="No change"> <variable name="condition" type="oui/non" description="No change">
<value>non</value> <value>non</value>
</variable> </variable>
<variable name="mode_conteneur_actif" type="oui/non" description="No change"> <variable name="mode_conteneur_actif" type="string" description="No change">
<value>non</value> <value>non</value>
</variable> </variable>
<variable name="mode_conteneur_actif2" type="oui/non" description="No change"> <variable name="mode_conteneur_actif2" type="string" description="No change">
<value>non</value> <value>non</value>
</variable> </variable>
</family> </family>

View file

@ -10,17 +10,13 @@
<property>normal</property> <property>normal</property>
<value type="string">non</value> <value type="string">non</value>
</variable> </variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice"> <variable doc="No change" multi="False" name="mode_conteneur_actif" type="string">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property> <property>mandatory</property>
<property>normal</property> <property>normal</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">mandatory</property> <property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">mandatory</property>
<value type="string">non</value> <value type="string">non</value>
</variable> </variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice"> <variable doc="No change" multi="False" name="mode_conteneur_actif2" type="string">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property> <property>mandatory</property>
<property>normal</property> <property>normal</property>
<property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">mandatory</property> <property expected="oui" inverse="False" source="rougail.general.condition" type="calculation">mandatory</property>

View file

@ -3,8 +3,8 @@ from rougail.tiramisu import ConvertDynOptionDescription
import imp import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py') func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='condition', default='non', values=('oui', 'non')) option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='condition', default='non', values=('oui', 'non'))
option_4 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('mandatory'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non')) option_4 = StrOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('mandatory'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif', default='non')
option_5 = ChoiceOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('mandatory'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif2', default='non', values=('oui', 'non')) option_5 = StrOption(properties=frozenset(['mandatory', 'normal', Calculation(calc_value, Params(ParamValue('mandatory'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui')}))]), doc='No change', multi=False, name='mode_conteneur_actif2', default='non')
option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5]) option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2]) option_1 = OptionDescription(doc='rougail', name='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,24 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services/>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="No change"/>
</family>
<separators/>
</variables>
<constraints>
<check name="valid_enum" target="mode_conteneur_actif">
<param>['a','b','c']</param>
<param name="checkval">True</param>
</check>
</constraints>
<help/>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View file

@ -1 +0,0 @@
{"rougail.general.mode_conteneur_actif": "a"}

View file

@ -1,16 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<family doc="rougail" name="rougail">
<family doc="general" name="general">
<property>normal</property>
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">a</choice>
<choice type="string">b</choice>
<choice type="string">c</choice>
<property>mandatory</property>
<property>normal</property>
<value type="string">a</value>
</variable>
</family>
</family>
</rougail>

View file

@ -1,8 +0,0 @@
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='mode_conteneur_actif', default='a', values=('a', 'b', 'c'))
option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2])
option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1])

View file

@ -25,7 +25,6 @@
</variable> </variable>
<variable doc="activate" multi="False" name="activate" type="boolean"> <variable doc="activate" multi="False" name="activate" type="boolean">
<property>disabled</property> <property>disabled</property>
<property expected="oui" inverse="True" source="rougail.general.mode_conteneur_actif2" type="calculation">disabled</property>
<value type="boolean">True</value> <value type="boolean">True</value>
</variable> </variable>
</family> </family>

View file

@ -13,7 +13,7 @@ option_12 = StrOption(properties=frozenset([]), doc='name', multi=False, name='n
option_13 = StrOption(properties=frozenset([]), doc='owner', multi=False, name='owner', default='root') option_13 = StrOption(properties=frozenset([]), doc='owner', multi=False, name='owner', default='root')
option_14 = StrOption(properties=frozenset([]), doc='source', multi=False, name='source', default='file') option_14 = StrOption(properties=frozenset([]), doc='source', multi=False, name='source', default='file')
option_15 = BoolOption(default=True, properties=frozenset([]), doc='templating', multi=False, name='templating') option_15 = BoolOption(default=True, properties=frozenset([]), doc='templating', multi=False, name='templating')
option_16 = BoolOption(default=True, properties=frozenset(['disabled', Calculation(calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_5, todict=True), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))]), doc='activate', multi=False, name='activate') option_16 = BoolOption(default=True, properties=frozenset(['disabled']), doc='activate', multi=False, name='activate')
option_9 = OptionDescription(doc='file', name='file', children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16]) option_9 = OptionDescription(doc='file', name='file', children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16])
option_8 = OptionDescription(name='files', doc='files', children=[option_9]) option_8 = OptionDescription(name='files', doc='files', children=[option_9])
option_7 = OptionDescription(doc='test', name='test', children=[option_8]) option_7 = OptionDescription(doc='test', name='test', children=[option_8])

View file

@ -1 +1 @@
{"rougail.general.mode_conteneur_actif": "non", "rougail.general.condition": "non", "services.test.files.file1.group": "root", "services.test.files.file1.mode": "0644", "services.test.files.file1.name": "/tmp/file1", "services.test.files.file1.owner": "root", "services.test.files.file1.source": "file1", "services.test.files.file1.templating": true, "services.test.files.file1.activate": false} {"rougail.general.mode_conteneur_actif": "non", "rougail.general.condition": "non", "services.test.files.file1.group": "root", "services.test.files.file1.mode": "0644", "services.test.files.file1.name": "/tmp/file1", "services.test.files.file1.owner": "root", "services.test.files.file1.source": "file1", "services.test.files.file1.templating": true}

View file

@ -24,7 +24,8 @@
<value type="boolean">True</value> <value type="boolean">True</value>
</variable> </variable>
<variable doc="activate" multi="False" name="activate" type="boolean"> <variable doc="activate" multi="False" name="activate" type="boolean">
<value type="boolean">False</value> <property>disabled</property>
<value type="boolean">True</value>
</variable> </variable>
</family> </family>
</family> </family>

View file

@ -12,7 +12,7 @@ option_11 = StrOption(properties=frozenset([]), doc='name', multi=False, name='n
option_12 = StrOption(properties=frozenset([]), doc='owner', multi=False, name='owner', default='root') option_12 = StrOption(properties=frozenset([]), doc='owner', multi=False, name='owner', default='root')
option_13 = StrOption(properties=frozenset([]), doc='source', multi=False, name='source', default='file1') option_13 = StrOption(properties=frozenset([]), doc='source', multi=False, name='source', default='file1')
option_14 = BoolOption(default=True, properties=frozenset([]), doc='templating', multi=False, name='templating') option_14 = BoolOption(default=True, properties=frozenset([]), doc='templating', multi=False, name='templating')
option_15 = BoolOption(default=False, properties=frozenset([]), doc='activate', multi=False, name='activate') option_15 = BoolOption(default=True, properties=frozenset(['disabled']), doc='activate', multi=False, name='activate')
option_8 = OptionDescription(doc='file1', name='file1', children=[option_9, option_10, option_11, option_12, option_13, option_14, option_15]) option_8 = OptionDescription(doc='file1', name='file1', children=[option_9, option_10, option_11, option_12, option_13, option_14, option_15])
option_7 = OptionDescription(name='files', doc='files', children=[option_8]) option_7 = OptionDescription(name='files', doc='files', children=[option_8])
option_6 = OptionDescription(doc='test', name='test', children=[option_7]) option_6 = OptionDescription(doc='test', name='test', children=[option_7])

View file

@ -15,6 +15,11 @@
<value>non</value> <value>non</value>
</variable> </variable>
</family> </family>
<family name="disabled_family">
<variable name="mode_conteneur_actif3" type="oui/non" description="No change">
<value>non</value>
</variable>
</family>
<separators/> <separators/>
</variables> </variables>
@ -23,6 +28,7 @@
<param>oui</param> <param>oui</param>
<target type="variable">mode_conteneur_actif1</target> <target type="variable">mode_conteneur_actif1</target>
<target type="variable" optional="True">mode_conteneur_actif2</target> <target type="variable" optional="True">mode_conteneur_actif2</target>
<target type="family">disabled_family</target>
</condition> </condition>
</constraints> </constraints>

View file

@ -27,5 +27,16 @@
<value type="string">non</value> <value type="string">non</value>
</variable> </variable>
</family> </family>
<family doc="disabled_family" name="disabled_family">
<property>disabled</property>
<property>normal</property>
<variable doc="No change" multi="False" name="mode_conteneur_actif3" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<value type="string">non</value>
</variable>
</family>
</family> </family>
</rougail> </rougail>

View file

@ -6,5 +6,7 @@ option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No c
option_4 = ChoiceOption(properties=frozenset(['disabled', 'mandatory', 'normal']), doc='No change', multi=False, name='mode_conteneur_actif1', default='non', values=('oui', 'non')) option_4 = ChoiceOption(properties=frozenset(['disabled', 'mandatory', 'normal']), doc='No change', multi=False, name='mode_conteneur_actif1', default='non', values=('oui', 'non'))
option_5 = ChoiceOption(properties=frozenset(['disabled', 'mandatory', 'normal']), doc='No change', multi=False, name='mode_conteneur_actif2', default='non', values=('oui', 'non')) option_5 = ChoiceOption(properties=frozenset(['disabled', 'mandatory', 'normal']), doc='No change', multi=False, name='mode_conteneur_actif2', default='non', values=('oui', 'non'))
option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5]) option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4, option_5])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2]) option_7 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='mode_conteneur_actif3', default='non', values=('oui', 'non'))
option_6 = OptionDescription(doc='disabled_family', name='disabled_family', properties=frozenset(['disabled', 'normal']), children=[option_7])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2, option_6])
option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1]) option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1])

View file

@ -0,0 +1,35 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services/>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="oui/non" description="No change">
<value>non</value>
</variable>
<variable name="mode_conteneur_actif1" type="oui/non" description="No change" multi="True">
<value>non</value>
</variable>
<variable name="mode_conteneur_actif2" type="oui/non" description="No change">
<value>non</value>
</variable>
</family>
<separators/>
</variables>
<constraints>
<condition fallback="True" name="hidden_if_in" source="condition">
<param>oui</param>
<target type="variable">mode_conteneur_actif1</target>
</condition>
<group leader="mode_conteneur_actif1">
<follower>mode_conteneur_actif2</follower>
</group>
</constraints>
<help/>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View file

@ -0,0 +1 @@
{"rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif1.mode_conteneur_actif1": ["non"], "rougail.general.mode_conteneur_actif1.mode_conteneur_actif2": ["non"]}

View file

@ -0,0 +1,36 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<family doc="rougail" name="rougail">
<family doc="general" name="general">
<property>normal</property>
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<value type="string">non</value>
</variable>
<leader doc="No change" name="mode_conteneur_actif1">
<property>hidden</property>
<property>normal</property>
<variable doc="No change" multi="True" name="mode_conteneur_actif1" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>force_default_on_freeze</property>
<property>frozen</property>
<property>mandatory</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>force_default_on_freeze</property>
<property>frozen</property>
<property>mandatory</property>
<property>normal</property>
<value type="string">non</value>
</variable>
</leader>
</family>
</family>
</rougail>

View file

@ -0,0 +1,11 @@
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = ChoiceOption(properties=frozenset(['mandatory', 'normal']), doc='No change', multi=False, name='mode_conteneur_actif', default='non', values=('oui', 'non'))
option_5 = ChoiceOption(properties=frozenset(['force_default_on_freeze', 'frozen', 'mandatory']), doc='No change', multi=True, name='mode_conteneur_actif1', default=['non'], values=('oui', 'non'))
option_6 = ChoiceOption(properties=frozenset(['force_default_on_freeze', 'frozen', 'mandatory', 'normal']), doc='No change', multi=True, name='mode_conteneur_actif2', default_multi='non', values=('oui', 'non'))
option_4 = Leadership(doc='No change', name='mode_conteneur_actif1', properties=frozenset(['hidden', 'normal']), children=[option_5, option_6])
option_2 = OptionDescription(doc='general', name='general', properties=frozenset(['normal']), children=[option_3, option_4])
option_1 = OptionDescription(doc='rougail', name='rougail', children=[option_2])
option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1])

View file

@ -11,7 +11,7 @@
<constraints> <constraints>
<fill name='calc_multi_condition' target='extra.ejabberd.day'> <fill name='calc_multi_condition' target='extra.ejabberd.day'>
<param>non</param> <param>non</param>
<param type='eole' name='condition_1' hidden='False'>activer_ejabberd</param> <param type='variable' name='condition_1'>activer_ejabberd</param>
<param name='match'>none</param> <param name='match'>none</param>
<param name='mismatch'>daily</param> <param name='mismatch'>daily</param>
</fill> </fill>

View file

@ -11,7 +11,7 @@
<constraints> <constraints>
<fill name='calc_multi_condition' target='extra1.external.description'> <fill name='calc_multi_condition' target='extra1.external.description'>
<param>non</param> <param>non</param>
<param type='eole' name='condition_1' hidden='False'>extra.ejabberd.day</param> <param type='variable' name='condition_1'>extra.ejabberd.day</param>
<param name='match'>none</param> <param name='match'>none</param>
<param name='mismatch'>daily</param> <param name='mismatch'>daily</param>
</fill> </fill>

View file

@ -1,22 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services/>
<variables>
<family name="général">
<variable name="mode_conteneur_actif" type="oui/non" description="No change" hidden="True">
<value>non</value>
</variable>
</family>
<separators/>
</variables>
<constraints>
</constraints>
<help/>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View file

@ -1,26 +0,0 @@
<rougail>
<family_action name="systeme"
description="Liste des actions pour gérer le système EOLE"
color="#ddc9e6"
image="system.svg">
<action type="form"
title="Reconfigure"
description="Reconfigurer le serveur"
image="backup.svg">
<input>Reconfigurer</input>
<profile>ead_admin</profile>
<ewtapp>ead</ewtapp>
<tag>reconfigure</tag>
</action>
</family_action>
<variables>
<family name="test">
<variable name="delay" type="number" description="délai en minutes avant lancement">
<value>0</value>
</variable>
</family>
</variables>
<constraints>
</constraints>
<help/>
</rougail>

View file

@ -1,22 +0,0 @@
<rougail>
<family_action name="systeme"
description="Liste des actions pour gérer le système EOLE"
color="#ddc9e6"
image="system.svg">
<action type="form"
title="Reconfigure2"
description="Reconfigurer le serveur2"
image="backup.svg">
<input>Reconfigurer2</input>
<profile>ead_admin</profile>
<ewtapp>ead</ewtapp>
<tag>reconfigure</tag>
</action>
</family_action>
<variables>
</variables>
<constraints>
</constraints>
<help/>
</rougail>

View file

@ -1,25 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services/>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="oui/non" description="No change" auto_save="True">
<value>non</value>
</variable>
</family>
<separators/>
</variables>
<constraints>
<auto name="calc_val" target="mode_conteneur_actif">
<param>value</param>
</auto>
</constraints>
<help/>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<rougail> <rougail>
<containers> <services>
<container name='test' id='23'> <service name='test'>
<file name='file_name' name_type="variable"/> <file name='file_name' file_type="variable"/>
</container> </service>
</containers> </services>
<variables> <variables>
<family name='général'> <family name='général'>
<variable name='mode_conteneur_actif' type='oui/non' description="No change" hidden="True"> <variable name='mode_conteneur_actif' type='oui/non' description="No change" hidden="True">

View file

@ -1,11 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<rougail> <rougail>
<containers> <services>
<container name="test" id="23"> <service name="test">
<file name="/etc/mailname"/> <file name="/etc/mailname"/>
</container> </service>
</containers> </services>
<variables> <variables>

View file

@ -1,10 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<rougail> <rougail>
<containers> <services>
<container name="test" id="23"> <service name="test">
<file name="/etc/mailname" source="mailname.new"/> <file name="/etc/mailname" source="mailname.new"/>
</container> </service>
</containers> </services>
</rougail> </rougail>
<!-- vim: ts=4 sw=4 expandtab <!-- vim: ts=4 sw=4 expandtab
--> -->

View file

@ -1,24 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services/>
<variables>
<family name="proxy authentifié">
<variable name="toto1" type="port" description="Port d'écoute du proxy" mode="expert">
</variable>
<variable name="toto2" type="port" description="Port d'écoute du proxy NTLM" mode="expert">
<value>3127</value>
</variable>
</family>
</variables>
<constraints>
<fill name="calc_multi_condition" target="toto1">
<param>non</param>
<param type="container" name="condition_3" hidden="False"/>
<param name="match">3128</param>
<param name="mismatch" type="variable" hidden="False">toto2</param>
</fill>
</constraints>
</rougail>

View file

@ -15,9 +15,9 @@
<constraints> <constraints>
<fill name="calc_multi_condition" target="toto1"> <fill name="calc_multi_condition" target="toto1">
<param>non</param> <param>non</param>
<param type="variable" name="condition_1" hidden="False"/> <param type="variable" name="condition_1" notraisepropertyerror="False"/>
<param name="match">3128</param> <param name="match">3128</param>
<param name="mismatch" type="variable" hidden="False">toto2</param> <param name="mismatch" type="variable" notraisepropertyerror="False">toto2</param>
</fill> </fill>
</constraints> </constraints>

View file

@ -15,9 +15,9 @@
<constraints> <constraints>
<fill name="calc_multi_condition" target="toto1"> <fill name="calc_multi_condition" target="toto1">
<param>non</param> <param>non</param>
<param type="number" name="condition_2" hidden="False"/> <param type="number" name="condition_2" notraisepropertyerror="False"/>
<param name="match">3128</param> <param name="match">3128</param>
<param name="mismatch" type="variable" hidden="False">toto2</param> <param name="mismatch" type="variable" notraisepropertyerror="False">toto2</param>
</fill> </fill>
</constraints> </constraints>

View file

@ -1,8 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<rougail> <rougail>
<services/>
<variables> <variables>
<family name="general"> <family name="general">
<variable name="mode_conteneur_actif" type="oui/non" description="No change" auto_freeze="True"> <variable name="mode_conteneur_actif" type="oui/non" description="No change" auto_freeze="True">
@ -11,15 +8,11 @@
</family> </family>
<separators/> <separators/>
</variables> </variables>
<constraints> <constraints>
<auto name="calc_val" target="mode_conteneur_actif"> <fill name="calc_val" target="mode_conteneur_actif">
<param>value</param> <param>value</param>
</auto> </fill>
</constraints> </constraints>
<help/>
</rougail> </rougail>
<!-- vim: ts=4 sw=4 expandtab <!-- vim: ts=4 sw=4 expandtab
--> -->

Some files were not shown because too many files have changed in this diff Show more