description in group

This commit is contained in:
Emmanuel Garette 2019-12-21 13:28:18 +01:00
parent 9ec8f881ab
commit 881b551f47
6 changed files with 67 additions and 2 deletions

View file

@ -215,6 +215,7 @@
<!ELEMENT group (slave+)>
<!ATTLIST group master CDATA #REQUIRED>
<!ATTLIST group description CDATA #IMPLIED>
<!ELEMENT param (#PCDATA)>
<!ATTLIST param type (string|eole|number|container|context|python) "string">

View file

@ -566,6 +566,10 @@ class SpaceAnnotator(object):
leader_space.variable = []
leader_space.name = leader_name
leader_space.hidden = variable.hidden
if hasattr(group, 'description'):
leader_space.doc = group.description
else:
leader_space.doc = variable.description
variable.hidden = None
self.paths.append('family', leader_path + '.' + leader_name, namespace, creoleobj=leader_space)
# manage leader's variable

View file

@ -513,8 +513,6 @@ class CreoleObjSpace(object):
for subspace in space:
if isinstance(subspace, self.Leadership):
_name = 'leader'
subspace.doc = subspace.variable[0].description
#subspace.doc = 'Leadership {}'.format(subspace.name)
else:
_name = name
if name in ['containers', 'variables', 'actions']:

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<creole>
<variables>
<family name='general'>
<variable name='mode_conteneur_actif' type='oui/non' description="No change">
<value>non</value>
</variable>
</family>
<family name='general1'>
<variable name='master' type='string' description="master" multi="True"/>
<variable name='slave1' type='string' description="slave1" multi="True"/>
<variable name='slave2' type='string' description="slave2" multi="True"/>
</family>
</variables>
<constraints>
<fill name='calc_val' target='slave1'>
<param name='valeur'>valfill</param>
</fill>
<fill name='calc_val' target='slave2'>
<param type='eole'>slave1</param>
</fill>
<group master='master' description="other description">
<slave>slave1</slave>
<slave>slave2</slave>
</group>
</constraints>
</creole>

View file

@ -0,0 +1 @@
{"creole.general.mode_conteneur_actif": "non", "creole.general1.master.master": [], "creole.general1.master.slave1": [], "creole.general1.master.slave2": []}

View file

@ -0,0 +1,34 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<family doc="" name="creole">
<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>
</family>
<family doc="general1" name="general1">
<property>normal</property>
<leader doc="other description" name="master">
<property>normal</property>
<variable doc="master" multi="True" name="master" type="string"/>
<variable doc="slave1" multi="True" name="slave1" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<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 transitive="False" type="eole">creole.general1.master.slave1</param>
</value>
</variable>
</leader>
</family>
</family>
</creole>