refactor + test
This commit is contained in:
parent
69d590d205
commit
d4e80197ca
103 changed files with 915 additions and 88 deletions
|
@ -66,46 +66,34 @@ class Annotator(Walk): # pylint: disable=R0903
|
|||
if variable.type == "boolean" and multi is False and variable.default is None:
|
||||
variable.default = True
|
||||
|
||||
if variable.default is None:
|
||||
if variable.default is None or isinstance(variable.default, Calculation):
|
||||
return
|
||||
has_value = False
|
||||
if isinstance(variable.default, Calculation):
|
||||
pass
|
||||
# variable.default = variable.default.to_function(self.functions)
|
||||
elif isinstance(variable.default, list):
|
||||
if not multi and variable.version == "1.0":
|
||||
raise Exception(
|
||||
f'The variable "{variable.path}" with a list as default value must have "multi" attribute'
|
||||
|
||||
if isinstance(variable.default, list):
|
||||
if not multi:
|
||||
msg = f'The variable "{variable.path}" with a list as default value must have "multi" attribute'
|
||||
raise DictConsistencyError(msg, 68, variable.xmlfiles)
|
||||
if variable.path in self.objectspace.followers and multi != "submulti":
|
||||
msg = _(
|
||||
f'the follower "{variable.name}" without multi attribute can only have one value'
|
||||
)
|
||||
if variable.path in self.objectspace.followers:
|
||||
if multi != "submulti" and len(variable.default) != 1:
|
||||
msg = _(
|
||||
f'the follower "{variable.name}" without multi attribute can only have one value'
|
||||
)
|
||||
raise DictConsistencyError(msg, 87, variable.xmlfiles)
|
||||
# else:
|
||||
# variable.default = [value.name for value in variable.default]
|
||||
raise DictConsistencyError(msg, 87, variable.xmlfiles)
|
||||
if variable.path not in self.objectspace.leaders:
|
||||
if multi == "submulti":
|
||||
self.objectspace.default_multi[
|
||||
variable.path
|
||||
] = variable.default # [value.name for value in variable.value]
|
||||
] = variable.default
|
||||
variable.default = None
|
||||
else:
|
||||
self.objectspace.default_multi[variable.path] = variable.default[
|
||||
0
|
||||
] # .name
|
||||
has_value = True
|
||||
]
|
||||
elif variable.multi:
|
||||
# msg = _(f'the none multi variable "{variable.name}" cannot have '
|
||||
# 'more than one value')
|
||||
# raise DictConsistencyError(msg, 68, variable.xmlfiles)
|
||||
raise Exception("pfff")
|
||||
else:
|
||||
if variable.path in self.objectspace.followers:
|
||||
self.objectspace.default_multi[variable.path] = variable.default
|
||||
variable.default = None
|
||||
has_value = True
|
||||
msg = _(f'the variable "{variable.name}" is multi but has a non list default value')
|
||||
raise DictConsistencyError(msg, 12, variable.xmlfiles)
|
||||
elif variable.path in self.objectspace.followers:
|
||||
self.objectspace.default_multi[variable.path] = variable.default
|
||||
variable.default = None
|
||||
|
||||
def add_choice_nil(self) -> None:
|
||||
"""A variable with type "Choice" that is not mandatory must has "nil" value"""
|
||||
|
|
|
@ -70,45 +70,47 @@ class Annotator(Walk): # pylint: disable=R0903
|
|||
]
|
||||
for extra in self.objectspace.rougailconfig["extra_dictionaries"]:
|
||||
self.forbidden_name.append(extra)
|
||||
# default type inference from a default value with :term:`basic types`
|
||||
self.basic_types = {str: "string", int: "number", bool: "boolean", float: "float"}
|
||||
self.convert_variable()
|
||||
self.convert_test()
|
||||
self.convert_help()
|
||||
|
||||
def convert_variable(self):
|
||||
"""convert variable"""
|
||||
# default type inference from a default value with :term:`basic types`
|
||||
basic_types = {str: "string", int: "number", bool: "boolean", float: "float"}
|
||||
|
||||
for variable in self.get_variables():
|
||||
if variable.type == "symlink":
|
||||
continue
|
||||
# choice type inference from the `choices` attribute
|
||||
if variable.version != "1.0":
|
||||
if variable.choices is not None:
|
||||
if variable.type is None:
|
||||
variable.type = "choice"
|
||||
self._convert_variable_inference(variable)
|
||||
if variable.multi is None:
|
||||
variable.multi = False
|
||||
if variable.type is None:
|
||||
variable.type = "string"
|
||||
self._convert_variable(variable)
|
||||
|
||||
multi = self.objectspace.multis.get(variable.path, False)
|
||||
if variable.version == "1.0":
|
||||
# - version: 1.0, the default value is of type "string" by default
|
||||
if variable.type is None:
|
||||
variable.type = "string"
|
||||
else: #if variable.version != "1.0":
|
||||
# - version: 1.1, the default value has no type by default
|
||||
if multi is False and variable.type is None:
|
||||
if type(variable.default) in basic_types:
|
||||
variable.type = basic_types[type(variable.default)]
|
||||
elif isinstance(variable.default, list):
|
||||
if variable.multi is None or variable.multi is False:
|
||||
variable.multi = True
|
||||
if variable.type is None:
|
||||
variable.type = basic_types[type(variable.default[0])]
|
||||
#else:
|
||||
# variable.type = "string"
|
||||
# let's update the "multi" attribute in the tiramisu cache then
|
||||
if variable.multi is True and variable.path not in self.objectspace.multis:
|
||||
self.objectspace.multis[variable.path] = True
|
||||
def _convert_variable_inference(
|
||||
self,
|
||||
variable,
|
||||
) -> None:
|
||||
|
||||
# variable has no type
|
||||
if variable.type is None:
|
||||
# choice type inference from the `choices` attribute
|
||||
if variable.choices is not None:
|
||||
variable.type = "choice"
|
||||
elif variable.default not in [None, []]:
|
||||
if isinstance(variable.default, list):
|
||||
tested_value = variable.default[0]
|
||||
else:
|
||||
tested_value = variable.default
|
||||
variable.type = self.basic_types.get(type(tested_value), None)
|
||||
# variable has no multi attribute
|
||||
if variable.multi is None:
|
||||
if variable.path in self.objectspace.leaders:
|
||||
variable.multi = True
|
||||
else:
|
||||
variable.multi = isinstance(variable.default, list)
|
||||
|
||||
def _convert_variable(
|
||||
self,
|
||||
|
@ -134,6 +136,9 @@ class Annotator(Walk): # pylint: disable=R0903
|
|||
elif family.hidden:
|
||||
variable.hidden = family.hidden
|
||||
variable.hidden = None
|
||||
if variable.choices is not None and variable.type != 'choice':
|
||||
msg = _(f'the variable "{variable.path}" has choice attribut but has not the "choice" type')
|
||||
raise DictConsistencyError(msg, 11, variable.xmlfiles)
|
||||
|
||||
def convert_test(self):
|
||||
"""Convert variable tests value"""
|
||||
|
|
|
@ -428,7 +428,7 @@ class Variable(BaseModel):
|
|||
default: Union[List[BASETYPE_CALC], BASETYPE_CALC] = None
|
||||
params: Optional[List[Param]] = None
|
||||
validators: Optional[List[Calculation]] = None
|
||||
multi: bool = False
|
||||
multi: Optional[bool] = None
|
||||
unique: Optional[bool] = None
|
||||
help: Optional[str] = None
|
||||
hidden: Union[bool, Calculation] = False
|
||||
|
|
|
@ -513,8 +513,10 @@ class Variable(Common):
|
|||
for idx, val in enumerate(value):
|
||||
if isinstance(val, Calculation):
|
||||
value[idx] = self.calculation_value(val)
|
||||
else:
|
||||
elif isinstance(val, str):
|
||||
value[idx] = self.convert_str(val)
|
||||
else:
|
||||
value[idx] = str(val)
|
||||
value = "[" + ", ".join(value) + "]"
|
||||
keys["default"] = value
|
||||
if self.elt.path in self.objectspace.default_multi:
|
||||
|
|
0
tests/dictionaries/01base_auto_bool/__init__.py
Normal file
0
tests/dictionaries/01base_auto_bool/__init__.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
version: '1.1'
|
||||
auto:
|
||||
default: true
|
6
tests/dictionaries/01base_auto_bool/makedict/after.json
Normal file
6
tests/dictionaries/01base_auto_bool/makedict/after.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.auto": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
}
|
||||
}
|
3
tests/dictionaries/01base_auto_bool/makedict/base.json
Normal file
3
tests/dictionaries/01base_auto_bool/makedict/base.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.auto": true
|
||||
}
|
6
tests/dictionaries/01base_auto_bool/makedict/before.json
Normal file
6
tests/dictionaries/01base_auto_bool/makedict/before.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.auto": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
24
tests/dictionaries/01base_auto_bool/tiramisu/base.py
Normal file
24
tests/dictionaries/01base_auto_bool/tiramisu/base.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_2 = BoolOption(name="auto", doc="auto", default=True, properties=frozenset({"mandatory", "standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
28
tests/dictionaries/01base_auto_bool/tiramisu/multi.py
Normal file
28
tests/dictionaries/01base_auto_bool/tiramisu/multi.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_3 = BoolOption(name="auto", doc="auto", default=True, properties=frozenset({"mandatory", "standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_6 = BoolOption(name="auto", doc="auto", default=True, properties=frozenset({"mandatory", "standard"}))
|
||||
optiondescription_5 = OptionDescription(name="rougail", doc="rougail", children=[option_6], properties=frozenset({"standard"}))
|
||||
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
0
tests/dictionaries/01base_auto_bool_multi/__init__.py
Normal file
0
tests/dictionaries/01base_auto_bool_multi/__init__.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
version: '1.1'
|
||||
auto:
|
||||
default:
|
||||
- true
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.auto": {
|
||||
"owner": "default",
|
||||
"value": [true]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.auto": [true]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.auto": {
|
||||
"owner": "default",
|
||||
"value": [true]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
24
tests/dictionaries/01base_auto_bool_multi/tiramisu/base.py
Normal file
24
tests/dictionaries/01base_auto_bool_multi/tiramisu/base.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_2 = BoolOption(name="auto", doc="auto", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
28
tests/dictionaries/01base_auto_bool_multi/tiramisu/multi.py
Normal file
28
tests/dictionaries/01base_auto_bool_multi/tiramisu/multi.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_3 = BoolOption(name="auto", doc="auto", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_6 = BoolOption(name="auto", doc="auto", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_5 = OptionDescription(name="rougail", doc="rougail", children=[option_6], properties=frozenset({"standard"}))
|
||||
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
0
tests/dictionaries/01base_auto_float/__init__.py
Normal file
0
tests/dictionaries/01base_auto_float/__init__.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
version: '1.1'
|
||||
auto:
|
||||
default: 1.0
|
6
tests/dictionaries/01base_auto_float/makedict/after.json
Normal file
6
tests/dictionaries/01base_auto_float/makedict/after.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.auto": {
|
||||
"owner": "default",
|
||||
"value": 1.0
|
||||
}
|
||||
}
|
3
tests/dictionaries/01base_auto_float/makedict/base.json
Normal file
3
tests/dictionaries/01base_auto_float/makedict/base.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.auto": 1.0
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.auto": {
|
||||
"owner": "default",
|
||||
"value": 1.0
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
24
tests/dictionaries/01base_auto_float/tiramisu/base.py
Normal file
24
tests/dictionaries/01base_auto_float/tiramisu/base.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_2 = FloatOption(name="auto", doc="auto", default=1.0, properties=frozenset({"mandatory", "standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
28
tests/dictionaries/01base_auto_float/tiramisu/multi.py
Normal file
28
tests/dictionaries/01base_auto_float/tiramisu/multi.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_3 = FloatOption(name="auto", doc="auto", default=1.0, properties=frozenset({"mandatory", "standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_6 = FloatOption(name="auto", doc="auto", default=1.0, properties=frozenset({"mandatory", "standard"}))
|
||||
optiondescription_5 = OptionDescription(name="rougail", doc="rougail", children=[option_6], properties=frozenset({"standard"}))
|
||||
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
0
tests/dictionaries/01base_auto_float_multi/__init__.py
Normal file
0
tests/dictionaries/01base_auto_float_multi/__init__.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
version: '1.1'
|
||||
auto:
|
||||
default:
|
||||
- 1.0
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.auto": {
|
||||
"owner": "default",
|
||||
"value": [1.0]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.auto": [1.0]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.auto": {
|
||||
"owner": "default",
|
||||
"value": [1.0]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
24
tests/dictionaries/01base_auto_float_multi/tiramisu/base.py
Normal file
24
tests/dictionaries/01base_auto_float_multi/tiramisu/base.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_2 = FloatOption(name="auto", doc="auto", multi=True, default=[1.0], default_multi=1.0, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
28
tests/dictionaries/01base_auto_float_multi/tiramisu/multi.py
Normal file
28
tests/dictionaries/01base_auto_float_multi/tiramisu/multi.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_3 = FloatOption(name="auto", doc="auto", multi=True, default=[1.0], default_multi=1.0, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_6 = FloatOption(name="auto", doc="auto", multi=True, default=[1.0], default_multi=1.0, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_5 = OptionDescription(name="rougail", doc="rougail", children=[option_6], properties=frozenset({"standard"}))
|
||||
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
0
tests/dictionaries/01base_auto_number/__init__.py
Normal file
0
tests/dictionaries/01base_auto_number/__init__.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
version: '1.1'
|
||||
auto:
|
||||
default: 1
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.auto": {
|
||||
"owner": "default",
|
||||
"value": 1
|
||||
}
|
||||
}
|
3
tests/dictionaries/01base_auto_number/makedict/base.json
Normal file
3
tests/dictionaries/01base_auto_number/makedict/base.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.auto": 1
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.auto": {
|
||||
"owner": "default",
|
||||
"value": 1
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
24
tests/dictionaries/01base_auto_number/tiramisu/base.py
Normal file
24
tests/dictionaries/01base_auto_number/tiramisu/base.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_2 = IntOption(name="auto", doc="auto", default=1, properties=frozenset({"mandatory", "standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
28
tests/dictionaries/01base_auto_number/tiramisu/multi.py
Normal file
28
tests/dictionaries/01base_auto_number/tiramisu/multi.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_3 = IntOption(name="auto", doc="auto", default=1, properties=frozenset({"mandatory", "standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_6 = IntOption(name="auto", doc="auto", default=1, properties=frozenset({"mandatory", "standard"}))
|
||||
optiondescription_5 = OptionDescription(name="rougail", doc="rougail", children=[option_6], properties=frozenset({"standard"}))
|
||||
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
0
tests/dictionaries/01base_auto_number_multi/__init__.py
Normal file
0
tests/dictionaries/01base_auto_number_multi/__init__.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
version: '1.1'
|
||||
auto:
|
||||
default:
|
||||
- 1
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.auto": {
|
||||
"owner": "default",
|
||||
"value": [1]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.auto": [1]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.auto": {
|
||||
"owner": "default",
|
||||
"value": [1]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
24
tests/dictionaries/01base_auto_number_multi/tiramisu/base.py
Normal file
24
tests/dictionaries/01base_auto_number_multi/tiramisu/base.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_2 = IntOption(name="auto", doc="auto", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
@ -0,0 +1,28 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_3 = IntOption(name="auto", doc="auto", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_6 = IntOption(name="auto", doc="auto", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_5 = OptionDescription(name="rougail", doc="rougail", children=[option_6], properties=frozenset({"standard"}))
|
||||
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
1
tests/dictionaries/01base_custom/makedict/mandatory.json
Normal file
1
tests/dictionaries/01base_custom/makedict/mandatory.json
Normal file
|
@ -0,0 +1 @@
|
|||
["rougail.custom"]
|
0
tests/dictionaries/01base_multi_auto/__init__.py
Normal file
0
tests/dictionaries/01base_multi_auto/__init__.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
version: '1.1'
|
||||
general:
|
||||
mode_conteneur_actif:
|
||||
default:
|
||||
- non
|
8
tests/dictionaries/01base_multi_auto/makedict/after.json
Normal file
8
tests/dictionaries/01base_multi_auto/makedict/after.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"rougail.general.mode_conteneur_actif": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"non"
|
||||
]
|
||||
}
|
||||
}
|
5
tests/dictionaries/01base_multi_auto/makedict/base.json
Normal file
5
tests/dictionaries/01base_multi_auto/makedict/base.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"rougail.general.mode_conteneur_actif": [
|
||||
"non"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"rougail.general.mode_conteneur_actif": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"non"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
25
tests/dictionaries/01base_multi_auto/tiramisu/base.py
Normal file
25
tests/dictionaries/01base_multi_auto/tiramisu/base.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_3 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", multi=True, default=["non"], default_multi="non", properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
30
tests/dictionaries/01base_multi_auto/tiramisu/multi.py
Normal file
30
tests/dictionaries/01base_multi_auto/tiramisu/multi.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_4 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", multi=True, default=["non"], default_multi="non", properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_3], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_8 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", multi=True, default=["non"], default_multi="non", properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_7 = OptionDescription(name="general", doc="general", children=[option_8], properties=frozenset({"standard"}))
|
||||
optiondescription_6 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_7], properties=frozenset({"standard"}))
|
||||
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
|
@ -1,7 +1,8 @@
|
|||
---
|
||||
version: '1.0'
|
||||
general:
|
||||
mode_conteneur_actif:
|
||||
test:
|
||||
- test1
|
||||
- test2
|
||||
default: non
|
||||
version: '1.0'
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
version: '1.1'
|
||||
general:
|
||||
leader:
|
||||
type: leadership
|
||||
leader:
|
||||
mandatory: false
|
||||
follower1:
|
||||
default: value
|
||||
follower2:
|
||||
mandatory: false
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.general.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": []
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.general.leader.leader": []
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.general.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": []
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
|
@ -0,0 +1,28 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_4 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"standard"}))
|
||||
option_5 = StrOption(name="follower1", doc="follower1", multi=True, default_multi="value", properties=frozenset({"mandatory", "standard"}))
|
||||
option_6 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"standard"}))
|
||||
optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"standard"}))
|
||||
optiondescription_2 = OptionDescription(name="general", doc="general", children=[optiondescription_3], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
@ -0,0 +1,36 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_5 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"standard"}))
|
||||
option_6 = StrOption(name="follower1", doc="follower1", multi=True, default_multi="value", properties=frozenset({"mandatory", "standard"}))
|
||||
option_7 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"standard"}))
|
||||
optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"standard"}))
|
||||
optiondescription_3 = OptionDescription(name="general", doc="general", children=[optiondescription_4], properties=frozenset({"standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_3], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_12 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"standard"}))
|
||||
option_13 = StrOption(name="follower1", doc="follower1", multi=True, default_multi="value", properties=frozenset({"mandatory", "standard"}))
|
||||
option_14 = StrOption(name="follower2", doc="follower2", multi=True, properties=frozenset({"standard"}))
|
||||
optiondescription_11 = Leadership(name="leader", doc="leader", children=[option_12, option_13, option_14], properties=frozenset({"standard"}))
|
||||
optiondescription_10 = OptionDescription(name="general", doc="general", children=[optiondescription_11], properties=frozenset({"standard"}))
|
||||
optiondescription_9 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_10], properties=frozenset({"standard"}))
|
||||
optiondescription_8 = OptionDescription(name="2", doc="2", children=[optiondescription_9], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_8])
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
version: '1.1'
|
||||
general:
|
||||
leader:
|
||||
type: leadership
|
||||
leader:
|
||||
default:
|
||||
- leader
|
||||
follower1:
|
||||
default:
|
||||
- value
|
||||
follower2:
|
||||
default:
|
||||
- value1
|
||||
- value2
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"rougail.general.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"leader"
|
||||
]
|
||||
},
|
||||
"rougail.general.leader.follower1": {
|
||||
"owner": [
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
[
|
||||
"value"
|
||||
]
|
||||
]
|
||||
},
|
||||
"rougail.general.leader.follower2": {
|
||||
"owner": [
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
[
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"rougail.general.leader.leader": [
|
||||
{
|
||||
"rougail.general.leader.leader": "leader",
|
||||
"rougail.general.leader.follower1": [
|
||||
"value"
|
||||
],
|
||||
"rougail.general.leader.follower2": [
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"rougail.general.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"leader"
|
||||
]
|
||||
},
|
||||
"rougail.general.leader.follower1": {
|
||||
"owner": [
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
[
|
||||
"value"
|
||||
]
|
||||
]
|
||||
},
|
||||
"rougail.general.leader.follower2": {
|
||||
"owner": [
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
[
|
||||
"value1",
|
||||
"value2"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
|
@ -0,0 +1,28 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_4 = StrOption(name="leader", doc="leader", multi=True, default=["leader"], properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_5 = StrOption(name="follower1", doc="follower1", multi=submulti, default_multi=['value'], properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_6 = StrOption(name="follower2", doc="follower2", multi=submulti, default_multi=['value1', 'value2'], properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_3 = Leadership(name="leader", doc="leader", children=[option_4, option_5, option_6], properties=frozenset({"standard"}))
|
||||
optiondescription_2 = OptionDescription(name="general", doc="general", children=[optiondescription_3], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
@ -0,0 +1,36 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_5 = StrOption(name="leader", doc="leader", multi=True, default=["leader"], properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_6 = StrOption(name="follower1", doc="follower1", multi=submulti, default_multi=['value'], properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_7 = StrOption(name="follower2", doc="follower2", multi=submulti, default_multi=['value1', 'value2'], properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_4 = Leadership(name="leader", doc="leader", children=[option_5, option_6, option_7], properties=frozenset({"standard"}))
|
||||
optiondescription_3 = OptionDescription(name="general", doc="general", children=[optiondescription_4], properties=frozenset({"standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_3], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_12 = StrOption(name="leader", doc="leader", multi=True, default=["leader"], properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_13 = StrOption(name="follower1", doc="follower1", multi=submulti, default_multi=['value'], properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_14 = StrOption(name="follower2", doc="follower2", multi=submulti, default_multi=['value1', 'value2'], properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_11 = Leadership(name="leader", doc="leader", children=[option_12, option_13, option_14], properties=frozenset({"standard"}))
|
||||
optiondescription_10 = OptionDescription(name="general", doc="general", children=[optiondescription_11], properties=frozenset({"standard"}))
|
||||
optiondescription_9 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_10], properties=frozenset({"standard"}))
|
||||
optiondescription_8 = OptionDescription(name="2", doc="2", children=[optiondescription_9], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_8])
|
0
tests/dictionaries/10valid_enum_auto/__init__.py
Normal file
0
tests/dictionaries/10valid_enum_auto/__init__.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
version: '1.1'
|
||||
enumvar:
|
||||
default: c
|
||||
choices:
|
||||
- a
|
||||
- b
|
||||
- c
|
6
tests/dictionaries/10valid_enum_auto/makedict/after.json
Normal file
6
tests/dictionaries/10valid_enum_auto/makedict/after.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.enumvar": {
|
||||
"owner": "default",
|
||||
"value": "c"
|
||||
}
|
||||
}
|
3
tests/dictionaries/10valid_enum_auto/makedict/base.json
Normal file
3
tests/dictionaries/10valid_enum_auto/makedict/base.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.enumvar": "c"
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.enumvar": {
|
||||
"owner": "default",
|
||||
"value": "c"
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
24
tests/dictionaries/10valid_enum_auto/tiramisu/base.py
Normal file
24
tests/dictionaries/10valid_enum_auto/tiramisu/base.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_2 = ChoiceOption(name="enumvar", doc="enumvar", values=("a", "b", "c"), default="c", properties=frozenset({"mandatory", "standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
28
tests/dictionaries/10valid_enum_auto/tiramisu/multi.py
Normal file
28
tests/dictionaries/10valid_enum_auto/tiramisu/multi.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_3 = ChoiceOption(name="enumvar", doc="enumvar", values=("a", "b", "c"), default="c", properties=frozenset({"mandatory", "standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_6 = ChoiceOption(name="enumvar", doc="enumvar", values=("a", "b", "c"), default="c", properties=frozenset({"mandatory", "standard"}))
|
||||
optiondescription_5 = OptionDescription(name="rougail", doc="rougail", children=[option_6], properties=frozenset({"standard"}))
|
||||
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
|
@ -0,0 +1 @@
|
|||
[]
|
|
@ -16,7 +16,6 @@ dyn:
|
|||
{% for val in rougail.general.varname %}
|
||||
{{ loop.index }}
|
||||
{% endfor %}
|
||||
propertyerror: false
|
||||
vardyn:
|
||||
type: string
|
||||
description: No change
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
[]
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
version: '1.0'
|
||||
base:
|
||||
subfamily:
|
||||
variable:
|
||||
mandatory: false
|
||||
version: '1.0'
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue