condition and check in makedict

This commit is contained in:
Emmanuel Garette 2019-11-27 15:03:05 +01:00
parent 4c84a8b89b
commit 5e3ff68325
45 changed files with 149 additions and 207 deletions

View File

@ -52,7 +52,8 @@ modes = mode_factory()
# a CreoleObjSpace's attribute has some annotations
# that shall not be present in the exported (flatened) XML
ERASED_ATTRIBUTES = ('redefine', 'exists', 'fallback', 'optional', 'remove_check', 'namespace',
'remove_condition', 'path', 'instance_mode', 'index', 'is_in_leadership') # , '_real_container')
'remove_condition', 'path', 'instance_mode', 'index', 'is_in_leadership',
'level') # , '_real_container')
ERASED_CONTAINER_ATTRIBUTES = ('id', 'container', 'group_id', 'group', 'container_group')
NOT_NEED_ACTIVATE = ('disknod',)
@ -1036,13 +1037,11 @@ class SpaceAnnotator(object):
else:
check.warnings_only = False
check.level = None
transitive = True
if hasattr(check, 'param'):
for param in check.param:
if not param.hidden is True:
transitive = False
check.transitive = False
param.hidden = None
check.transitive = transitive
if not self.space.constraints.check:
del self.space.constraints.check
@ -1054,7 +1053,6 @@ class SpaceAnnotator(object):
for check in self.space.constraints.check:
variable = self.paths.get_variable_obj(check.target)
check_ = self.objectspace.check()
check_.type = 'calculation'
name = check.name
if name == 'valid_differ':
name = 'valid_not_equal'
@ -1077,7 +1075,6 @@ class SpaceAnnotator(object):
raise CreoleLoaderError(_('{} must have {} param').format(name, params_len))
check_.name = name
check_.warnings_only = check.warnings_only
check_.transitive = check.transitive
if hasattr(check, 'param'):
check_.param = check.param
if not hasattr(variable, 'check'):
@ -1160,6 +1157,10 @@ class SpaceAnnotator(object):
value.type = 'calculation'
value.name = fill.name
if hasattr(fill, 'param'):
for param in fill.param:
if param.hidden is True:
param.transitive = False
param.hidden = None
value.param = fill.param
if not hasattr(variable, 'value'):
variable.value = []

View File

@ -81,14 +81,10 @@ CONVERT_OPTION = {'number': dict(opttype=IntOption),
'hostname_strict': dict(opttype=DomainnameOption, initkwargs={'type': 'hostname', 'allow_ip': False}),
'web_address': dict(opttype=URLOption, initkwargs={'allow_ip': True, 'allow_without_dot': True}),
'port': dict(opttype=PortOption, initkwargs={'allow_private': True}),
'mac': dict(opttype=MACOption) # FIXME YO
'mac': dict(opttype=MACOption)
}
# FIXME help
REMOVED_ATTRIB = ['path', 'type']
class Elt(object):
def __init__(self, attrib):
self.attrib = attrib
@ -215,7 +211,7 @@ class PopulateTiramisuObjects(object):
subpath = self._build_path(subpath, child)
for c in child:
self._iter_family(c, family, subpath=subpath)
if child.tag == 'leader':
elif child.tag == 'leader':
leader = self._iter_leader(child, subpath)
family.add(leader)
elif child.tag == 'separators':
@ -235,6 +231,8 @@ class PopulateTiramisuObjects(object):
family.add(variable)
elif child.tag == 'property':
self._parse_properties(family, child)
else:
raise Exception('unknown tag {}'.format(child.tag))
def _parse_properties(self, family, child):
if child.get('type') == 'calculation':
@ -302,14 +300,6 @@ class ElementStorage:
elt = self.get(path)
elt.add_information(name, information)
def add_consistency(self, path, consistence, variables, warnings_only, transitive):
elt = self.get(path)
elt.add_consistency(consistence, variables, warnings_only, transitive)
def add_requires(self, path, requires):
elt = self.get(path)
elt.add_requires(requires)
def get(self, path):
if path not in self.paths:
raise CreoleLoaderError(_('there is no element for path {}').format(path))
@ -337,17 +327,11 @@ class Variable(Common):
self.option = None
self.informations = {}
self.attrib = {}
self.requires = []
self.consistencies = []
self.attrib['properties'] = []
self.attrib['validators'] = []
self.eosfunc = eosfunc
self.storage = storage
for key, value in elt.attrib.items():
if key in REMOVED_ATTRIB:
continue
#if key != 'name':
# value = unicode(value)
if key in booleans:
if value == 'True':
value = True
@ -357,6 +341,8 @@ class Variable(Common):
raise CreoleLoaderError(_('unknown value {} for {}').format(value, key))
if key == 'help':
self.add_information(key, value)
elif key == 'type':
pass
else:
self.attrib[key] = value
convert_option = CONVERT_OPTION[elt.attrib['type']]
@ -393,7 +379,7 @@ class Variable(Common):
params = []
for param in child:
params.append(self.parse_param(param))
self.attrib['default'] = (child.attrib['name'], params)
self.attrib['default'] = (child.attrib['name'], params, False)
else:
if "type" in child.attrib:
type_ = CONVERT_OPTION[child.attrib['type']]['opttype']
@ -417,6 +403,17 @@ class Variable(Common):
self.attrib['default_multi'] = value
else:
self.attrib['default'] = value
elif child.tag == 'choice':
# already load
pass
elif child.tag == 'check':
params = []
for param in child:
params.append(self.parse_param(param))
#check.params = params
self.attrib['validators'].append((child.attrib['name'], params, child.attrib['warnings_only']))
else:
raise Exception('unknown tag {}'.format(child.tag))
if 'initkwargs' in convert_option:
self.attrib.update(convert_option['initkwargs'])
if elt.attrib['type'] == 'symlink':
@ -429,14 +426,14 @@ class Variable(Common):
if param.attrib['type'] == 'string':
value = param.text
elif param.attrib['type'] == 'eole':
hidden = param.attrib['hidden']
if hidden == 'True':
hidden = False
elif hidden == 'False':
hidden = True
transitive = param.attrib.get('transitive', 'False')
if transitive == 'True':
transitive = True
elif transitive == 'False':
transitive = False
else:
raise CreoleLoaderError(_('unknown hidden boolean {}').format(hidden))
value = [param.text, hidden]
raise CreoleLoaderError(_('unknown transitive boolean {}').format(transitive))
value = [param.text, transitive]
elif param.attrib['type'] == 'number':
value = int(param.text)
else:
@ -448,68 +445,40 @@ class Variable(Common):
raise CreoleLoaderError(_('key already exists in information {}').format(key))
self.informations[key] = value
def add_requires(self, requires):
self.requires.extend(requires)
def add_consistency(self, consistence, variables, warnings_only, transitive):
self.consistencies.append((consistence, variables, warnings_only, transitive))
def build_params(self, params):
if params != None:
new_params = Params()
for key, values in params.items():
new_values = []
def build_calculator(self, key):
if key in self.attrib:
values = self.attrib[key]
if isinstance(values, list):
is_list = True
else:
is_list = False
values = [values]
ret = []
for value in values:
if isinstance(value, list):
# retrieve object
value = ParamOption(value[0].get(), value[1])
elif value == (None,):
value = ParamContext()
else:
value = ParamValue(value)
if key == '':
args = list(new_params.args)
args.append(value)
new_params.args = tuple(args)
else:
new_params.kwargs[key] = value
return new_params
return params
def build_default(self):
if 'default' in self.attrib:
default = self.attrib['default']
if isinstance(default, tuple):
#('calc_val', [('', ['creole.general.mode_conteneur_actif1', False])])
if isinstance(value, tuple):
args = []
kwargs = {}
if len(default) == 2:
for param in default[1]:
if len(value) == 3:
for param in value[1]:
if isinstance(param[1], list):
value = ParamOption(self.storage.get(param[1][0]).get(), notraisepropertyerror=param[1][1])
param_value = ParamOption(self.storage.get(param[1][0]).get(), notraisepropertyerror=param[1][1])
else:
value = ParamValue(param[1])
param_value = ParamValue(param[1])
if not param[0]:
args.append(value)
args.append(param_value)
else:
kwargs[param[0]] = value
kwargs[param[0]] = param_value
self.attrib['default'] = Calculation(getattr(self.eosfunc, default[0]),
ret.append(Calculation(getattr(self.eosfunc, value[0]),
Params(tuple(args),
kwargs=kwargs))
#for index, obj in enumerate(self.attrib.get('values', [])):
# print(obj)
#if isinstance(prop, tuple):
# action, kwargs = prop
# kwargs['condition'] = ParamOption(self.storage.get(kwargs['condition']).get(), todict=True)
# prop = Calculation(calc_value,
# Params(action,
# kwargs=kwargs))
# self.attrib['properties'][index] = prop
#if self.attrib['properties']:
# self.attrib['properties'] = tuple(self.attrib['properties'])
#else:
# del self.attrib['properties']
kwargs=kwargs)))
else:
ret.append(value)
if not is_list:
self.attrib[key] = ret[0]
else:
self.attrib[key] = ret
def get(self):
if self.option is None:
@ -517,19 +486,12 @@ class Variable(Common):
self.attrib['opt'] = self.attrib['opt'].get()
else:
self.build_properties()
self.build_default()
#for callback, callback_params in self.callbacks:
# self.attrib['callback'] = callback
# self.attrib['callback_params'] = self.build_params(callback_params)
#for require in self.requires:
# if isinstance(require['option'], Variable):
# require['option'] = require['option'].get()
#if self.requires != []:
# self.attrib['requires'] = self.requires
#if self.validator:
# self.attrib['validator'] = self.validator[0]
# self.attrib['validator_params'] = self.build_params(self.validator[1])
self.build_calculator('default')
self.build_calculator('validators')
if not self.attrib['validators']:
del self.attrib['validators']
try:
print(self.attrib)
option = self.object_type(**self.attrib)
except Exception as err:
import traceback
@ -538,27 +500,12 @@ class Variable(Common):
raise CreoleLoaderError(_('cannot create option {}: {}').format(name, err))
for key, value in self.informations.items():
option.impl_set_information(key, value)
#for consistency in self.consistencies:
# options = []
# for variable in consistency[1]:
# options.append(variable.get())
# try:
# kwargs = {}
# if consistency[2] == 'True':
# kwargs['warnings_only'] = True
# if consistency[3] == 'False':
# kwargs['transitive'] = False
# option.impl_add_consistency(consistency[0], *options, **kwargs)
# except ConfigError as err:
# name = self.attrib['name']
# raise CreoleLoaderError(_('cannot load consistency for {}: {}').format(name, err))
self.option = option
return self.option
class Family(Common):
def __init__(self, elt, booleans, storage, force_icon=False):
self.requires = []
self.option = None
self.attrib = {}
self.is_leader = False
@ -570,8 +517,6 @@ class Family(Common):
self.storage = storage
self.attrib['properties'] = []
for key, value in elt.attrib.items():
if key in REMOVED_ATTRIB:
continue
if key in booleans:
if value == 'True':
value = True
@ -589,6 +534,8 @@ class Family(Common):
self.attrib['properties'].append(value)
elif key == 'help':
self.add_information(key, value)
elif key == 'type':
pass
else:
self.attrib[key] = value
if 'doc' not in self.attrib:
@ -605,19 +552,11 @@ class Family(Common):
def set_leader(self):
self.is_leader = True
def add_requires(self, requires):
self.requires.extend(requires)
def get(self):
if self.option is None:
self.attrib['children'] = []
for child in self.children:
self.attrib['children'].append(child.get())
for require in self.requires:
if isinstance(require['option'], Variable):
require['option'] = require['option'].get()
if self.requires != []:
self.attrib['requires'] = self.requires
self.build_properties()
try:
if not self.is_leader:

View File

@ -1,3 +1,5 @@
from tiramisu import valid_not_equal, valid_ip_netmask
def calc_val(*args, **kwargs):
pass

View File

@ -12,7 +12,7 @@
<property>mandatory</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
<param transitive="False" type="eole">creole.general.mode_conteneur_actif1</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">

View File

@ -12,7 +12,7 @@
<property>basic</property>
<property expected="oui" inverse="True" source="creole.general.module_instancie" type="calculation">auto_frozen</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
<param transitive="False" type="eole">creole.general.mode_conteneur_actif1</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">

View File

@ -10,7 +10,7 @@
<property>mandatory</property>
<property>basic</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
<param transitive="False" type="eole">creole.general.mode_conteneur_actif1</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">

View File

@ -12,7 +12,7 @@
<property>mandatory</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
<param transitive="False" type="eole">creole.general.mode_conteneur_actif1</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">

View File

@ -12,7 +12,7 @@
<property>mandatory</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
<param transitive="False" type="eole">creole.general.mode_conteneur_actif1</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">

View File

@ -7,7 +7,7 @@
<property>mandatory</property>
<property>expert</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
<param transitive="False" type="eole">creole.general.mode_conteneur_actif1</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">

View File

@ -9,7 +9,7 @@
<property>hidden</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="number">3</param>
<param transitive="False" type="number">3</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">

View File

@ -12,7 +12,7 @@
<property>mandatory</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
<param transitive="False" type="eole">creole.general.mode_conteneur_actif1</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">

View File

@ -19,7 +19,7 @@
<property>hidden</property>
<property>basic</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="string">oui</param>
<param transitive="False" type="string">oui</param>
</value>
</variable>
</family>

View File

@ -20,7 +20,7 @@
<property expected="oui" inverse="False" source="creole.general.mode_conteneur_actif" type="calculation">hidden</property>
<property expected="oui" inverse="False" source="creole.general.mode_conteneur_actif" type="calculation">force_default_on_freeze</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="string">oui</param>
<param transitive="False" type="string">oui</param>
</value>
</variable>
</family>

View File

@ -9,7 +9,7 @@
<value>b</value>
</variable>
<variable doc="No change" multi="False" name="int" type="number">
<check level="error" name="valid_entier" transitive="True" type="calculation" warnings_only="False">
<check name="valid_entier" warnings_only="False">
<param name="mini" type="string">0</param>
<param name="maxi" type="string">100</param>
</check>

View File

@ -14,7 +14,7 @@
<value>100</value>
</variable>
<variable doc="No change" multi="False" name="int" type="number">
<check level="error" name="valid_entier" transitive="True" type="calculation" warnings_only="False">
<check name="valid_entier" warnings_only="False">
<param name="mini" type="string">0</param>
<param name="maxi" type="eole">creole.general.int2</param>
</check>

View File

@ -9,10 +9,10 @@
<value>b</value>
</variable>
<variable doc="No change" multi="False" name="int" type="number">
<check level="error" name="valid_not_equal" transitive="True" type="calculation" warnings_only="False">
<check name="valid_not_equal" warnings_only="False">
<param type="eole">creole.general.int2</param>
</check>
<check level="error" name="valid_not_equal" transitive="True" type="calculation" warnings_only="False"/>
<check name="valid_not_equal" warnings_only="False"/>
<property>normal</property>
</variable>
<variable doc="No change" multi="False" name="int2" type="number">

View File

@ -4,7 +4,7 @@
<family doc="general" name="general">
<property>normal</property>
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<check level="error" name="valid_not_equal" transitive="True" type="calculation" warnings_only="False">
<check name="valid_not_equal" warnings_only="False">
<param type="eole">creole.general.mode_conteneur_actif1</param>
</check>
<choice type="string">oui</choice>

View File

@ -25,16 +25,16 @@
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif3" type="string">
<check level="error" name="valid_not_equal" transitive="True" type="calculation" warnings_only="False">
<check name="valid_not_equal" warnings_only="False">
<param type="eole">creole.general.mode_conteneur_actif1</param>
</check>
<check level="error" name="valid_not_equal" transitive="True" type="calculation" warnings_only="False">
<check name="valid_not_equal" warnings_only="False">
<param type="eole">creole.general.mode_conteneur_actif2</param>
</check>
<check level="error" name="valid_not_equal" transitive="True" type="calculation" warnings_only="False">
<check name="valid_not_equal" warnings_only="False">
<param type="eole">creole.general.mode_conteneur_actif1</param>
</check>
<check level="error" name="valid_not_equal" transitive="True" type="calculation" warnings_only="False">
<check name="valid_not_equal" warnings_only="False">
<param type="eole">creole.general.mode_conteneur_actif2</param>
</check>
<property>mandatory</property>

