check without parameter

This commit is contained in:
Emmanuel Garette 2020-07-30 09:44:48 +02:00
parent 5f2d1b3eb7
commit 00a69e72a2
6 changed files with 35 additions and 1 deletions

View file

@ -642,8 +642,8 @@ class ConstraintAnnotator:
def check_replace_text(self):
for check_idx, check in enumerate(self.objectspace.space.constraints.check):
namespace = check.namespace
if hasattr(check, 'param'):
namespace = check.namespace
for idx, param in enumerate(check.param):
if param.type == 'variable':
param.text = self.objectspace.paths.get_variable_path(param.text, namespace)

View file

@ -0,0 +1,24 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services/>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="No change">
<value>b</value>
</variable>
<variable name="int" type="number" description="No change"/>
</family>
<separators/>
</variables>
<constraints>
<check name="valid_entier" target="int"/>
</constraints>
<help/>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View file

@ -0,0 +1 @@
{"rougail.general.mode_conteneur_actif": "b", "rougail.general.int": null}

View file

@ -0,0 +1,9 @@
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
import imp
func = imp.load_source('func', 'tests/flattener_dicos/../eosfunc/test.py')
option_3 = StrOption(properties=frozenset({'mandatory', 'normal'}), name='mode_conteneur_actif', doc='No change', multi=False, default='b')
option_4 = IntOption(properties=frozenset({'normal'}), validators=[Calculation(func.valid_entier, Params((ParamSelfOption()), kwargs={}), warnings_only=False)], name='int', doc='No change', multi=False)
option_2 = OptionDescription(name='general', doc='general', properties=frozenset({'normal'}), children=[option_3, option_4])
option_1 = OptionDescription(name='rougail', doc='rougail', children=[option_2])
option_0 = OptionDescription(name='baseoption', doc='baseoption', children=[option_1])