shorthand declaration (#20)
Co-authored-by: Emmanuel Garette <egarette@silique.fr> Co-authored-by: gwen <gwenaelremond@free.fr> Reviewed-on: #20 Co-authored-by: gnunux@silique.fr <gnunux@silique.fr> Co-committed-by: gnunux@silique.fr <gnunux@silique.fr>
This commit is contained in:
parent
e0e6597955
commit
5668520a31
127 changed files with 1033 additions and 307 deletions
|
@ -15,6 +15,23 @@ It is with this name that we will be able to interact with the family.
|
|||
|
||||
It's best to follow the :ref:`convention on variable names`.
|
||||
|
||||
Shorthand declaration
|
||||
----------------------------
|
||||
|
||||
Shorthand declaration is a way to declare a family in a single line. But you can only define family name and description.
|
||||
|
||||
To create a family, just add a key with it's name and variables as values. Attention, do not declare any other attributs.
|
||||
|
||||
By default, the description of the variable is the family name.
|
||||
If you add comment in same line of name, this comment is use as description:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
---
|
||||
version: '1.1'
|
||||
my_family: # This is a great family
|
||||
variable:
|
||||
|
||||
Parameters
|
||||
---------------
|
||||
|
||||
|
|
|
@ -23,6 +23,28 @@ Variable's associated symbolic name.
|
|||
|
||||
It's best to follow the :ref:`convention on variable names`.
|
||||
|
||||
Shorthand declaration
|
||||
----------------------------
|
||||
|
||||
Shorthand declaration is a way to declare a variable in a single line. But you can only define variable name, description, multi or default value.
|
||||
|
||||
To create a variable, just add a key with it's name and default value as value.
|
||||
Be careful not to declare any other attributes.
|
||||
|
||||
To declare a multi variable just add a list as default value.
|
||||
|
||||
By default, the description of the variable is the variable name.
|
||||
If you add a comment in the same line of the name, this comment will be used has a description.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
---
|
||||
version: '1.1'
|
||||
my_variable: 1 # This is a great integer variable
|
||||
my_multi_variable: # This is a great multi string variable
|
||||
- value1
|
||||
- value2
|
||||
|
||||
Parameters
|
||||
-------------
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ classifiers = [
|
|||
|
||||
]
|
||||
dependencies = [
|
||||
"pyyaml ~= 6.0.1",
|
||||
"ruamel.yaml ~= 0.17.40",
|
||||
"pydantic ~= 2.5.2",
|
||||
"jinja2 ~= 3.1.2",
|
||||
"tiramisu ~= 4.1.0",
|
||||
|
|
|
@ -78,16 +78,19 @@ class Annotator(Walk): # pylint: disable=R0903
|
|||
f'the follower "{variable.name}" without multi attribute can only have one value'
|
||||
)
|
||||
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
|
||||
variable.default = None
|
||||
else:
|
||||
self.objectspace.default_multi[variable.path] = variable.default[
|
||||
0
|
||||
]
|
||||
if not variable.default:
|
||||
variable.default = None
|
||||
else:
|
||||
if variable.path not in self.objectspace.leaders:
|
||||
if multi == "submulti":
|
||||
self.objectspace.default_multi[
|
||||
variable.path
|
||||
] = variable.default
|
||||
variable.default = None
|
||||
else:
|
||||
self.objectspace.default_multi[variable.path] = variable.default[
|
||||
0
|
||||
]
|
||||
elif variable.multi:
|
||||
msg = _(f'the variable "{variable.name}" is multi but has a non list default value')
|
||||
raise DictConsistencyError(msg, 12, variable.xmlfiles)
|
||||
|
|
|
@ -43,8 +43,6 @@ RougailConfig = {
|
|||
"templates_dir": join(ROUGAILROOT, "templates"),
|
||||
"destinations_dir": join(ROUGAILROOT, "destinations"),
|
||||
"tmp_dir": join(ROUGAILROOT, "tmp"),
|
||||
"dtdfilename": join(DTDDIR, "rougail.dtd"),
|
||||
"yamlschema_filename": join(DTDDIR, "rougail.yml"),
|
||||
"functions_file": join(ROUGAILROOT, "functions.py"),
|
||||
"system_service_directory": "/usr/lib/systemd/system",
|
||||
"systemd_service_destination_directory": "/usr/local/lib",
|
||||
|
|
|
@ -44,7 +44,8 @@ from typing import (
|
|||
from itertools import chain
|
||||
from re import findall, compile
|
||||
|
||||
from yaml import safe_load
|
||||
from ruamel.yaml import YAML
|
||||
from ruamel.yaml.comments import CommentedMap
|
||||
from pydantic import ValidationError
|
||||
|
||||
from tiramisu.error import display_list
|
||||
|
@ -338,6 +339,7 @@ class ParserVariable:
|
|||
path: str,
|
||||
obj: dict,
|
||||
family_is_leadership: bool,
|
||||
version: str,
|
||||
filename: str,
|
||||
) -> Literal["variable", "family"]:
|
||||
"""Check object to determine if it's a variable or a family"""
|
||||
|
@ -363,18 +365,24 @@ class ParserVariable:
|
|||
return "variable"
|
||||
# all attributes are in variable object
|
||||
# and values in attributes are not dict is not Calculation
|
||||
extra_keys = set(obj) - self.choice_attrs
|
||||
if not extra_keys:
|
||||
for key, value in obj.items():
|
||||
if isinstance(value, dict) and not self.is_calculation(
|
||||
key,
|
||||
value,
|
||||
self.choice_calculations,
|
||||
False,
|
||||
):
|
||||
break
|
||||
else:
|
||||
return "variable"
|
||||
if isinstance(obj, dict):
|
||||
extra_keys = set(obj) - self.choice_attrs
|
||||
if not extra_keys:
|
||||
for key, value in obj.items():
|
||||
if isinstance(value, dict) and not self.is_calculation(
|
||||
key,
|
||||
value,
|
||||
self.choice_calculations,
|
||||
False,
|
||||
):
|
||||
break
|
||||
else:
|
||||
return "variable"
|
||||
else:
|
||||
if version == '1.0':
|
||||
msg = f'Invalid value for the variable "{path}": "{obj}"'
|
||||
raise DictConsistencyError(msg, 102, [filename])
|
||||
return "variable"
|
||||
return "family"
|
||||
|
||||
def get_family_or_variable_type(
|
||||
|
@ -382,6 +390,8 @@ class ParserVariable:
|
|||
obj: dict,
|
||||
) -> Optional[str]:
|
||||
"""Check 'type' attributes"""
|
||||
if not isinstance(obj, dict):
|
||||
return None
|
||||
if "_type" in obj:
|
||||
# only family has _type attributs
|
||||
return obj["_type"]
|
||||
|
@ -399,6 +409,7 @@ class ParserVariable:
|
|||
subpath: str,
|
||||
obj: dict,
|
||||
version: str,
|
||||
comment: Optional[str],
|
||||
*,
|
||||
first_variable: bool = False,
|
||||
family_is_leadership: bool = False,
|
||||
|
@ -409,10 +420,14 @@ class ParserVariable:
|
|||
msg = f'the variable or family name "{name}" is incorrect, it must not starts with "_" character'
|
||||
raise DictConsistencyError(msg, 16, [filename])
|
||||
path = f"{subpath}.{name}"
|
||||
if version == '0.1' and not isinstance(obj, dict) and obj is not None:
|
||||
msg = f'the variable "{path}" has a wrong type "{type(obj)}"'
|
||||
raise DictConsistencyError(msg, 17, [filename])
|
||||
typ = self.is_family_or_variable(
|
||||
path,
|
||||
obj,
|
||||
family_is_leadership,
|
||||
version,
|
||||
filename,
|
||||
)
|
||||
logging.info("family_or_variable: %s is a %s", path, typ)
|
||||
|
@ -426,6 +441,7 @@ class ParserVariable:
|
|||
path,
|
||||
obj,
|
||||
version,
|
||||
comment=comment,
|
||||
first_variable=first_variable,
|
||||
family_is_leadership=family_is_leadership,
|
||||
family_is_dynamic=family_is_dynamic,
|
||||
|
@ -440,6 +456,7 @@ class ParserVariable:
|
|||
obj: Optional[Dict[str, Any]],
|
||||
version: str,
|
||||
*,
|
||||
comment: Optional[str] = None,
|
||||
first_variable: bool = False,
|
||||
family_is_leadership: bool = False,
|
||||
family_is_dynamic: bool = False,
|
||||
|
@ -494,6 +511,8 @@ class ParserVariable:
|
|||
if '{{ suffix }}' not in name:
|
||||
msg = f'dynamic family name must have "{{{{ suffix }}}}" in his name for "{path}"'
|
||||
raise DictConsistencyError(msg, 13, [filename])
|
||||
if version != '1.0' and not family_obj and comment:
|
||||
family_obj['description'] = comment
|
||||
self.add_family(
|
||||
path,
|
||||
name,
|
||||
|
@ -508,18 +527,15 @@ class ParserVariable:
|
|||
family_is_leadership = True
|
||||
for idx, key in enumerate(subfamily_obj):
|
||||
value = subfamily_obj[key]
|
||||
if not isinstance(value, dict) and value is not None:
|
||||
msg = f'the variable "{path}.{key}" has a wrong type "{type(value)}"'
|
||||
raise DictConsistencyError(msg, 17, [filename])
|
||||
first_variable = not force_not_first and idx == 0
|
||||
if value is None:
|
||||
value = {}
|
||||
comment = self.get_comment(key, obj)
|
||||
self.family_or_variable(
|
||||
filename,
|
||||
key,
|
||||
path,
|
||||
value,
|
||||
version,
|
||||
comment,
|
||||
first_variable=first_variable,
|
||||
family_is_leadership=family_is_leadership,
|
||||
family_is_dynamic=family_is_dynamic,
|
||||
|
@ -628,15 +644,22 @@ class ParserVariable:
|
|||
obj: Optional[Dict[str, Any]],
|
||||
version: str,
|
||||
*,
|
||||
comment: Optional[str] = None,
|
||||
first_variable: bool = False,
|
||||
family_is_leadership: bool = False,
|
||||
family_is_dynamic: bool = False,
|
||||
parent_dynamic: Optional[str] = None,
|
||||
) -> None:
|
||||
"""Parse variable"""
|
||||
if obj is None:
|
||||
obj = {}
|
||||
extra_attrs = set(obj) - self.choice_attrs
|
||||
if version == '1.0' or isinstance(obj, dict):
|
||||
if obj is None:
|
||||
obj = {}
|
||||
extra_attrs = set(obj) - self.choice_attrs
|
||||
else:
|
||||
extra_attrs = []
|
||||
obj = {'default': obj}
|
||||
if comment:
|
||||
obj['description'] = comment
|
||||
if extra_attrs:
|
||||
raise Exception(
|
||||
f'"{path}" is not a valid variable, there are additional '
|
||||
|
@ -930,6 +953,7 @@ class RougailConvert(ParserVariable):
|
|||
|
||||
def __init__(self, rougailconfig) -> None:
|
||||
self.annotator = False
|
||||
self.yaml = YAML()
|
||||
super().__init__(rougailconfig)
|
||||
|
||||
def search_calculation(
|
||||
|
@ -1007,6 +1031,18 @@ class RougailConvert(ParserVariable):
|
|||
if path_prefix:
|
||||
self.path_prefix = None
|
||||
|
||||
def get_comment(self,
|
||||
name: str,
|
||||
objects: CommentedMap,
|
||||
) -> Optional[str]:
|
||||
if name in objects.ca.items:
|
||||
comment = objects.ca.items[name][2]
|
||||
else:
|
||||
comment = None
|
||||
if comment:
|
||||
comment = comment.value[1:].strip()
|
||||
return comment
|
||||
|
||||
def parse_variable_file(
|
||||
self,
|
||||
filename: str,
|
||||
|
@ -1014,7 +1050,7 @@ class RougailConvert(ParserVariable):
|
|||
) -> None:
|
||||
"""Parse file"""
|
||||
with open(filename, encoding="utf8") as file_fh:
|
||||
objects = safe_load(file_fh)
|
||||
objects = self.yaml.load(file_fh)
|
||||
version = self.validate_file_version(
|
||||
objects,
|
||||
filename,
|
||||
|
@ -1027,12 +1063,14 @@ class RougailConvert(ParserVariable):
|
|||
version,
|
||||
)
|
||||
for name, obj in objects.items():
|
||||
comment = self.get_comment(name, objects)
|
||||
self.family_or_variable(
|
||||
filename,
|
||||
name,
|
||||
path,
|
||||
obj,
|
||||
version,
|
||||
comment,
|
||||
)
|
||||
|
||||
def get_sorted_filename(
|
||||
|
|
|
@ -35,7 +35,8 @@ except ModuleNotFoundError as err:
|
|||
|
||||
# from ast import parse as ast_parse
|
||||
from json import dumps
|
||||
from yaml import safe_load, dump, SafeDumper
|
||||
from ruamel.yaml import YAML
|
||||
from yaml import dump, SafeDumper
|
||||
from pathlib import Path
|
||||
|
||||
from .i18n import _
|
||||
|
@ -57,11 +58,6 @@ def get_function_name(version):
|
|||
FUNCTION_VERSIONS = [(version, get_function_name(version)) for version in VERSIONS]
|
||||
|
||||
|
||||
class NoAliasDumper(SafeDumper):
|
||||
def ignore_aliases(self, data):
|
||||
return True
|
||||
|
||||
|
||||
class upgrade_010_to_10:
|
||||
def __init__(
|
||||
self,
|
||||
|
@ -648,7 +644,7 @@ class RougailUpgrade:
|
|||
ext = "xml"
|
||||
else:
|
||||
with xmlsrc.open() as xml_fh:
|
||||
root = safe_load(xml_fh)
|
||||
root = YAML(typ='safe').load(file_fh)
|
||||
search_function_name = get_function_name(str(root["version"]))
|
||||
ext = "yml"
|
||||
function_found = False
|
||||
|
@ -671,23 +667,19 @@ class RougailUpgrade:
|
|||
root["version"] = version
|
||||
xmldst.parent.mkdir(parents=True, exist_ok=True)
|
||||
with xmldst.open("w") as ymlfh:
|
||||
dump(
|
||||
yaml = YAML()
|
||||
yaml.dump(
|
||||
root,
|
||||
ymlfh,
|
||||
allow_unicode=True,
|
||||
sort_keys=False,
|
||||
Dumper=NoAliasDumper,
|
||||
xmldst,
|
||||
)
|
||||
if root_services and services_dstfolder:
|
||||
root_services["version"] = version
|
||||
ymldst_services.parent.mkdir(parents=True, exist_ok=True)
|
||||
with ymldst_services.open("w") as ymlfh:
|
||||
dump(
|
||||
yaml = YAML()
|
||||
yaml.dump(
|
||||
root_services,
|
||||
ymlfh,
|
||||
allow_unicode=True,
|
||||
sort_keys=False,
|
||||
Dumper=NoAliasDumper,
|
||||
)
|
||||
|
||||
def _attribut_to_bool(self, variable):
|
||||
|
|
0
tests/dictionaries/01base_bool_shorthand/__init__.py
Normal file
0
tests/dictionaries/01base_bool_shorthand/__init__.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
version: '1.1'
|
||||
bool: true
|
||||
bool_multi:
|
||||
- false
|
||||
family:
|
||||
bool: true
|
||||
bool_multi:
|
||||
- false
|
22
tests/dictionaries/01base_bool_shorthand/makedict/after.json
Normal file
22
tests/dictionaries/01base_bool_shorthand/makedict/after.json
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"rougail.bool": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
},
|
||||
"rougail.bool_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"rougail.family.bool": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
},
|
||||
"rougail.family.bool_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
false
|
||||
]
|
||||
}
|
||||
}
|
10
tests/dictionaries/01base_bool_shorthand/makedict/base.json
Normal file
10
tests/dictionaries/01base_bool_shorthand/makedict/base.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"rougail.bool": true,
|
||||
"rougail.bool_multi": [
|
||||
false
|
||||
],
|
||||
"rougail.family.bool": true,
|
||||
"rougail.family.bool_multi": [
|
||||
false
|
||||
]
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"rougail.bool": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
},
|
||||
"rougail.bool_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"rougail.family.bool": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
},
|
||||
"rougail.family.bool_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
false
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
14
tests/dictionaries/01base_bool_shorthand/tiramisu/base.py
Normal file
14
tests/dictionaries/01base_bool_shorthand/tiramisu/base.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_2 = BoolOption(name="bool", doc="bool", default=True, properties=frozenset({"mandatory", "standard"}))
|
||||
option_3 = BoolOption(name="bool_multi", doc="bool_multi", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_5 = BoolOption(name="bool", doc="bool", default=True, properties=frozenset({"mandatory", "standard"}))
|
||||
option_6 = BoolOption(name="bool_multi", doc="bool_multi", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_4 = OptionDescription(name="family", doc="family", children=[option_5, option_6], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3, optiondescription_4], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
22
tests/dictionaries/01base_bool_shorthand/tiramisu/multi.py
Normal file
22
tests/dictionaries/01base_bool_shorthand/tiramisu/multi.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_3 = BoolOption(name="bool", doc="bool", default=True, properties=frozenset({"mandatory", "standard"}))
|
||||
option_4 = BoolOption(name="bool_multi", doc="bool_multi", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_6 = BoolOption(name="bool", doc="bool", default=True, properties=frozenset({"mandatory", "standard"}))
|
||||
option_7 = BoolOption(name="bool_multi", doc="bool_multi", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_5 = OptionDescription(name="family", doc="family", children=[option_6, option_7], properties=frozenset({"standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3, option_4, optiondescription_5], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_10 = BoolOption(name="bool", doc="bool", default=True, properties=frozenset({"mandatory", "standard"}))
|
||||
option_11 = BoolOption(name="bool_multi", doc="bool_multi", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_13 = BoolOption(name="bool", doc="bool", default=True, properties=frozenset({"mandatory", "standard"}))
|
||||
option_14 = BoolOption(name="bool_multi", doc="bool_multi", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_12 = OptionDescription(name="family", doc="family", children=[option_13, option_14], properties=frozenset({"standard"}))
|
||||
optiondescription_9 = OptionDescription(name="rougail", doc="rougail", children=[option_10, option_11, optiondescription_12], 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/01base_float_shorthand/__init__.py
Normal file
0
tests/dictionaries/01base_float_shorthand/__init__.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
version: '1.1'
|
||||
float: 0.527
|
||||
float_multi:
|
||||
- 0.527
|
||||
family:
|
||||
float: 0.527
|
||||
float_multi:
|
||||
- 0.527
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"rougail.float": {
|
||||
"owner": "default",
|
||||
"value": 0.527
|
||||
},
|
||||
"rougail.float_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
0.527
|
||||
]
|
||||
},
|
||||
"rougail.family.float": {
|
||||
"owner": "default",
|
||||
"value": 0.527
|
||||
},
|
||||
"rougail.family.float_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
0.527
|
||||
]
|
||||
}
|
||||
}
|
10
tests/dictionaries/01base_float_shorthand/makedict/base.json
Normal file
10
tests/dictionaries/01base_float_shorthand/makedict/base.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"rougail.float": 0.527,
|
||||
"rougail.float_multi": [
|
||||
0.527
|
||||
],
|
||||
"rougail.family.float": 0.527,
|
||||
"rougail.family.float_multi": [
|
||||
0.527
|
||||
]
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"rougail.float": {
|
||||
"owner": "default",
|
||||
"value": 0.527
|
||||
},
|
||||
"rougail.float_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
0.527
|
||||
]
|
||||
},
|
||||
"rougail.family.float": {
|
||||
"owner": "default",
|
||||
"value": 0.527
|
||||
},
|
||||
"rougail.family.float_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
0.527
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
14
tests/dictionaries/01base_float_shorthand/tiramisu/base.py
Normal file
14
tests/dictionaries/01base_float_shorthand/tiramisu/base.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_2 = FloatOption(name="float", doc="float", default=0.527, properties=frozenset({"mandatory", "standard"}))
|
||||
option_3 = FloatOption(name="float_multi", doc="float_multi", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_5 = FloatOption(name="float", doc="float", default=0.527, properties=frozenset({"mandatory", "standard"}))
|
||||
option_6 = FloatOption(name="float_multi", doc="float_multi", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_4 = OptionDescription(name="family", doc="family", children=[option_5, option_6], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3, optiondescription_4], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
22
tests/dictionaries/01base_float_shorthand/tiramisu/multi.py
Normal file
22
tests/dictionaries/01base_float_shorthand/tiramisu/multi.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_3 = FloatOption(name="float", doc="float", default=0.527, properties=frozenset({"mandatory", "standard"}))
|
||||
option_4 = FloatOption(name="float_multi", doc="float_multi", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_6 = FloatOption(name="float", doc="float", default=0.527, properties=frozenset({"mandatory", "standard"}))
|
||||
option_7 = FloatOption(name="float_multi", doc="float_multi", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_5 = OptionDescription(name="family", doc="family", children=[option_6, option_7], properties=frozenset({"standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3, option_4, optiondescription_5], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_10 = FloatOption(name="float", doc="float", default=0.527, properties=frozenset({"mandatory", "standard"}))
|
||||
option_11 = FloatOption(name="float_multi", doc="float_multi", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_13 = FloatOption(name="float", doc="float", default=0.527, properties=frozenset({"mandatory", "standard"}))
|
||||
option_14 = FloatOption(name="float_multi", doc="float_multi", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_12 = OptionDescription(name="family", doc="family", children=[option_13, option_14], properties=frozenset({"standard"}))
|
||||
optiondescription_9 = OptionDescription(name="rougail", doc="rougail", children=[option_10, option_11, optiondescription_12], 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/01base_int_shorthand/__init__.py
Normal file
0
tests/dictionaries/01base_int_shorthand/__init__.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
version: '1.1'
|
||||
int: 1
|
||||
int_multi:
|
||||
- 1
|
||||
family:
|
||||
int: 1
|
||||
int_multi:
|
||||
- 1
|
22
tests/dictionaries/01base_int_shorthand/makedict/after.json
Normal file
22
tests/dictionaries/01base_int_shorthand/makedict/after.json
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"rougail.int": {
|
||||
"owner": "default",
|
||||
"value": 1
|
||||
},
|
||||
"rougail.int_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
1
|
||||
]
|
||||
},
|
||||
"rougail.family.int": {
|
||||
"owner": "default",
|
||||
"value": 1
|
||||
},
|
||||
"rougail.family.int_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
1
|
||||
]
|
||||
}
|
||||
}
|
10
tests/dictionaries/01base_int_shorthand/makedict/base.json
Normal file
10
tests/dictionaries/01base_int_shorthand/makedict/base.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"rougail.int": 1,
|
||||
"rougail.int_multi": [
|
||||
1
|
||||
],
|
||||
"rougail.family.int": 1,
|
||||
"rougail.family.int_multi": [
|
||||
1
|
||||
]
|
||||
}
|
22
tests/dictionaries/01base_int_shorthand/makedict/before.json
Normal file
22
tests/dictionaries/01base_int_shorthand/makedict/before.json
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"rougail.int": {
|
||||
"owner": "default",
|
||||
"value": 1
|
||||
},
|
||||
"rougail.int_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
1
|
||||
]
|
||||
},
|
||||
"rougail.family.int": {
|
||||
"owner": "default",
|
||||
"value": 1
|
||||
},
|
||||
"rougail.family.int_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
1
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
14
tests/dictionaries/01base_int_shorthand/tiramisu/base.py
Normal file
14
tests/dictionaries/01base_int_shorthand/tiramisu/base.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_2 = IntOption(name="int", doc="int", default=1, properties=frozenset({"mandatory", "standard"}))
|
||||
option_3 = IntOption(name="int_multi", doc="int_multi", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_5 = IntOption(name="int", doc="int", default=1, properties=frozenset({"mandatory", "standard"}))
|
||||
option_6 = IntOption(name="int_multi", doc="int_multi", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_4 = OptionDescription(name="family", doc="family", children=[option_5, option_6], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3, optiondescription_4], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
22
tests/dictionaries/01base_int_shorthand/tiramisu/multi.py
Normal file
22
tests/dictionaries/01base_int_shorthand/tiramisu/multi.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_3 = IntOption(name="int", doc="int", default=1, properties=frozenset({"mandatory", "standard"}))
|
||||
option_4 = IntOption(name="int_multi", doc="int_multi", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_6 = IntOption(name="int", doc="int", default=1, properties=frozenset({"mandatory", "standard"}))
|
||||
option_7 = IntOption(name="int_multi", doc="int_multi", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_5 = OptionDescription(name="family", doc="family", children=[option_6, option_7], properties=frozenset({"standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3, option_4, optiondescription_5], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_10 = IntOption(name="int", doc="int", default=1, properties=frozenset({"mandatory", "standard"}))
|
||||
option_11 = IntOption(name="int_multi", doc="int_multi", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_13 = IntOption(name="int", doc="int", default=1, properties=frozenset({"mandatory", "standard"}))
|
||||
option_14 = IntOption(name="int_multi", doc="int_multi", multi=True, default=[1], default_multi=1, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_12 = OptionDescription(name="family", doc="family", children=[option_13, option_14], properties=frozenset({"standard"}))
|
||||
optiondescription_9 = OptionDescription(name="rougail", doc="rougail", children=[option_10, option_11, optiondescription_12], 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/01base_shorthand/__init__.py
Normal file
0
tests/dictionaries/01base_shorthand/__init__.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
version: '1.1'
|
||||
root_variable: # With root comment
|
||||
root_int: 1 # With root int comment
|
||||
family: # With comment
|
||||
variable: # With variable comment
|
||||
int: 1 # With comment for an integer
|
||||
multi: # With comment for a multi
|
||||
- 0.1
|
||||
- 0.2
|
||||
empty_multi: [] # With comment for an empty multi
|
||||
family_not_shorthand: # Not a description
|
||||
hidden: true
|
||||
variable: # Not a description
|
||||
default: true
|
33
tests/dictionaries/01base_shorthand/makedict/after.json
Normal file
33
tests/dictionaries/01base_shorthand/makedict/after.json
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"rougail.root_variable": {
|
||||
"owner": "default",
|
||||
"value": null
|
||||
},
|
||||
"rougail.root_int": {
|
||||
"owner": "default",
|
||||
"value": 1
|
||||
},
|
||||
"rougail.family.variable": {
|
||||
"owner": "default",
|
||||
"value": null
|
||||
},
|
||||
"rougail.family.int": {
|
||||
"owner": "default",
|
||||
"value": 1
|
||||
},
|
||||
"rougail.family.multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
0.1,
|
||||
0.2
|
||||
]
|
||||
},
|
||||
"rougail.family.empty_multi": {
|
||||
"owner": "default",
|
||||
"value": []
|
||||
},
|
||||
"rougail.family_not_shorthand.variable": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
}
|
||||
}
|
12
tests/dictionaries/01base_shorthand/makedict/base.json
Normal file
12
tests/dictionaries/01base_shorthand/makedict/base.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"rougail.root_variable": null,
|
||||
"rougail.root_int": 1,
|
||||
"rougail.family.variable": null,
|
||||
"rougail.family.int": 1,
|
||||
"rougail.family.multi": [
|
||||
0.1,
|
||||
0.2
|
||||
],
|
||||
"rougail.family.empty_multi": [],
|
||||
"rougail.family_not_shorthand.variable": true
|
||||
}
|
33
tests/dictionaries/01base_shorthand/makedict/before.json
Normal file
33
tests/dictionaries/01base_shorthand/makedict/before.json
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"rougail.root_variable": {
|
||||
"owner": "default",
|
||||
"value": null
|
||||
},
|
||||
"rougail.root_int": {
|
||||
"owner": "default",
|
||||
"value": 1
|
||||
},
|
||||
"rougail.family.variable": {
|
||||
"owner": "default",
|
||||
"value": null
|
||||
},
|
||||
"rougail.family.int": {
|
||||
"owner": "default",
|
||||
"value": 1
|
||||
},
|
||||
"rougail.family.multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
0.1,
|
||||
0.2
|
||||
]
|
||||
},
|
||||
"rougail.family.empty_multi": {
|
||||
"owner": "default",
|
||||
"value": []
|
||||
},
|
||||
"rougail.family_not_shorthand.variable": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
["rougail.root_variable", "rougail.family.variable", "rougail.family.empty_multi"]
|
18
tests/dictionaries/01base_shorthand/tiramisu/base.py
Normal file
18
tests/dictionaries/01base_shorthand/tiramisu/base.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_2 = StrOption(name="root_variable", doc="With root comment", properties=frozenset({"basic", "mandatory"}))
|
||||
option_3 = IntOption(name="root_int", doc="With root int comment", default=1, properties=frozenset({"mandatory", "standard"}))
|
||||
option_5 = StrOption(name="variable", doc="With variable comment", properties=frozenset({"basic", "mandatory"}))
|
||||
option_6 = IntOption(name="int", doc="With comment for an integer", default=1, properties=frozenset({"mandatory", "standard"}))
|
||||
option_7 = FloatOption(name="multi", doc="With comment for a multi", multi=True, default=[0.1, 0.2], default_multi=0.1, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_8 = StrOption(name="empty_multi", doc="With comment for an empty multi", multi=True, properties=frozenset({"basic", "mandatory", "notempty"}))
|
||||
optiondescription_4 = OptionDescription(name="family", doc="With comment", children=[option_5, option_6, option_7, option_8], properties=frozenset({"basic"}))
|
||||
option_10 = BoolOption(name="variable", doc="variable", default=True, properties=frozenset({"force_default_on_freeze", "frozen", "mandatory", "standard"}))
|
||||
optiondescription_9 = OptionDescription(name="family_not_shorthand", doc="family_not_shorthand", children=[option_10], properties=frozenset({"hidden", "standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3, optiondescription_4, optiondescription_9], properties=frozenset({"basic"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
30
tests/dictionaries/01base_shorthand/tiramisu/multi.py
Normal file
30
tests/dictionaries/01base_shorthand/tiramisu/multi.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_3 = StrOption(name="root_variable", doc="With root comment", properties=frozenset({"basic", "mandatory"}))
|
||||
option_4 = IntOption(name="root_int", doc="With root int comment", default=1, properties=frozenset({"mandatory", "standard"}))
|
||||
option_6 = StrOption(name="variable", doc="With variable comment", properties=frozenset({"basic", "mandatory"}))
|
||||
option_7 = IntOption(name="int", doc="With comment for an integer", default=1, properties=frozenset({"mandatory", "standard"}))
|
||||
option_8 = FloatOption(name="multi", doc="With comment for a multi", multi=True, default=[0.1, 0.2], default_multi=0.1, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_9 = StrOption(name="empty_multi", doc="With comment for an empty multi", multi=True, properties=frozenset({"basic", "mandatory", "notempty"}))
|
||||
optiondescription_5 = OptionDescription(name="family", doc="With comment", children=[option_6, option_7, option_8, option_9], properties=frozenset({"basic"}))
|
||||
option_11 = BoolOption(name="variable", doc="variable", default=True, properties=frozenset({"force_default_on_freeze", "frozen", "mandatory", "standard"}))
|
||||
optiondescription_10 = OptionDescription(name="family_not_shorthand", doc="family_not_shorthand", children=[option_11], properties=frozenset({"hidden", "standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3, option_4, optiondescription_5, optiondescription_10], properties=frozenset({"basic"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||
option_14 = StrOption(name="root_variable", doc="With root comment", properties=frozenset({"basic", "mandatory"}))
|
||||
option_15 = IntOption(name="root_int", doc="With root int comment", default=1, properties=frozenset({"mandatory", "standard"}))
|
||||
option_17 = StrOption(name="variable", doc="With variable comment", properties=frozenset({"basic", "mandatory"}))
|
||||
option_18 = IntOption(name="int", doc="With comment for an integer", default=1, properties=frozenset({"mandatory", "standard"}))
|
||||
option_19 = FloatOption(name="multi", doc="With comment for a multi", multi=True, default=[0.1, 0.2], default_multi=0.1, properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_20 = StrOption(name="empty_multi", doc="With comment for an empty multi", multi=True, properties=frozenset({"basic", "mandatory", "notempty"}))
|
||||
optiondescription_16 = OptionDescription(name="family", doc="With comment", children=[option_17, option_18, option_19, option_20], properties=frozenset({"basic"}))
|
||||
option_22 = BoolOption(name="variable", doc="variable", default=True, properties=frozenset({"force_default_on_freeze", "frozen", "mandatory", "standard"}))
|
||||
optiondescription_21 = OptionDescription(name="family_not_shorthand", doc="family_not_shorthand", children=[option_22], properties=frozenset({"hidden", "standard"}))
|
||||
optiondescription_13 = OptionDescription(name="rougail", doc="rougail", children=[option_14, option_15, optiondescription_16, optiondescription_21], properties=frozenset({"basic"}))
|
||||
optiondescription_12 = OptionDescription(name="2", doc="2", children=[optiondescription_13], properties=frozenset({"basic"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_12])
|
0
tests/dictionaries/01base_string_shorthand/__init__.py
Normal file
0
tests/dictionaries/01base_string_shorthand/__init__.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
version: '1.1'
|
||||
string: value
|
||||
string_multi:
|
||||
- value
|
||||
family:
|
||||
string: value
|
||||
string_multi:
|
||||
- value
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"rougail.string": {
|
||||
"owner": "default",
|
||||
"value": "value"
|
||||
},
|
||||
"rougail.string_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"rougail.family.string": {
|
||||
"owner": "default",
|
||||
"value": "value"
|
||||
},
|
||||
"rougail.family.string_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"rougail.string": "value",
|
||||
"rougail.string_multi": [
|
||||
"value"
|
||||
],
|
||||
"rougail.family.string": "value",
|
||||
"rougail.family.string_multi": [
|
||||
"value"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"rougail.string": {
|
||||
"owner": "default",
|
||||
"value": "value"
|
||||
},
|
||||
"rougail.string_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"rougail.family.string": {
|
||||
"owner": "default",
|
||||
"value": "value"
|
||||
},
|
||||
"rougail.family.string_multi": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"value"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
14
tests/dictionaries/01base_string_shorthand/tiramisu/base.py
Normal file
14
tests/dictionaries/01base_string_shorthand/tiramisu/base.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_2 = StrOption(name="string", doc="string", default="value", properties=frozenset({"mandatory", "standard"}))
|
||||
option_3 = StrOption(name="string_multi", doc="string_multi", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_5 = StrOption(name="string", doc="string", default="value", properties=frozenset({"mandatory", "standard"}))
|
||||
option_6 = StrOption(name="string_multi", doc="string_multi", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_4 = OptionDescription(name="family", doc="family", children=[option_5, option_6], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3, optiondescription_4], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
22
tests/dictionaries/01base_string_shorthand/tiramisu/multi.py
Normal file
22
tests/dictionaries/01base_string_shorthand/tiramisu/multi.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_3 = StrOption(name="string", doc="string", default="value", properties=frozenset({"mandatory", "standard"}))
|
||||
option_4 = StrOption(name="string_multi", doc="string_multi", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_6 = StrOption(name="string", doc="string", default="value", properties=frozenset({"mandatory", "standard"}))
|
||||
option_7 = StrOption(name="string_multi", doc="string_multi", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_5 = OptionDescription(name="family", doc="family", children=[option_6, option_7], properties=frozenset({"standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3, option_4, optiondescription_5], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
option_10 = StrOption(name="string", doc="string", default="value", properties=frozenset({"mandatory", "standard"}))
|
||||
option_11 = StrOption(name="string_multi", doc="string_multi", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_13 = StrOption(name="string", doc="string", default="value", properties=frozenset({"mandatory", "standard"}))
|
||||
option_14 = StrOption(name="string_multi", doc="string_multi", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
optiondescription_12 = OptionDescription(name="family", doc="family", children=[option_13, option_14], properties=frozenset({"standard"}))
|
||||
optiondescription_9 = OptionDescription(name="rougail", doc="rougail", children=[option_10, option_11, optiondescription_12], 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])
|
|
@ -1,7 +1,8 @@
|
|||
---
|
||||
version: '1.0'
|
||||
general:
|
||||
mode_conteneur_actif:
|
||||
type: "boolean"
|
||||
test:
|
||||
- false
|
||||
default: true
|
||||
version: '1.0'
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"rougail.leadermode.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"valfill"
|
||||
]
|
||||
},
|
||||
"rougail.leadermode.leader.follower1": {
|
||||
"owner": [
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
null
|
||||
]
|
||||
},
|
||||
"rougail.leadermode.leader.follower2": {
|
||||
"owner": [
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"rougail.leadermode.leader.leader": [
|
||||
{
|
||||
"rougail.leadermode.leader.leader": "valfill",
|
||||
"rougail.leadermode.leader.follower1": null,
|
||||
"rougail.leadermode.leader.follower2": null
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"rougail.leadermode.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"valfill"
|
||||
]
|
||||
},
|
||||
"rougail.leadermode.leader.follower1": {
|
||||
"owner": [
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
null
|
||||
]
|
||||
},
|
||||
"rougail.leadermode.leader.follower2": {
|
||||
"owner": [
|
||||
"default"
|
||||
],
|
||||
"value": [
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
|
@ -26,3 +26,9 @@ varname:
|
|||
default:
|
||||
type: variable
|
||||
variable: rougail.val4_dyn.var1
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: |
|
||||
{% if 'val4' not in __.varname %}
|
||||
val4 is not a valid value
|
||||
{% endif %}
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"rougail.varname": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"val1",
|
||||
"val2"
|
||||
]
|
||||
},
|
||||
"rougail.val1_dyn.var1": {
|
||||
"owner": "default",
|
||||
"value": "val1"
|
||||
},
|
||||
"rougail.val1_dyn.var2": {
|
||||
"owner": "default",
|
||||
"value": "val1"
|
||||
},
|
||||
"rougail.val1_dyn.var3": {
|
||||
"owner": "default",
|
||||
"value": "val1"
|
||||
},
|
||||
"rougail.val2_dyn.var1": {
|
||||
"owner": "default",
|
||||
"value": "val2"
|
||||
},
|
||||
"rougail.val2_dyn.var2": {
|
||||
"owner": "default",
|
||||
"value": "val2"
|
||||
},
|
||||
"rougail.val2_dyn.var3": {
|
||||
"owner": "default",
|
||||
"value": "val2"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"rougail.varname": [
|
||||
"val1",
|
||||
"val2"
|
||||
],
|
||||
"rougail.val1_dyn.var1": "val1",
|
||||
"rougail.val1_dyn.var2": "val1",
|
||||
"rougail.val1_dyn.var3": "val1",
|
||||
"rougail.val2_dyn.var1": "val2",
|
||||
"rougail.val2_dyn.var2": "val2",
|
||||
"rougail.val2_dyn.var3": "val2"
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"rougail.varname": {
|
||||
"owner": "default",
|
||||
"value": [
|
||||
"val1",
|
||||
"val2"
|
||||
]
|
||||
},
|
||||
"rougail.val1_dyn.var1": {
|
||||
"owner": "default",
|
||||
"value": "val1"
|
||||
},
|
||||
"rougail.val1_dyn.var2": {
|
||||
"owner": "default",
|
||||
"value": "val1"
|
||||
},
|
||||
"rougail.val1_dyn.var3": {
|
||||
"owner": "default",
|
||||
"value": "val1"
|
||||
},
|
||||
"rougail.val2_dyn.var1": {
|
||||
"owner": "default",
|
||||
"value": "val2"
|
||||
},
|
||||
"rougail.val2_dyn.var2": {
|
||||
"owner": "default",
|
||||
"value": "val2"
|
||||
},
|
||||
"rougail.val2_dyn.var3": {
|
||||
"owner": "default",
|
||||
"value": "val2"
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[]
|
|
@ -5,11 +5,12 @@ load_functions('tests/dictionaries/../eosfunc/test.py')
|
|||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
dict_env['disabled_rougail.{{ suffix }}_dyn.var4'] = "{% if 'val4' not in __.varname %}\nval4 is not a valid value\n{% endif %}\n"
|
||||
option_2 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_4 = StrOption(name="var1", doc="var1", default=Calculation(func['calc_value'], Params((ParamSuffix()))), properties=frozenset({"mandatory", "standard"}))
|
||||
option_5 = StrOption(name="var2", doc="var2", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), properties=frozenset({"mandatory", "standard"}))
|
||||
option_6 = StrOption(name="var3", doc="var3", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), properties=frozenset({"mandatory", "standard"}))
|
||||
option_7 = StrOption(name="var4", doc="var4", default=Calculation(func['calc_value'], Params((ParamDynOption(option_4, ['val4'])))), properties=frozenset({"mandatory", "standard"}))
|
||||
option_7 = StrOption(name="var4", doc="var4", default=Calculation(func['calc_value'], Params((ParamDynOption(option_4, ['val4'])))), properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled")), kwargs={'__internal_jinja': ParamValue("disabled_rougail.{{ suffix }}_dyn.var4"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__.varname': ParamOption(option_2)}), help_function=func['jinja_to_property_help'])}))
|
||||
optiondescription_3 = ConvertDynOptionDescription(name="{{ suffix }}_dyn", doc="{{ suffix }}_dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_2)))), children=[option_4, option_5, option_6, option_7], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, optiondescription_3], properties=frozenset({"standard"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
||||
|
|
|
@ -5,11 +5,13 @@ load_functions('tests/dictionaries/../eosfunc/test.py')
|
|||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
dict_env['disabled_1.rougail.{{ suffix }}_dyn.var4'] = "{% if 'val4' not in __.varname %}\nval4 is not a valid value\n{% endif %}\n"
|
||||
dict_env['disabled_2.rougail.{{ suffix }}_dyn.var4'] = "{% if 'val4' not in __.varname %}\nval4 is not a valid value\n{% endif %}\n"
|
||||
option_3 = StrOption(name="varname", doc="varname", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"}))
|
||||
option_5 = StrOption(name="var1", doc="var1", default=Calculation(func['calc_value'], Params((ParamSuffix()))), properties=frozenset({"mandatory", "standard"}))
|
||||
option_6 = StrOption(name="var2", doc="var2", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), properties=frozenset({"mandatory", "standard"}))
|
||||
option_7 = StrOption(name="var3", doc="var3", default=Calculation(func['calc_value'], Params((ParamOption(option_5)))), properties=frozenset({"mandatory", "standard"}))
|
||||
option_8 = StrOption(name="var4", doc="var4", default=Calculation(func['calc_value'], Params((ParamDynOption(option_5, ['val4'])))), properties=frozenset({"mandatory", "standard"}))
|
||||
option_8 = StrOption(name="var4", doc="var4", default=Calculation(func['calc_value'], Params((ParamDynOption(option_5, ['val4'])))), properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled")), kwargs={'__internal_jinja': ParamValue("disabled_1.rougail.{{ suffix }}_dyn.var4"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__.varname': ParamOption(option_3)}), help_function=func['jinja_to_property_help'])}))
|
||||
optiondescription_4 = ConvertDynOptionDescription(name="{{ suffix }}_dyn", doc="{{ suffix }}_dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_3)))), children=[option_5, option_6, option_7, option_8], properties=frozenset({"standard"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3, optiondescription_4], properties=frozenset({"standard"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||
|
@ -17,7 +19,7 @@ option_11 = StrOption(name="varname", doc="varname", multi=True, default=["val1"
|
|||
option_13 = StrOption(name="var1", doc="var1", default=Calculation(func['calc_value'], Params((ParamSuffix()))), properties=frozenset({"mandatory", "standard"}))
|
||||
option_14 = StrOption(name="var2", doc="var2", default=Calculation(func['calc_value'], Params((ParamOption(option_13)))), properties=frozenset({"mandatory", "standard"}))
|
||||
option_15 = StrOption(name="var3", doc="var3", default=Calculation(func['calc_value'], Params((ParamOption(option_13)))), properties=frozenset({"mandatory", "standard"}))
|
||||
option_16 = StrOption(name="var4", doc="var4", default=Calculation(func['calc_value'], Params((ParamDynOption(option_13, ['val4'])))), properties=frozenset({"mandatory", "standard"}))
|
||||
option_16 = StrOption(name="var4", doc="var4", default=Calculation(func['calc_value'], Params((ParamDynOption(option_13, ['val4'])))), properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled")), kwargs={'__internal_jinja': ParamValue("disabled_2.rougail.{{ suffix }}_dyn.var4"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__.varname': ParamOption(option_11)}), help_function=func['jinja_to_property_help'])}))
|
||||
optiondescription_12 = ConvertDynOptionDescription(name="{{ suffix }}_dyn", doc="{{ suffix }}_dyn", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_11)))), children=[option_13, option_14, option_15, option_16], properties=frozenset({"standard"}))
|
||||
optiondescription_10 = OptionDescription(name="rougail", doc="rougail", children=[option_11, optiondescription_12], properties=frozenset({"standard"}))
|
||||
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10], properties=frozenset({"standard"}))
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.version": {
|
||||
"owner": "default",
|
||||
"value": null
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.version": null
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.version": {
|
||||
"owner": "default",
|
||||
"value": null
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
["rougail.version"]
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": []
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.leader.leader": []
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.leader.leader": {
|
||||
"owner": "default",
|
||||
"value": []
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
["rougail.leader.leader"]
|
|
@ -6,7 +6,7 @@ general:
|
|||
mandatory: false
|
||||
default:
|
||||
type: jinja
|
||||
jinja: '{% if mode_conteneur_actif1 == ''non'' %}non{% else %}oui{% endif %}'
|
||||
jinja: "{% if mode_conteneur_actif1 == 'non' %}non{% else %}oui{% endif %}"
|
||||
mode_conteneur_actif1:
|
||||
type: string
|
||||
description: No change
|
||||
|
|
|
@ -4,7 +4,7 @@ my_var1:
|
|||
type: jinja
|
||||
jinja: '{{ rougail.my_var2 | calc_val }}'
|
||||
my_var2:
|
||||
default: 'no'
|
||||
default: no
|
||||
server_deployed:
|
||||
type: boolean
|
||||
default: false
|
||||
|
|
|
@ -5,7 +5,7 @@ general:
|
|||
mandatory: false
|
||||
default:
|
||||
type: jinja
|
||||
jinja: '{{ "quote''" | calc_val }}'
|
||||
jinja: "{{ \"quote'\" | calc_val }}"
|
||||
mode_conteneur_actif1:
|
||||
type: string
|
||||
description: No change
|
||||
|
@ -19,12 +19,12 @@ general:
|
|||
mandatory: false
|
||||
default:
|
||||
type: jinja
|
||||
jinja: '{{ "quote\"''" | calc_val }}'
|
||||
jinja: "{{ \"quote\\\"'\" | calc_val }}"
|
||||
mode_conteneur_actif3:
|
||||
type: string
|
||||
description: No change
|
||||
mandatory: false
|
||||
default:
|
||||
type: jinja
|
||||
jinja: '{{ "quote\"\\''" | calc_val }}'
|
||||
jinja: "{{ \"quote\\\"\\\\'\" | calc_val }}"
|
||||
version: '1.1'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
general:
|
||||
mode_conteneur_actif:
|
||||
test:
|
||||
- null
|
||||
-
|
||||
- test1
|
||||
- test2
|
||||
default: non
|
||||
|
|
|
@ -2,5 +2,5 @@ general:
|
|||
mode_conteneur_actif:
|
||||
redefine: true
|
||||
test:
|
||||
- null
|
||||
-
|
||||
version: '1.1'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
var1:
|
||||
default: 'no'
|
||||
default: no
|
||||
var2:
|
||||
multi: true
|
||||
mandatory: false
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
var1:
|
||||
multi: true
|
||||
default:
|
||||
- 'no'
|
||||
- 'yes'
|
||||
- no
|
||||
- yes
|
||||
- maybe
|
||||
var2:
|
||||
multi: true
|
||||
|
|
|
@ -8,7 +8,7 @@ general:
|
|||
description: No change
|
||||
hidden: true
|
||||
default: non
|
||||
disabled:
|
||||
disabled: &id001
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}'
|
||||
mode_conteneur_actif2:
|
||||
|
@ -16,7 +16,5 @@ general:
|
|||
description: No change
|
||||
hidden: true
|
||||
default: non
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}'
|
||||
disabled: *id001
|
||||
version: '1.1'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
general:
|
||||
condition:
|
||||
type: string
|
||||
default: 'no'
|
||||
default: no
|
||||
variable1:
|
||||
type: string
|
||||
mandatory: false
|
||||
|
|
|
@ -8,7 +8,7 @@ general:
|
|||
description: No change
|
||||
hidden: true
|
||||
default: non
|
||||
disabled:
|
||||
disabled: &id001
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition
|
||||
== "maybe" %}disabled{% endif %}'
|
||||
|
@ -17,8 +17,5 @@ general:
|
|||
description: No change
|
||||
hidden: true
|
||||
default: non
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition
|
||||
== "maybe" %}disabled{% endif %}'
|
||||
disabled: *id001
|
||||
version: '1.1'
|
||||
|
|
|
@ -2,16 +2,16 @@ general:
|
|||
condition:
|
||||
type: string
|
||||
description: No change
|
||||
default: 'no'
|
||||
default: no
|
||||
condition2:
|
||||
type: string
|
||||
description: No change
|
||||
default: 'no'
|
||||
default: no
|
||||
test_variable:
|
||||
type: string
|
||||
description: No change
|
||||
hidden: true
|
||||
default: 'no'
|
||||
default: no
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition2 == "yes" or rougail.general.condition2
|
||||
|
|
|
@ -2,16 +2,16 @@ general:
|
|||
condition:
|
||||
type: string
|
||||
description: No change
|
||||
default: 'no'
|
||||
default: no
|
||||
condition2:
|
||||
type: string
|
||||
description: No change
|
||||
default: 'no'
|
||||
default: no
|
||||
test_variable:
|
||||
type: string
|
||||
description: No change
|
||||
hidden: true
|
||||
default: 'no'
|
||||
default: no
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition2 == "yes" or rougail.general.condition2
|
||||
|
|
|
@ -2,16 +2,16 @@ general:
|
|||
condition:
|
||||
type: string
|
||||
description: No change
|
||||
default: 'yes'
|
||||
default: yes
|
||||
condition2:
|
||||
type: string
|
||||
description: No change
|
||||
default: 'no'
|
||||
default: no
|
||||
test_variable:
|
||||
type: string
|
||||
description: No change
|
||||
hidden: true
|
||||
default: 'no'
|
||||
default: no
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition2 == "yes" or rougail.general.condition2
|
||||
|
|
|
@ -2,16 +2,16 @@ general:
|
|||
condition:
|
||||
type: string
|
||||
description: No change
|
||||
default: 'yes'
|
||||
default: yes
|
||||
condition2:
|
||||
type: string
|
||||
description: No change
|
||||
default: 'yes'
|
||||
default: yes
|
||||
test_variable:
|
||||
type: string
|
||||
description: No change
|
||||
hidden: true
|
||||
default: 'no'
|
||||
default: no
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition2 == "yes" or rougail.general.condition2
|
||||
|
|
|
@ -2,16 +2,16 @@ general:
|
|||
condition:
|
||||
type: string
|
||||
description: No change
|
||||
default: 'no'
|
||||
default: no
|
||||
condition2:
|
||||
type: string
|
||||
description: No change
|
||||
default: 'yes'
|
||||
default: yes
|
||||
test_variable:
|
||||
type: string
|
||||
description: No change
|
||||
hidden: true
|
||||
default: 'no'
|
||||
default: no
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition2 == "yes" or rougail.general.condition2
|
||||
|
|
|
@ -8,7 +8,7 @@ general:
|
|||
description: No change
|
||||
hidden: true
|
||||
default: non
|
||||
disabled:
|
||||
disabled: &id001
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition
|
||||
== "maybe" %}disabled{% endif %}'
|
||||
|
@ -17,8 +17,5 @@ general:
|
|||
description: No change
|
||||
hidden: true
|
||||
default: non
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition
|
||||
== "maybe" %}disabled{% endif %}'
|
||||
disabled: *id001
|
||||
version: '1.1'
|
||||
|
|
|
@ -8,7 +8,7 @@ general:
|
|||
description: No change
|
||||
hidden: true
|
||||
default: non
|
||||
disabled:
|
||||
disabled: &id001
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == null %}disabled{% endif %}'
|
||||
mode_conteneur_actif2:
|
||||
|
@ -16,7 +16,5 @@ general:
|
|||
description: No change
|
||||
hidden: true
|
||||
default: non
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == null %}disabled{% endif %}'
|
||||
disabled: *id001
|
||||
version: '1.1'
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
my_var1:
|
||||
default: 'no'
|
||||
default: no
|
||||
my_var2:
|
||||
default: 'no'
|
||||
default: no
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.my_var1 == "no" %}disabled{% endif %}'
|
||||
my_var3:
|
||||
default: 'no'
|
||||
default: no
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.my_var2 == "no" %}disabled{% endif %}'
|
||||
|
|
|
@ -2,11 +2,11 @@ general:
|
|||
condition:
|
||||
type: string
|
||||
description: No change
|
||||
default: 'no'
|
||||
default: no
|
||||
disable_variable:
|
||||
type: string
|
||||
description: No change
|
||||
default: 'no'
|
||||
default: no
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: '{% if __unknown == "no" %}{% else %}disabled{% endif %}'
|
||||
|
|
|
@ -7,14 +7,12 @@ general:
|
|||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
disabled:
|
||||
disabled: &id001
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}'
|
||||
mode_conteneur_actif2:
|
||||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
disabled:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}disabled{% endif %}'
|
||||
disabled: *id001
|
||||
version: '1.1'
|
||||
|
|
|
@ -7,14 +7,12 @@ general:
|
|||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
hidden:
|
||||
hidden: &id001
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}'
|
||||
mode_conteneur_actif2:
|
||||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
hidden:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}'
|
||||
hidden: *id001
|
||||
version: '1.1'
|
||||
|
|
|
@ -9,14 +9,12 @@ general:
|
|||
default:
|
||||
type: jinja
|
||||
jinja: '{{ "non" | calc_val }}'
|
||||
hidden:
|
||||
hidden: &id001
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}'
|
||||
mode_conteneur_actif2:
|
||||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
hidden:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}'
|
||||
hidden: *id001
|
||||
version: '1.1'
|
||||
|
|
|
@ -11,7 +11,7 @@ general:
|
|||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
hidden:
|
||||
hidden: &id001
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "tous" or rougail.general.condition
|
||||
== "authentifié" %}hidden{% endif %}'
|
||||
|
@ -19,8 +19,5 @@ general:
|
|||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
hidden:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "tous" or rougail.general.condition
|
||||
== "authentifié" %}hidden{% endif %}'
|
||||
hidden: *id001
|
||||
version: '1.1'
|
||||
|
|
|
@ -10,7 +10,7 @@ general:
|
|||
mode_conteneur_actif:
|
||||
type: string
|
||||
description: No change
|
||||
hidden:
|
||||
hidden: &id001
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition
|
||||
== "non" %}hidden{% endif %}'
|
||||
|
@ -18,9 +18,6 @@ general:
|
|||
mode_conteneur_actif2:
|
||||
type: string
|
||||
description: No change
|
||||
hidden:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition
|
||||
== "non" %}hidden{% endif %}'
|
||||
hidden: *id001
|
||||
default: non
|
||||
version: '1.1'
|
||||
|
|
|
@ -7,7 +7,7 @@ general:
|
|||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
hidden:
|
||||
hidden: &id001
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}{% else %}hidden{% endif
|
||||
%}'
|
||||
|
@ -15,8 +15,5 @@ general:
|
|||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
hidden:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}{% else %}hidden{% endif
|
||||
%}'
|
||||
hidden: *id001
|
||||
version: '1.1'
|
||||
|
|
|
@ -11,7 +11,7 @@ general:
|
|||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
hidden:
|
||||
hidden: &id001
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition
|
||||
== "non" %}{% else %}hidden{% endif %}'
|
||||
|
@ -19,8 +19,5 @@ general:
|
|||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
hidden:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition
|
||||
== "non" %}{% else %}hidden{% endif %}'
|
||||
hidden: *id001
|
||||
version: '1.1'
|
||||
|
|
|
@ -8,19 +8,15 @@ general:
|
|||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
hidden:
|
||||
hidden: &id001
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}'
|
||||
mode_conteneur_actif2:
|
||||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
hidden:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}'
|
||||
hidden: *id001
|
||||
general2:
|
||||
description: Général2
|
||||
hidden:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}'
|
||||
hidden: *id001
|
||||
version: '1.1'
|
||||
|
|
|
@ -8,16 +8,14 @@ general:
|
|||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
hidden:
|
||||
hidden: &id001
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}'
|
||||
mode_conteneur_actif2:
|
||||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
hidden:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}'
|
||||
hidden: *id001
|
||||
general2:
|
||||
description: Général2
|
||||
mode_conteneur_actif3:
|
||||
|
@ -25,7 +23,5 @@ general2:
|
|||
description: No change
|
||||
hidden: true
|
||||
default: non
|
||||
hidden:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}hidden{% endif %}'
|
||||
hidden: *id001
|
||||
version: '1.1'
|
||||
|
|
|
@ -7,14 +7,12 @@ general:
|
|||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
mandatory:
|
||||
mandatory: &id001
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}mandatory{% endif %}'
|
||||
mode_conteneur_actif2:
|
||||
type: string
|
||||
description: No change
|
||||
default: non
|
||||
mandatory:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" %}mandatory{% endif %}'
|
||||
mandatory: *id001
|
||||
version: '1.1'
|
||||
|
|
|
@ -12,7 +12,7 @@ general:
|
|||
description: No change
|
||||
hidden: true
|
||||
default: non
|
||||
mandatory:
|
||||
mandatory: &id001
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition
|
||||
== "non" %}{% else %}mandatory{% endif %}'
|
||||
|
@ -21,8 +21,5 @@ general:
|
|||
description: No change
|
||||
hidden: true
|
||||
default: non
|
||||
mandatory:
|
||||
type: jinja
|
||||
jinja: '{% if rougail.general.condition == "oui" or rougail.general.condition
|
||||
== "non" %}{% else %}mandatory{% endif %}'
|
||||
mandatory: *id001
|
||||
version: '1.1'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
enumfam:
|
||||
enumvar:
|
||||
redefine: true
|
||||
validators: null
|
||||
validators:
|
||||
default: c
|
||||
choices:
|
||||
- a
|
||||
|
|
|
@ -15,5 +15,5 @@ enumfam:
|
|||
choices:
|
||||
- a
|
||||
- b
|
||||
- null
|
||||
-
|
||||
version: '1.1'
|
||||
|
|
|
@ -4,7 +4,7 @@ enumfam:
|
|||
type: choice
|
||||
description: multi
|
||||
help: bla bla bla
|
||||
default: null
|
||||
default:
|
||||
choices:
|
||||
- null
|
||||
-
|
||||
version: '1.1'
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue