WIP: Expand the developer documentation #27
8 changed files with 112 additions and 1 deletions
|
|
@ -68,7 +68,7 @@ def to_dict_family(family_name, paths, parents, families, root=True):
|
|||
raise DictConsistencyError(_("type is not compatible with dynamic family"), variable.xmlfiles)
|
||||
if variable_name in ret:
|
||||
ret["_" + variable_name] = ret.pop(variable_name)
|
||||
ret[variable_name] = to_dict_family(variable_name, paths, parents, families, False)
|
||||
ret[variable_name] = to_dict_family(variable.path, paths, parents, families, False)
|
||||
else:
|
||||
ret[variable_name] = to_dict_variable(variable, False)
|
||||
return ret
|
||||
|
|
|
|||
25
tests/types/result/family_subfamily/tiramisu.py
Normal file
25
tests/types/result/family_subfamily/tiramisu.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
from re import compile as re_compile
|
||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||
try:
|
||||
groups.namespace
|
||||
except:
|
||||
groups.addgroup('namespace')
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
option_3 = StrOption(name="a_first_variable", doc="a first variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml'], 'type': 'string'})
|
||||
option_5 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml'], 'type': 'string'})
|
||||
optiondescription_4 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_5], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
||||
optiondescription_2 = OptionDescription(name="my_family_1", doc="My family type", children=[option_3, optiondescription_4], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
||||
option_7 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml'], 'type': 'string'})
|
||||
option_9 = StrOption(name="a_second_variable", doc="a second variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml'], 'type': 'string'})
|
||||
optiondescription_8 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_9], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml']})
|
||||
optiondescription_6 = OptionDescription(name="my_family_2", doc="My family type", children=[option_7, optiondescription_8], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
||||
option_11 = StrOption(name="a_first_variable", doc="a first variable", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml'], 'type': 'string'})
|
||||
option_13 = StrOption(name="a_second_variable", doc="a second variable", default="a modified value 2", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml'], 'type': 'string'})
|
||||
optiondescription_12 = OptionDescription(name="a_sub_family", doc="My subfamily", children=[option_13], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
||||
optiondescription_10 = OptionDescription(name="my_family_3", doc="My family type", children=[option_11, optiondescription_12], properties=frozenset({"standard"}), informations={'ymlfiles': ['tests/types/types/family_subfamily/00_structure.yml', 'tests/types/structures/family_subfamily/00_structure.yml']})
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", group_type=groups.namespace, children=[optiondescription_2, optiondescription_6, optiondescription_10], properties=frozenset({"basic"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
||||
8
tests/types/result/family_subfamily/variables.json
Normal file
8
tests/types/result/family_subfamily/variables.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"rougail.my_family_1.a_first_variable": "a modified value",
|
||||
"rougail.my_family_1.a_sub_family.a_second_variable": "a modified value",
|
||||
"rougail.my_family_2.a_first_variable": "a value",
|
||||
"rougail.my_family_2.a_sub_family.a_second_variable": null,
|
||||
"rougail.my_family_3.a_first_variable": "a value",
|
||||
"rougail.my_family_3.a_sub_family.a_second_variable": "a modified value 2"
|
||||
}
|
||||
23
tests/types/structures/family_subfamily/00_structure.yml
Normal file
23
tests/types/structures/family_subfamily/00_structure.yml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
%YAML 1.2
|
||||
---
|
||||
version: 1.1
|
||||
|
||||
my_family_1:
|
||||
type: my_family_type
|
||||
|
||||
a_first_variable: a modified value
|
||||
|
||||
a_sub_family:
|
||||
|
||||
a_second_variable: a modified value
|
||||
|
||||
my_family_2:
|
||||
type: my_family_type
|
||||
|
||||
my_family_3:
|
||||
type: my_family_type
|
||||
|
||||
a_sub_family:
|
||||
|
||||
a_second_variable: a modified value 2
|
||||
...
|
||||
19
tests/types/structures/variable_hidden/00_structure.yml
Normal file
19
tests/types/structures/variable_hidden/00_structure.yml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
%YAML 1.2
|
||||
---
|
||||
version: 1.1
|
||||
|
||||
my_family_1:
|
||||
type: my_family_type
|
||||
|
||||
a_first_variable: a modified value
|
||||
|
||||
a_second_variable: a modified value
|
||||
|
||||
my_family_2:
|
||||
type: my_family_type
|
||||
|
||||
my_family_3:
|
||||
type: my_family_type
|
||||
|
||||
a_second_variable: a modified value 2
|
||||
...
|
||||
10
tests/types/types/family_redefine/00_structure.yml
Normal file
10
tests/types/types/family_redefine/00_structure.yml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
%YAML 1.2
|
||||
---
|
||||
version: 1.1
|
||||
|
||||
my_family_type: # My family type
|
||||
|
||||
a_first_variable: a value # a first variable
|
||||
|
||||
a_second_variable: # a second variable
|
||||
...
|
||||
12
tests/types/types/family_subfamily/00_structure.yml
Normal file
12
tests/types/types/family_subfamily/00_structure.yml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
%YAML 1.2
|
||||
---
|
||||
version: 1.1
|
||||
|
||||
my_family_type: # My family type
|
||||
|
||||
a_first_variable: a value # a first variable
|
||||
|
||||
a_sub_family: # My subfamily
|
||||
|
||||
a_second_variable: # a second variable
|
||||
...
|
||||
14
tests/types/types/variable_hidden/00_structure.yml
Normal file
14
tests/types/types/variable_hidden/00_structure.yml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
%YAML 1.2
|
||||
---
|
||||
version: 1.1
|
||||
|
||||
my_family_type: # My family type
|
||||
|
||||
a_first_variable: a value # a first variable
|
||||
|
||||
a_second_variable:
|
||||
description: a second variable
|
||||
hidden:
|
||||
variable: _.a_first_variable
|
||||
when_not: a value
|
||||
...
|
||||
Loading…
Reference in a new issue