View File

@ -25,10 +25,10 @@
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif3" type="string">
<check level="error" name="valid_not_equal" transitive="True" type="calculation" warnings_only="False">
<check name="valid_not_equal" warnings_only="False">
<param type="eole">creole.general.mode_conteneur_actif1</param>
</check>
<check level="error" name="valid_not_equal" transitive="True" type="calculation" warnings_only="False">
<check name="valid_not_equal" warnings_only="False">
<param type="eole">creole.general.mode_conteneur_actif2</param>
</check>
<property>mandatory</property>

View File

@ -15,7 +15,7 @@
<property>basic</property>
</variable>
<variable doc="Masque de sous réseau de la carte" multi="False" name="adresse_netmask_eth0" type="netmask">
<check level="error" name="valid_ip_netmask" transitive="True" type="calculation" warnings_only="True">
<check name="valid_ip_netmask" warnings_only="True">
<param type="eole">creole.general.adresse_ip_eth0</param>
</check>
<property>mandatory</property>

View File

@ -19,7 +19,7 @@
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">hidden</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">force_default_on_freeze</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="string">non</param>
<param transitive="False" type="string">non</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice">

View File

@ -19,13 +19,13 @@
<variable doc="slave1" multi="True" name="slave1" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" name="valeur" type="string">valfill</param>
<param name="valeur" transitive="False" type="string">valfill</param>
</value>
</variable>
<variable doc="slave2" multi="True" name="slave2" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general1.master.slave1</param>
<param transitive="False" type="eole">creole.general1.master.slave1</param>
</value>
</variable>
</leader>

View File

@ -16,13 +16,13 @@
<variable doc="slave1" multi="True" name="slave1" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" name="valeur" type="string">valfill</param>
<param name="valeur" transitive="False" type="string">valfill</param>
</value>
</variable>
<variable doc="slave2" multi="True" name="slave2" type="string">
<property>expert</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.master.slave1</param>
<param transitive="False" type="eole">creole.general.master.slave1</param>
</value>
</variable>
</leader>

View File

@ -17,13 +17,13 @@
<property>mandatory</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" name="valeur" type="string">valfill</param>
<param name="valeur" transitive="False" type="string">valfill</param>
</value>
</variable>
<variable doc="slave2" multi="True" name="slave2" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.master.slave1</param>
<param transitive="False" type="eole">creole.general.master.slave1</param>
</value>
</variable>
</leader>

View File

@ -18,13 +18,13 @@
<variable doc="slave1" multi="True" name="slave1" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" name="valeur" type="string">valfill</param>
<param name="valeur" transitive="False" type="string">valfill</param>
</value>
</variable>
<variable doc="slave2" multi="True" name="slave2" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.master.slave1</param>
<param transitive="False" type="eole">creole.general.master.slave1</param>
</value>
</variable>
</leader>

View File

@ -19,13 +19,13 @@
<variable doc="slave1" multi="True" name="slave1" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" name="valeur" type="string">valfill</param>
<param name="valeur" transitive="False" type="string">valfill</param>
</value>
</variable>
<variable doc="slave2" multi="True" name="slave2" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general1.master.slave1</param>
<param transitive="False" type="eole">creole.general1.master.slave1</param>
</value>
</variable>
</leader>

View File

@ -19,13 +19,13 @@
<variable doc="slave1" multi="True" name="slave1" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" name="valeur" type="string">valfill</param>
<param name="valeur" transitive="False" type="string">valfill</param>
</value>
</variable>
<variable doc="slave2" multi="True" name="slave2" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general1.master.slave1</param>
<param transitive="False" type="eole">creole.general1.master.slave1</param>
</value>
</variable>
<variable doc="slave3" multi="True" name="slave3" type="string">

View File

