correction in example

This commit is contained in:
Emmanuel Garette 2021-01-30 15:24:47 +01:00
parent 1dcdbd474d
commit d78855e70a
3 changed files with 28 additions and 21 deletions

View File

@ -1,30 +1,26 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<rougail> <rougail>
<services>
<service name="test">
<file name="/tmp/file1" filelist="afilllist"/>
</service>
</services>
<variables> <variables>
<family name="general"> <family name="general">
<variable name="condition" type="string" description="No change"> <variable name="condition" type="string" description="No change">
<value>non</value> <value>no</value>
</variable> </variable>
<variable name="mode_conteneur_actif" type="string" description="No change"> <variable name="disable_variable" type="string" description="No change">
<value>non</value> <value>no</value>
</variable>
<variable name="mode_conteneur_actif2" type="string" description="No change">
<value>non</value>
</variable> </variable>
</family> </family>
</variables> </variables>
<constraints> <constraints>
<condition name="disabled_if_not_in" source="condition"> <condition name="disabled_if_not_in" source="unknown" fallback="True">
<param>oui</param> <param>no</param>
<target type="variable">mode_conteneur_actif</target> <target type="variable">disable_variable</target>
<target type="variable">mode_conteneur_actif2</target>
<target type="filelist">afilllist</target> <target type="filelist">afilllist</target>
</condition> </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> </constraints>
</rougail> </rougail>
<!-- vim: ts=4 sw=4 expandtab <!-- vim: ts=4 sw=4 expandtab

View File

@ -1 +1 @@
{"rougail.general.condition": "non"} {"rougail.general.condition": "no", "rougail.general.disable_variable": "no", "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": true}

View File

@ -12,9 +12,20 @@ try:
except: except:
from tiramisu import * from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) option_3 = StrOption(name="condition", doc="No change", default="no", properties=frozenset({"mandatory", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))})) option_4 = StrOption(name="disable_variable", doc="No change", default="no", properties=frozenset({"mandatory", "normal"}))
option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue('oui'), 'reverse_condition': ParamValue(True)}))})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) option_9 = StrOption(name="group", doc="group", default="root")
option_10 = StrOption(name="mode", doc="mode", default="0644")
option_11 = StrOption(name="name", doc="name", default="/tmp/file1")
option_12 = StrOption(name="owner", doc="owner", default="root")
option_13 = StrOption(name="source", doc="source", default="file1")
option_14 = BoolOption(name="templating", doc="templating", default=True)
option_15 = BoolOption(name="activate", doc="activate", default=True)
option_8 = OptionDescription(name="file1", doc="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_6 = OptionDescription(name="test", doc="test", children=[option_7])
option_6.impl_set_information('manage', True)
option_5 = OptionDescription(name="services", doc="services", children=[option_6], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5])