@ -19,7 +19,7 @@
<property>hidden</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" name="valeur" type="string">valfill</param>
<param name="valeur" transitive="False" type="string">valfill</param>
</value>
</variable>
<variable doc="slave2" multi="True" name="slave2" type="string">
@ -28,7 +28,7 @@
<property>hidden</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.master.slave1</param>
<param transitive="False" type="eole">creole.general.master.slave1</param>
</value>
</variable>
<variable doc="slave3" multi="True" name="slave3" type="string">
@ -37,7 +37,7 @@
<property>hidden</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.master.master</param>
<param transitive="False" type="eole">creole.general.master.master</param>
</value>
</variable>
</leader>

View File

@ -19,7 +19,7 @@
<property>hidden</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" name="valeur" type="string">valfill</param>
<param name="valeur" transitive="False" type="string">valfill</param>
</value>
</variable>
<variable doc="slave2" multi="True" name="slave2" type="string">
@ -28,7 +28,7 @@
<property>hidden</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.master.master</param>
<param transitive="False" type="eole">creole.general.master.master</param>
</value>
</variable>
</leader>

View File

@ -20,7 +20,7 @@
<property>force_default_on_freeze</property>
<property>frozen</property>
<value name="calc_val" type="calculation">
<param hidden="True" name="valeur" type="string">valfill</param>
<param name="valeur" transitive="False" type="string">valfill</param>
</value>
</variable>
<variable doc="slave1" multi="True" name="slave1" type="string">

View File

@ -16,13 +16,13 @@
<variable doc="slave1" multi="True" name="slave1" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" name="valeur" type="string">valfill</param>
<param name="valeur" transitive="False" type="string">valfill</param>
</value>
</variable>
<variable doc="slave2" multi="True" name="slave2" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.master.slave1</param>
<param transitive="False" type="eole">creole.general.master.slave1</param>
</value>
</variable>
</leader>

View File

@ -9,7 +9,7 @@
<property>hidden</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="string">value</param>
<param transitive="False" type="string">value</param>
</value>
</variable>
</family>

View File

@ -6,7 +6,7 @@
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="string">value</param>
<param transitive="False" type="string">value</param>
</value>
</variable>
</family>

View File

@ -27,7 +27,7 @@
<property>normal</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">disabled</property>
<value name="calc_val" type="calculation">
<param hidden="True" name="valeur" type="string">valfill</param>
<param name="valeur" transitive="False" type="string">valfill</param>
</value>
</variable>
<variable doc="slave2" multi="True" name="slave2" type="string">

View File

@ -12,7 +12,7 @@
<property>mandatory</property>
<property>normal</property>
<value name="concat" type="calculation">
<param hidden="True" name="valeur" type="string">non</param>
<param name="valeur" transitive="False" type="string">non</param>
</value>
</variable>
</family>

View File

@ -9,7 +9,7 @@
<property>mandatory</property>
<property>normal</property>
<value name="concat" type="calculation">
<param hidden="True" name="valeur" type="string">non</param>
<param name="valeur" transitive="False" type="string">non</param>
</value>
</variable>
</family>

View File

@ -12,7 +12,7 @@
<property>mandatory</property>
<property>normal</property>
<value name="concat" type="calculation">
<param hidden="True" name="valeur" type="string">non</param>
<param name="valeur" transitive="False" type="string">non</param>
</value>
</variable>
</family>

View File

@ -12,7 +12,7 @@
<property>mandatory</property>
<property>normal</property>
<value name="concat" type="calculation">
<param hidden="True" name="valeur" type="string">non</param>
<param name="valeur" transitive="False" type="string">non</param>
</value>
</variable>
</family>

View File

@ -87,7 +87,7 @@
<property>hidden</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="string">http://localhost/</param>
<param transitive="False" type="string">http://localhost/</param>
</value>
</variable>
</family>

View File

@ -42,10 +42,10 @@
<property>mandatory</property>
<property>normal</property>
<value name="calc_multi_condition" type="calculation">
<param hidden="True" type="string">non</param>
<param hidden="False" name="condition_1" type="eole">creole.general.activer_ejabberd</param>
<param hidden="True" name="match" type="string">none</param>
<param hidden="True" name="mismatch" type="string">daily</param>
<param transitive="False" type="string">non</param>
<param name="condition_1" type="eole">creole.general.activer_ejabberd</param>
<param name="match" transitive="False" type="string">none</param>
<param name="mismatch" transitive="False" type="string">daily</param>
</value>
</variable>
<variable doc="mode" multi="False" name="mode" type="choice">

View File

@ -42,10 +42,10 @@
<property>mandatory</property>
<property>normal</property>
<value name="calc_multi_condition" type="calculation">
<param hidden="True" type="string">non</param>
<param hidden="False" name="condition_1" type="eole">creole.general.activer_ejabberd</param>
<param hidden="True" name="match" type="string">none</param>
<param hidden="True" name="mismatch" type="string">daily</param>
<param transitive="False" type="string">non</param>
<param name="condition_1" type="eole">creole.general.activer_ejabberd</param>
<param name="match" transitive="False" type="string">none</param>
<param name="mismatch" transitive="False" type="string">daily</param>
</value>
</variable>
<variable doc="mode" multi="False" name="mode" type="choice">

View File

@ -42,10 +42,10 @@
<property>mandatory</property>
<property>normal</property>
<value name="calc_multi_condition" type="calculation">
<param hidden="True" type="string">non</param>
<param hidden="False" name="condition_1" type="eole">creole.general.activer_ejabberd</param>
<param hidden="True" name="match" type="string">none</param>
<param hidden="True" name="mismatch" type="string">daily</param>
<param transitive="False" type="string">non</param>
<param name="condition_1" type="eole">creole.general.activer_ejabberd</param>
<param name="match" transitive="False" type="string">none</param>
<param name="mismatch" transitive="False" type="string">daily</param>
</value>
</variable>
<variable doc="mode" multi="False" name="mode" type="choice">

View File

@ -45,10 +45,10 @@
<property>mandatory</property>
<property>normal</property>
<value name="calc_multi_condition" type="calculation">
<param hidden="True" type="string">non</param>
<param hidden="False" name="condition_1" type="eole">creole.general.activer_ejabberd</param>
<param hidden="True" name="match" type="string">none</param>
<param hidden="True" name="mismatch" type="string">daily</param>
<param transitive="False" type="string">non</param>
<param name="condition_1" type="eole">creole.general.activer_ejabberd</param>
<param name="match" transitive="False" type="string">none</param>
<param name="mismatch" transitive="False" type="string">daily</param>
</value>
</variable>
<variable doc="mode" multi="False" name="mode" type="choice">

View File

@ -9,8 +9,8 @@
<property>frozen</property>
<property>hidden</property>
<value name="cdrom_minormajor" type="calculation">
<param hidden="True" type="string">major</param>
<param hidden="True" type="string">/etc/mailname'</param>
<param transitive="False" type="string">major</param>
<param transitive="False" type="string">/etc/mailname'</param>
</value>
</variable>
<variable doc="" multi="False" name="minor" type="number">
@ -18,8 +18,8 @@
<property>frozen</property>
<property>hidden</property>
<value name="cdrom_minormajor" type="calculation">
<param hidden="True" type="string">minor</param>
<param hidden="True" type="string">/etc/mailname'</param>
<param transitive="False" type="string">minor</param>
<param transitive="False" type="string">/etc/mailname'</param>
</value>
</variable>
<variable doc="" multi="False" name="mode" type="string">
@ -36,7 +36,7 @@
<property>frozen</property>
<property>hidden</property>
<value name="device_type" type="calculation">
<param hidden="True" type="string">/etc/mailname'</param>
<param transitive="False" type="string">/etc/mailname'</param>
</value>
</variable>
</family>

View File

@ -30,8 +30,8 @@ for test in listdir(dico_dirs):
excludes = set([])
test_ok -= excludes
test_raise -= excludes
# test_ok = ['10check_base']
# test_raise = []
#test_ok = ['10autosave_hidden']
#test_raise = []
test_ok = list(test_ok)
@ -85,7 +85,7 @@ def launch_flattener(test_dir):
eolobj.save(destfile)
result_file = join(test_dir, 'result/00-base.xml')
if isfile(result_file):
eolobj.save(result_file)
# eolobj.save(result_file)
compare_xml(destfile, result_file)