Compare commits

..

No commits in common. "8f81df6909c34b9fb5a0bb299d8e7c6dd997e2dc" and "8d6cf62204fbff952acb41657e23986f023a7c81" have entirely different histories.

46 changed files with 195 additions and 415 deletions

View file

@ -1,14 +1,3 @@
## 1.2.0a43 (2025-11-21)
### Feat
- add boolean return_type in validators
### Fix
- better rougailconfig copy
- port is a string
## 1.2.0a42 (2025-11-06)
### Feat

View file

@ -5,8 +5,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2025-11-21 08:31+0100\n"
"PO-Revision-Date: 2025-11-21 08:31+0100\n"
"POT-Creation-Date: 2025-11-06 21:31+0100\n"
"PO-Revision-Date: 2025-11-06 21:32+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
@ -14,7 +14,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 3.8\n"
"X-Generator: Poedit 3.7\n"
#: src/rougail/annotator/family.py:151
msgid "default variable mode \"{0}\" is not a valid mode, valid modes are {1}"
@ -72,7 +72,7 @@ msgstr ""
"la variable \"{0}\" est dans le mode \"{1}\" mais la famille a le mode "
"supérieur \"{2}\""
#: src/rougail/annotator/property.py:161
#: src/rougail/annotator/property.py:158
msgid ""
"invalid tag name \"{0}\" should only contains lowercase ascii character, "
"number or _"
@ -80,12 +80,12 @@ msgstr ""
"nom de l'étiquette invalide \"{0}\" doit seulement contenir des caractères "
"ascii minuscule, nombre or _"
#: src/rougail/annotator/property.py:166
#: src/rougail/annotator/property.py:163
msgid "invalid tag name \"{0}\" should not be a name of an existing mode"
msgstr ""
"nom de l'étiquette invalide \"{0}\" ne doit pas être un nom de mode existant"
#: src/rougail/annotator/property.py:171
#: src/rougail/annotator/property.py:168
msgid ""
"invalid tag name \"{0}\" should not be the name of an available properties"
msgstr ""
@ -114,7 +114,7 @@ msgid "the variable \"{0}\" is a \"regexp\" variable but don't have any regexp"
msgstr ""
"la variable \"{0}\" a une variable \"regexp\" mais n'a pas de \"regexp\""
#: src/rougail/annotator/variable.py:95
#: src/rougail/annotator/variable.py:89
msgid ""
"only \"unix_user\" or \"secret\" variable type can have \"secret_manager\" "
"attribute, but \"{0}\" has type \"{1}\""
@ -122,14 +122,14 @@ msgstr ""
"seul une variable de type \"unix_user\" ou \"secret\" peut avoir l'attribut "
"\"secret_manager\", mais \"{0}\" a le type \"{1}\""
#: src/rougail/annotator/variable.py:102
#: src/rougail/annotator/variable.py:96
msgid ""
"the variable \"{0}\" has attribute \"secret_manager\" but is a multi variable"
msgstr ""
"la variable \"{0}\" a l'attribut \"secret_manager\" mais est une variable "
"multiple"
#: src/rougail/annotator/variable.py:107
#: src/rougail/annotator/variable.py:101
msgid ""
"the variable \"{0}\" has attribute \"secret_manager\" so must not have "
"default value"
@ -137,49 +137,49 @@ msgstr ""
"la variable \"{0}\" a l'attribut \"secret_manager\" donc ne devrait pas "
"avoir de valeur par défaut"
#: src/rougail/annotator/variable.py:161
#: src/rougail/annotator/variable.py:154
msgid "{0} values needed, but there are {{{{ var | length }}}}"
msgstr "il faut {0} valeurs, mais il y en a {{{{ var | length }}}}"
#: src/rougail/annotator/variable.py:162
#: src/rougail/annotator/variable.py:155
msgid "needs exactly {0} values"
msgstr "nécessite exactement {0} valeurs"
#: src/rougail/annotator/variable.py:164
#: src/rougail/annotator/variable.py:157
msgid ""
"a maximum of {0} values are needed, but there are {{{{ var | length }}}}"
msgstr "il faut au maximum {0} valeurs, mais il y en a {{{{ var | length }}}}"
#: src/rougail/annotator/variable.py:165
#: src/rougail/annotator/variable.py:158
msgid "needs a maximum of {0} values"
msgstr "nécessite au maximum {0} valeurs"
#: src/rougail/annotator/variable.py:169
#: src/rougail/annotator/variable.py:160
msgid ""
"a minimum of {0} values are needed, but there are {{{{ var | length }}}}"
msgstr "il faut au minimum {0} valeurs, mais il y en a {{{{ var | length }}}}"
#: src/rougail/annotator/variable.py:170
#: src/rougail/annotator/variable.py:161
msgid "needs a minimum of {0} values"
msgstr "nécessite au minimum {0} valeurs"
#: src/rougail/annotator/variable.py:247
#: src/rougail/annotator/variable.py:223
msgid "the \"{0}\" default value is a calculation with itself"
msgstr "la valeur par défaut \"{0}\" est un calcul avec elle-même"
#: src/rougail/annotator/variable.py:308
#: src/rougail/annotator/variable.py:285
msgid ""
"the variable \"{0}\" has regexp attribut but has not the \"regexp\" type"
msgstr ""
"la variable \"{0}\" a un attribut regexp mais n'a pas le type \"regexp\""
#: src/rougail/annotator/variable.py:351
#: src/rougail/annotator/variable.py:328
msgid ""
"the variable \"{0}\" has choices attribut but has not the \"choice\" type"
msgstr ""
"la variable \"{0}\" a un attribut choices mais n'a pas le type \"choice\""
#: src/rougail/annotator/variable.py:379
#: src/rougail/annotator/variable.py:356
msgid ""
"the variable \"{0}\" has an unvalid default value \"{1}\" should be in {2}"
msgstr ""
@ -269,27 +269,27 @@ msgstr "type {0} inconnu pour {1}"
msgid "family \"{0}\" define multiple time"
msgstr "la famille \"{0}\" est définit plusieurs fois"
#: src/rougail/convert/convert.py:673
#: src/rougail/convert/convert.py:672
msgid "variable \"{0}\" define multiple time"
msgstr "la variable \"{0}\" est définit plusieurs fois"
#: src/rougail/convert/convert.py:771
#: src/rougail/convert/convert.py:770
msgid "params must be a dict for {0}"
msgstr "params doit être une dict pour {0}"
#: src/rougail/convert/convert.py:792
#: src/rougail/convert/convert.py:791
msgid "\"{0}\" has an invalid \"params\" for {1}: {2}"
msgstr "\"{0}\" a un attribut \"params\" invalide pour {1}: {2}"
#: src/rougail/convert/convert.py:806
#: src/rougail/convert/convert.py:805
msgid "secret_manager must be a dict for {0}"
msgstr "secret_manager doit être une dict pour {0}"
#: src/rougail/convert/convert.py:1135
#: src/rougail/convert/convert.py:1134
msgid "Cannot execute annotate multiple time"
msgstr "Ne peut exécuter l'annotation plusieurs fois"
#: src/rougail/convert/convert.py:1142
#: src/rougail/convert/convert.py:1141
msgid ""
"invalid \"structural\" definition ({0}), we cannot load any structural file!"
msgstr ""
@ -310,7 +310,7 @@ msgstr ""
"\"{2}\""
#: src/rougail/convert/object_model.py:132
#: src/rougail/convert/object_model.py:513
#: src/rougail/convert/object_model.py:484
msgid "unknown object \"{0}\" in attribute \"{1}\" for \"{2}\""
msgstr "objet inconnu \"{0}\" dans l'attribut \"{1}\" pour \"{2}\""
@ -347,16 +347,7 @@ msgstr ""
"\"warnings\" est seulement utilisable avec l'attribut \"{self.attribute_name}"
"\" pour la variable \"{self.ori_path}\""
#: src/rougail/convert/object_model.py:314
msgid ""
"the variable \"{0}\" has a depreciated return_type \"{1}\", please use "
"\"{2}\" instead in \"{3}\""
msgstr ""
"la variable \"{0}\" a un attribut return_type déprécié \"{1}\", veuillez "
"utiliser\"{2}\" au lieu de \"{3}\""
#: src/rougail/convert/object_model.py:404
#: src/rougail/convert/object_model.py:435
#: src/rougail/convert/object_model.py:410
msgid ""
"variable \"{0}\" has a calculating \"{1}\" with an invalid return_type, "
"should be boolean or string, not \"{2}\""
@ -364,19 +355,7 @@ msgstr ""
"la variable \"{0}\" a un calcul \"{1}\" avec un return_type invalide, "
"devrait être un booléen ou une chaîne de caractère, et pas \"{2}\""
#: src/rougail/convert/object_model.py:411
msgid ""
"the variable \"{0}\" has a return_type \"{1}\", for attribute \"{2}\" but "
"has not description in {3}"
msgstr ""
"la variable \"{0}\" a un return_type \"{1}\", pour l'attribut \"{2}\" mais "
"n'a pas de description dans {3}"
#: src/rougail/convert/object_model.py:416
msgid "value is invalid"
msgstr "la valeur est invalide"
#: src/rougail/convert/object_model.py:508
#: src/rougail/convert/object_model.py:479
msgid ""
"a variable \"{0}\" is needs in attribute \"{1}\" for \"{2}\" but it's a "
"family"
@ -384,7 +363,7 @@ msgstr ""
"une variable \"{0}\" est nécessaire pour l'attribut \"{1}\" pour \"{2}\" "
"mais c'est une famille"
#: src/rougail/convert/object_model.py:533
#: src/rougail/convert/object_model.py:504
msgid ""
"variable \"{0}\" has an attribute \"{1}\" calculated with the unknown "
"variable \"{2}\""
@ -392,7 +371,7 @@ msgstr ""
"la variable \"{0}\" a un attribut invalide \"{1}\" calculé avec la variable "
"inconnue \"{2}\""
#: src/rougail/convert/object_model.py:585
#: src/rougail/convert/object_model.py:556
msgid ""
"the variable \"{0}\" has an invalid \"{1}\" the variable \"{2}\" is in a sub "
"dynamic option"
@ -400,14 +379,14 @@ msgstr ""
"la variable \"{0}\" a un attribut invalide \"{1}\", la variable \"{2}\" est "
"dans une sous option dynamique"
#: src/rougail/convert/object_model.py:594
#: src/rougail/convert/object_model.py:565
msgid ""
"the leader \"{0}\" has an invalid \"{1}\" the follower \"{2}\" is a multi"
msgstr ""
"la variable meneuse \"{0}\" a un attribut invalide \"{1}\", la variable "
"suiveuse \"{2}\" est multiple"
#: src/rougail/convert/object_model.py:636
#: src/rougail/convert/object_model.py:607
msgid ""
"the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" "
"must not be multi"
@ -415,7 +394,7 @@ msgstr ""
"la variable \"{0}\" a un attribut invalide \"{1}\", la variable \"{2}\" ne "
"doit pas être multiple"
#: src/rougail/convert/object_model.py:650
#: src/rougail/convert/object_model.py:621
msgid ""
"the variable \"{0}\" has an invalid attribute \"{1}\", the variable must not "
"be a multi or the variable \"{2}\" must be multi"
@ -423,7 +402,7 @@ msgstr ""
"la variable \"{0}\" a un attribut invalide \"{1}\", la variable ne doit pas "
"être multiple ou la variable \"{2}\" doit être multiple"
#: src/rougail/convert/object_model.py:664
#: src/rougail/convert/object_model.py:635
msgid ""
"the variable \"{0}\" has an invalid attribute \"{1}\", the variable must be "
"a multi or the variable \"{2}\" must not be multi"
@ -431,7 +410,7 @@ msgstr ""
"la variable \"{0}\" a un attribut invalide \"{1}\", la variable doit être "
"multiple ou la variable \"{2}\" ne doit pas être multiple"
#: src/rougail/convert/object_model.py:678
#: src/rougail/convert/object_model.py:649
msgid ""
"the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" "
"is multi but is inside a list"
@ -439,7 +418,7 @@ msgstr ""
"la variable \"{0}\" a un attribut invalide \"{1}\", la variable \"{2}\" est "
"multiple mais est dans une liste"
#: src/rougail/convert/object_model.py:700
#: src/rougail/convert/object_model.py:671
msgid ""
"the variable \"{0}\" is waiting for a list as \"{1}\" but the attribute "
"\"default\" is not a list (\"{2}\")"
@ -447,7 +426,7 @@ msgstr ""
"la variable \"{0}\" attend une liste comme \"{1}\" mais l'attribut "
"\"default\" n'est pas une liste \"{2}\""
#: src/rougail/convert/object_model.py:704
#: src/rougail/convert/object_model.py:673
msgid ""
"the variable \"{0}\" is not waiting for a list as \"{1}\" but the attribute "
"\"default\" is a list (\"{2}\")"
@ -455,7 +434,7 @@ msgstr ""
"la variable \"{0}\" n'attend pas une liste comme \"{1}\" mais l'attribut "
"\"default\" est une liste \"{2}\""
#: src/rougail/convert/object_model.py:726
#: src/rougail/convert/object_model.py:689
msgid ""
"\"{0}\" attribut shall not have an \"optional\" attribute without the "
"\"default\" attribute for variable \"{1}\""
@ -463,7 +442,7 @@ msgstr ""
"l'attribut \"{0}\" ne devrait pas avoir d'attribut \"optional\" sans "
"l'attribut \"default\" pour la variable \"{1}\""
#: src/rougail/convert/object_model.py:748
#: src/rougail/convert/object_model.py:713
msgid ""
"variable \"{0}\" has a default value calculated with \"{1}\" which has "
"incompatible type"
@ -471,7 +450,7 @@ msgstr ""
"la variable \"{0}\" a une valeur par défaut calculé a partir de \"{1}\" "
"laquelle a un type incompatible"
#: src/rougail/convert/object_model.py:790
#: src/rougail/convert/object_model.py:756
msgid ""
"the variable \"{0}\" is waiting for a boolean as \"{1}\" but the attribute "
"\"default\" is not a boolean (\"{2}\")"
@ -479,7 +458,7 @@ msgstr ""
"la variable \"{0}\" attend un booléan comme \"{1}\" mais l'attribut "
"\"default\" n'est pas une booléan (\"{2}\")"
#: src/rougail/convert/object_model.py:812
#: src/rougail/convert/object_model.py:776
msgid ""
"\"when\" is not allowed in format version 1.0 for attribute \"{0}\" for "
"variable \"{1}\""
@ -487,7 +466,7 @@ msgstr ""
"\"when\" n'est pas autorisé avec le format en version 1.0 pour l'attribut "
"\"{0}\" pour la variable \"{1}\""
#: src/rougail/convert/object_model.py:817
#: src/rougail/convert/object_model.py:781
msgid ""
"the variable \"{0}\" has an invalid attribute \"{1}\", \"when\" and "
"\"when_not\" cannot set together"
@ -495,7 +474,7 @@ msgstr ""
"la variable \"{0}\" a un attribut invalide \"{1}\", \"when\" et \"when_not\" "
"ne peuvent pas être défini ensemble"
#: src/rougail/convert/object_model.py:825
#: src/rougail/convert/object_model.py:789
msgid ""
"\"when_not\" is not allowed in format version 1.0 for attribute \"{0}\" for "
"variable \"{1}\""
@ -503,7 +482,7 @@ msgstr ""
"\"when_not\" n'est pas autorisé au format 1.0 pour l'attribut \"{0}\" pour "
"la variable variable \"{1}\""
#: src/rougail/convert/object_model.py:881
#: src/rougail/convert/object_model.py:845
msgid ""
"cannot find variable \"{0}\" for the information \"{1}\" when calculating "
"\"{2}\""
@ -511,19 +490,19 @@ msgstr ""
"ne peut trouver la variable \"{0}\" pour l'information \"{1}\" lors du "
"calcul de \"{2}\""
#: src/rougail/convert/object_model.py:886
#: src/rougail/convert/object_model.py:850
msgid ""
"identifier not allowed for the information \"{0}\" when calculating \"{1}\""
msgstr ""
"identifier n'est pas autorisé pour l'information \"{0}\" lors du calcul de "
"\"{1}\""
#: src/rougail/convert/object_model.py:938
#: src/rougail/convert/object_model.py:902
msgid "\"when\" is not allowed in format version 1.0 for attribute \"{0}\""
msgstr "\"when\" n'est pas autorisé au format 1.0 pour l'attribut \"{0}\""
#: src/rougail/convert/object_model.py:944
#: src/rougail/convert/object_model.py:954
#: src/rougail/convert/object_model.py:908
#: src/rougail/convert/object_model.py:918
msgid ""
"the identifier has an invalid attribute \"{0}\", \"when\" and \"when_not\" "
"cannot set together"
@ -531,7 +510,7 @@ msgstr ""
"l'identifiant a un attribut invalide \"{0}\", \"when\" et \"when_not\" ne "
"peuvent pas être défini ensemble"
#: src/rougail/convert/object_model.py:980
#: src/rougail/convert/object_model.py:944
msgid ""
"the variable \"{0}\" is not a follower, so cannot have index type for \"{1}\""
msgstr ""
@ -546,12 +525,12 @@ msgstr ""
"Une variable ou une famille localisé dans l'espace de nom \"{0}\" ne devrait "
"pas être utilisé dans l'espace de nom \"{1}\""
#: src/rougail/convert/tiramisureflector.py:353
#: src/rougail/convert/tiramisureflector.py:352
msgid "internal error, {0} is not a dynamic variable"
msgstr "erreur interne, \"{0}\" n'est pas une variable dynamique"
#: src/rougail/error.py:61 src/rougail/tiramisu.py:162
#: src/rougail/user_datas.py:412 src/rougail/user_datas.py:415
#: src/rougail/error.py:61 src/rougail/tiramisu.py:157
#: src/rougail/user_datas.py:407 src/rougail/user_datas.py:410
msgid "{0} in {1}"
msgstr "{0} dans {1}"
@ -563,7 +542,7 @@ msgstr "alternative_name \"{0}\" est en conflit avec \"--help\""
msgid "conflict alternative_name \"{0}\": \"{1}\" and \"{2}\""
msgstr "conflit dans les \"alternative_name\" \"{0}\": \"{1}\" et \"{2}\""
#: src/rougail/structural_directory/__init__.py:130
#: src/rougail/structural_directory/__init__.py:129
msgid "duplicate structural file name {0}"
msgstr "nom de fichier {0} de structure dupliqué"
@ -597,11 +576,11 @@ msgstr ""
"Répertoires où sont placés les fichiers de structure de l'espace de nom "
"supplémentaire"
#: src/rougail/tiramisu.py:83
#: src/rougail/tiramisu.py:78
msgid "unknown boolean value \"{0}\""
msgstr "valeur du booléen inconnue \"{0}\""
#: src/rougail/tiramisu.py:335
#: src/rougail/tiramisu.py:330
msgid ""
"cannot calculating \"{0}\" attribute for variable \"{1}\" in {2} with "
"parameters \"{3}\": {4}"
@ -616,17 +595,17 @@ msgstr ""
"ne peut charger la variable \"{0}\", l'identifiant \"{1}\" n'est pas valide "
"dans {2}"
#: src/rougail/user_datas.py:229
#: src/rougail/user_datas.py:228
msgid "the variable \"{0}\" contains secrets and should not be defined in {1}"
msgstr ""
"la variable \"{0}\" contient des secrets et ne devrait pas être défini dans "
"{1}"
#: src/rougail/user_datas.py:269
#: src/rougail/user_datas.py:268
msgid "loaded from {0}"
msgstr "chargée depuis {0}"
#: src/rougail/user_datas.py:311
#: src/rougail/user_datas.py:308
msgid ""
"cannot set the value \"{0}\" to the family {1}, it will be ignored when "
"loading from {2}"
@ -634,11 +613,11 @@ msgstr ""
"impossible de définir la valeur \"{0}\" à la famille {1}, elle sera ignorée "
"lors du chargement depuis {2}"
#: src/rougail/user_datas.py:322 src/rougail/user_datas.py:339
#: src/rougail/user_datas.py:319 src/rougail/user_datas.py:336
msgid "{0} loaded from {1}"
msgstr "{0} chargée depuis {1}"
#: src/rougail/user_datas.py:327
#: src/rougail/user_datas.py:324
msgid ""
"variable or family \"{0}\" does not exist, it will be ignored when loading "
"from {1}"
@ -646,7 +625,7 @@ msgstr ""
"la variable ou la famille \"{0}\" n'existe pas, elle sera ignorée lors du "
"chargement depuis {1}"
#: src/rougail/user_datas.py:333
#: src/rougail/user_datas.py:330
msgid ""
"\"{0}\" is the name of a dynamic family, it will be ignored when loading "
"from {1}"
@ -654,7 +633,7 @@ msgstr ""
"\"{0}\" est le nom d'une famille dynamique, il sera ignoré lors du "
"chargement depuis {1}"
#: src/rougail/user_datas.py:369
#: src/rougail/user_datas.py:364
msgid ""
"variable {0} at index \"{1}\" is {2}, it will be ignored when loading from "
"{3}"
@ -662,36 +641,36 @@ msgstr ""
"la variable {0} à l'index \"{1}\" est {2}, elle sera ignorée lors du "
"chargement depuis {3}"
#: src/rougail/user_datas.py:380
#: src/rougail/user_datas.py:375
msgid ""
"family {0} is {1}, {2} at index \"{3}\" will be ignored when loading from {4}"
msgstr ""
"la famille {0} est {1}, {2} à l'index \"{3}\" sera ignorée lors du "
"chargement depuis {4}"
#: src/rougail/user_datas.py:393
#: src/rougail/user_datas.py:388
msgid "variable {0} is {1}, it will be ignored when loading from {2}"
msgstr ""
"la variable {0} est {1}, elle sera ignorée lors du chargement depuis {2}"
#: src/rougail/user_datas.py:401
#: src/rougail/user_datas.py:396
msgid "family {0} is {1}, {2} will be ignored when loading from {3}"
msgstr "la famille {0} est {1}, {2} sera ignorée lors du chargement depuis {3}"
#: src/rougail/user_datas.py:421
#: src/rougail/user_datas.py:416
msgid ""
"the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it will "
"be ignored when loading from {5}"
msgstr ""
"la valeur \"{0}\" est un {1} invalide pour {2} à l'index \"{3}\", {4}, elle "
"la valeur \"{0}\" est un invalide {1} pour {2} à l'index \"{3}\", {4}, elle "
"sera ignorée lors du chargement depuis {5}"
#: src/rougail/user_datas.py:435
#: src/rougail/user_datas.py:430
msgid ""
"the value \"{0}\" is an invalid {1} for {2}, {3}, it will be ignored when "
"loading from {4}"
msgstr ""
"la valeur \"{0}\" est un {1} invalide pour {2}, {3}, elle sera ignorée lors "
"la valeur \"{0}\" est un invalide {1} pour {2}, {3}, elle sera ignorée lors "
"du chargement depuis {4}"
#: src/rougail/utils.py:56

View file

@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2025-11-21 08:31+0100\n"
"POT-Creation-Date: 2025-11-06 21:32+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -47,15 +47,15 @@ msgstr ""
msgid "the variable \"{0}\" is in \"{1}\" mode but family has the higher family mode \"{2}\""
msgstr ""
#: src/rougail/annotator/property.py:161
#: src/rougail/annotator/property.py:158
msgid "invalid tag name \"{0}\" should only contains lowercase ascii character, number or _"
msgstr ""
#: src/rougail/annotator/property.py:166
#: src/rougail/annotator/property.py:163
msgid "invalid tag name \"{0}\" should not be a name of an existing mode"
msgstr ""
#: src/rougail/annotator/property.py:171
#: src/rougail/annotator/property.py:168
msgid "invalid tag name \"{0}\" should not be the name of an available properties"
msgstr ""
@ -75,55 +75,55 @@ msgstr ""
msgid "the variable \"{0}\" is a \"regexp\" variable but don't have any regexp"
msgstr ""
#: src/rougail/annotator/variable.py:95
#: src/rougail/annotator/variable.py:89
msgid "only \"unix_user\" or \"secret\" variable type can have \"secret_manager\" attribute, but \"{0}\" has type \"{1}\""
msgstr ""
#: src/rougail/annotator/variable.py:102
#: src/rougail/annotator/variable.py:96
msgid "the variable \"{0}\" has attribute \"secret_manager\" but is a multi variable"
msgstr ""
#: src/rougail/annotator/variable.py:107
#: src/rougail/annotator/variable.py:101
msgid "the variable \"{0}\" has attribute \"secret_manager\" so must not have default value"
msgstr ""
#: src/rougail/annotator/variable.py:161
#: src/rougail/annotator/variable.py:154
msgid "{0} values needed, but there are {{{{ var | length }}}}"
msgstr ""
#: src/rougail/annotator/variable.py:162
#: src/rougail/annotator/variable.py:155
msgid "needs exactly {0} values"
msgstr ""
#: src/rougail/annotator/variable.py:164
#: src/rougail/annotator/variable.py:157
msgid "a maximum of {0} values are needed, but there are {{{{ var | length }}}}"
msgstr ""
#: src/rougail/annotator/variable.py:165
#: src/rougail/annotator/variable.py:158
msgid "needs a maximum of {0} values"
msgstr ""
#: src/rougail/annotator/variable.py:169
#: src/rougail/annotator/variable.py:160
msgid "a minimum of {0} values are needed, but there are {{{{ var | length }}}}"
msgstr ""
#: src/rougail/annotator/variable.py:170
#: src/rougail/annotator/variable.py:161
msgid "needs a minimum of {0} values"
msgstr ""
#: src/rougail/annotator/variable.py:247
#: src/rougail/annotator/variable.py:223
msgid "the \"{0}\" default value is a calculation with itself"
msgstr ""
#: src/rougail/annotator/variable.py:308
#: src/rougail/annotator/variable.py:285
msgid "the variable \"{0}\" has regexp attribut but has not the \"regexp\" type"
msgstr ""
#: src/rougail/annotator/variable.py:351
#: src/rougail/annotator/variable.py:328
msgid "the variable \"{0}\" has choices attribut but has not the \"choice\" type"
msgstr ""
#: src/rougail/annotator/variable.py:379
#: src/rougail/annotator/variable.py:356
msgid "the variable \"{0}\" has an unvalid default value \"{1}\" should be in {2}"
msgstr ""
@ -207,27 +207,27 @@ msgstr ""
msgid "family \"{0}\" define multiple time"
msgstr ""
#: src/rougail/convert/convert.py:673
#: src/rougail/convert/convert.py:672
msgid "variable \"{0}\" define multiple time"
msgstr ""
#: src/rougail/convert/convert.py:771
#: src/rougail/convert/convert.py:770
msgid "params must be a dict for {0}"
msgstr ""
#: src/rougail/convert/convert.py:792
#: src/rougail/convert/convert.py:791
msgid "\"{0}\" has an invalid \"params\" for {1}: {2}"
msgstr ""
#: src/rougail/convert/convert.py:806
#: src/rougail/convert/convert.py:805
msgid "secret_manager must be a dict for {0}"
msgstr ""
#: src/rougail/convert/convert.py:1135
#: src/rougail/convert/convert.py:1134
msgid "Cannot execute annotate multiple time"
msgstr ""
#: src/rougail/convert/convert.py:1142
#: src/rougail/convert/convert.py:1141
msgid "invalid \"structural\" definition ({0}), we cannot load any structural file!"
msgstr ""
@ -240,7 +240,7 @@ msgid "the variable \"{0}\" is in fact a family in attribute \"{1}\" for \"{2}\"
msgstr ""
#: src/rougail/convert/object_model.py:132
#: src/rougail/convert/object_model.py:513
#: src/rougail/convert/object_model.py:484
msgid "unknown object \"{0}\" in attribute \"{1}\" for \"{2}\""
msgstr ""
@ -264,105 +264,92 @@ msgstr ""
msgid "\"warnings\" are only available with attribute \"{self.attribute_name}\" for variable \"{self.ori_path}\""
msgstr ""
#: src/rougail/convert/object_model.py:314
msgid "the variable \"{0}\" has a depreciated return_type \"{1}\", please use \"{2}\" instead in \"{3}\""
msgstr ""
#: src/rougail/convert/object_model.py:404
#: src/rougail/convert/object_model.py:435
#: src/rougail/convert/object_model.py:410
msgid "variable \"{0}\" has a calculating \"{1}\" with an invalid return_type, should be boolean or string, not \"{2}\""
msgstr ""
#: src/rougail/convert/object_model.py:411
msgid "the variable \"{0}\" has a return_type \"{1}\", for attribute \"{2}\" but has not description in {3}"
msgstr ""
#: src/rougail/convert/object_model.py:416
msgid "value is invalid"
msgstr ""
#: src/rougail/convert/object_model.py:508
#: src/rougail/convert/object_model.py:479
msgid "a variable \"{0}\" is needs in attribute \"{1}\" for \"{2}\" but it's a family"
msgstr ""
#: src/rougail/convert/object_model.py:533
#: src/rougail/convert/object_model.py:504
msgid "variable \"{0}\" has an attribute \"{1}\" calculated with the unknown variable \"{2}\""
msgstr ""
#: src/rougail/convert/object_model.py:585
#: src/rougail/convert/object_model.py:556
msgid "the variable \"{0}\" has an invalid \"{1}\" the variable \"{2}\" is in a sub dynamic option"
msgstr ""
#: src/rougail/convert/object_model.py:594
#: src/rougail/convert/object_model.py:565
msgid "the leader \"{0}\" has an invalid \"{1}\" the follower \"{2}\" is a multi"
msgstr ""
#: src/rougail/convert/object_model.py:636
#: src/rougail/convert/object_model.py:607
msgid "the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" must not be multi"
msgstr ""
#: src/rougail/convert/object_model.py:650
#: src/rougail/convert/object_model.py:621
msgid "the variable \"{0}\" has an invalid attribute \"{1}\", the variable must not be a multi or the variable \"{2}\" must be multi"
msgstr ""
#: src/rougail/convert/object_model.py:664
#: src/rougail/convert/object_model.py:635
msgid "the variable \"{0}\" has an invalid attribute \"{1}\", the variable must be a multi or the variable \"{2}\" must not be multi"
msgstr ""
#: src/rougail/convert/object_model.py:678
#: src/rougail/convert/object_model.py:649
msgid "the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" is multi but is inside a list"
msgstr ""
#: src/rougail/convert/object_model.py:700
#: src/rougail/convert/object_model.py:671
msgid "the variable \"{0}\" is waiting for a list as \"{1}\" but the attribute \"default\" is not a list (\"{2}\")"
msgstr ""
#: src/rougail/convert/object_model.py:704
#: src/rougail/convert/object_model.py:673
msgid "the variable \"{0}\" is not waiting for a list as \"{1}\" but the attribute \"default\" is a list (\"{2}\")"
msgstr ""
#: src/rougail/convert/object_model.py:726
#: src/rougail/convert/object_model.py:689
msgid "\"{0}\" attribut shall not have an \"optional\" attribute without the \"default\" attribute for variable \"{1}\""
msgstr ""
#: src/rougail/convert/object_model.py:748
#: src/rougail/convert/object_model.py:713
msgid "variable \"{0}\" has a default value calculated with \"{1}\" which has incompatible type"
msgstr ""
#: src/rougail/convert/object_model.py:790
#: src/rougail/convert/object_model.py:756
msgid "the variable \"{0}\" is waiting for a boolean as \"{1}\" but the attribute \"default\" is not a boolean (\"{2}\")"
msgstr ""
#: src/rougail/convert/object_model.py:812
#: src/rougail/convert/object_model.py:776
msgid "\"when\" is not allowed in format version 1.0 for attribute \"{0}\" for variable \"{1}\""
msgstr ""
#: src/rougail/convert/object_model.py:817
#: src/rougail/convert/object_model.py:781
msgid "the variable \"{0}\" has an invalid attribute \"{1}\", \"when\" and \"when_not\" cannot set together"
msgstr ""
#: src/rougail/convert/object_model.py:825
#: src/rougail/convert/object_model.py:789
msgid "\"when_not\" is not allowed in format version 1.0 for attribute \"{0}\" for variable \"{1}\""
msgstr ""
#: src/rougail/convert/object_model.py:881
#: src/rougail/convert/object_model.py:845
msgid "cannot find variable \"{0}\" for the information \"{1}\" when calculating \"{2}\""
msgstr ""
#: src/rougail/convert/object_model.py:886
#: src/rougail/convert/object_model.py:850
msgid "identifier not allowed for the information \"{0}\" when calculating \"{1}\""
msgstr ""
#: src/rougail/convert/object_model.py:938
#: src/rougail/convert/object_model.py:902
msgid "\"when\" is not allowed in format version 1.0 for attribute \"{0}\""
msgstr ""
#: src/rougail/convert/object_model.py:944
#: src/rougail/convert/object_model.py:954
#: src/rougail/convert/object_model.py:908
#: src/rougail/convert/object_model.py:918
msgid "the identifier has an invalid attribute \"{0}\", \"when\" and \"when_not\" cannot set together"
msgstr ""
#: src/rougail/convert/object_model.py:980
#: src/rougail/convert/object_model.py:944
msgid "the variable \"{0}\" is not a follower, so cannot have index type for \"{1}\""
msgstr ""
@ -370,12 +357,12 @@ msgstr ""
msgid "A variable or a family located in the \"{0}\" namespace shall not be used in the \"{1}\" namespace"
msgstr ""
#: src/rougail/convert/tiramisureflector.py:353
#: src/rougail/convert/tiramisureflector.py:352
msgid "internal error, {0} is not a dynamic variable"
msgstr ""
#: src/rougail/error.py:61 src/rougail/tiramisu.py:162
#: src/rougail/user_datas.py:412 src/rougail/user_datas.py:415
#: src/rougail/error.py:61 src/rougail/tiramisu.py:157
#: src/rougail/user_datas.py:407 src/rougail/user_datas.py:410
msgid "{0} in {1}"
msgstr ""
@ -387,7 +374,7 @@ msgstr ""
msgid "conflict alternative_name \"{0}\": \"{1}\" and \"{2}\""
msgstr ""
#: src/rougail/structural_directory/__init__.py:130
#: src/rougail/structural_directory/__init__.py:129
msgid "duplicate structural file name {0}"
msgstr ""
@ -419,11 +406,11 @@ msgstr ""
msgid "Directories where extra structural files are placed"
msgstr ""
#: src/rougail/tiramisu.py:83
#: src/rougail/tiramisu.py:78
msgid "unknown boolean value \"{0}\""
msgstr ""
#: src/rougail/tiramisu.py:335
#: src/rougail/tiramisu.py:330
msgid "cannot calculating \"{0}\" attribute for variable \"{1}\" in {2} with parameters \"{3}\": {4}"
msgstr ""
@ -431,51 +418,51 @@ msgstr ""
msgid "cannot load variable path \"{0}\", the identifier \"{1}\" is not valid in {2}"
msgstr ""
#: src/rougail/user_datas.py:229
#: src/rougail/user_datas.py:228
msgid "the variable \"{0}\" contains secrets and should not be defined in {1}"
msgstr ""
#: src/rougail/user_datas.py:269
#: src/rougail/user_datas.py:268
msgid "loaded from {0}"
msgstr ""
#: src/rougail/user_datas.py:311
#: src/rougail/user_datas.py:308
msgid "cannot set the value \"{0}\" to the family {1}, it will be ignored when loading from {2}"
msgstr ""
#: src/rougail/user_datas.py:322 src/rougail/user_datas.py:339
#: src/rougail/user_datas.py:319 src/rougail/user_datas.py:336
msgid "{0} loaded from {1}"
msgstr ""
#: src/rougail/user_datas.py:327
#: src/rougail/user_datas.py:324
msgid "variable or family \"{0}\" does not exist, it will be ignored when loading from {1}"
msgstr ""
#: src/rougail/user_datas.py:333
#: src/rougail/user_datas.py:330
msgid "\"{0}\" is the name of a dynamic family, it will be ignored when loading from {1}"
msgstr ""
#: src/rougail/user_datas.py:369
#: src/rougail/user_datas.py:364
msgid "variable {0} at index \"{1}\" is {2}, it will be ignored when loading from {3}"
msgstr ""
#: src/rougail/user_datas.py:380
#: src/rougail/user_datas.py:375
msgid "family {0} is {1}, {2} at index \"{3}\" will be ignored when loading from {4}"
msgstr ""
#: src/rougail/user_datas.py:393
#: src/rougail/user_datas.py:388
msgid "variable {0} is {1}, it will be ignored when loading from {2}"
msgstr ""
#: src/rougail/user_datas.py:401
#: src/rougail/user_datas.py:396
msgid "family {0} is {1}, {2} will be ignored when loading from {3}"
msgstr ""
#: src/rougail/user_datas.py:421
#: src/rougail/user_datas.py:416
msgid "the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it will be ignored when loading from {5}"
msgstr ""
#: src/rougail/user_datas.py:435
#: src/rougail/user_datas.py:430
msgid "the value \"{0}\" is an invalid {1} for {2}, {3}, it will be ignored when loading from {4}"
msgstr ""

View file

@ -1,6 +1,6 @@
[project]
name = "rougail"
version = "1.2.0a43"
version = "1.2.0a42"
[tool.commitizen]
name = "cz_conventional_commits"

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project]
name = "rougail-base"
version = "1.2.0a43"
version = "1.2.0a42"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
readme = "README.md"
description = "A consistency handling system that was initially designed in the configuration management"

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project]
name = "rougail"
version = "1.2.0a43"
version = "1.2.0a42"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
description = "A consistency handling system that was initially designed in the configuration management"
classifiers = [
@ -18,7 +18,7 @@ classifiers = [
dependencies = [
"ruamel.yaml ~= 0.18.6",
"pydantic ~= 2.9.2",
"rougail-base == 1.2.0a43",
"rougail-base == 1.2.0a42",
]
[tool.flit.sdist]

View file

@ -1 +1 @@
__version__ = "1.2.0a43"
__version__ = "1.2.0a42"

View file

@ -88,7 +88,9 @@ class _RougailConfig:
self.config.property.exportation()
)
rougailconfig.config.property.read_only()
rougailconfig.extra_vars = self.extra_vars.copy()
rougailconfig.root = self.root
rougailconfig.config = self.config
rougailconfig.extra_vars = self.extra_vars
for variable in self.not_in_tiramisu:
value = getattr(self, variable)
if not isinstance(value, str):

View file

@ -35,7 +35,7 @@ from ..utils import (
PROPERTY_ATTRIBUTE,
)
from ..i18n import _
from ..error import DictConsistencyError, VariableCalculationDependencyError, RougailWarning
from ..error import DictConsistencyError, VariableCalculationDependencyError
from ..tiramisu import CONVERT_OPTION, RENAME_TYPE, display_xmlfiles, convert_boolean
BASETYPE = Union[StrictBool, StrictInt, StrictFloat, StrictStr, None]
@ -311,9 +311,9 @@ class JinjaCalculation(Calculation):
idx += 1
objectspace.jinja[jinja_path] = self.jinja
if return_type in RENAME_TYPE:
warning = _('the variable "{0}" has a depreciated return_type "{1}", please use "{2}" instead in "{3}"')
warning = f'the variable "{ self.path }" has a depreciated return_type "{return_type}", please use "{RENAME_TYPE[return_type]}" instead in {display_xmlfiles(variable.xmlfiles)}'
warn(
warning.format(self.path, return_type, RENAME_TYPE[return_type], display_xmlfiles(self.xmlfiles)),
warning,
DeprecationWarning,
stacklevel=2,
)
@ -393,35 +393,13 @@ class JinjaCalculation(Calculation):
objectspace,
)
elif self.attribute_name == "validators":
return_type = self.return_type
if return_type is None:
return_type = "string"
if return_type not in ["string", "boolean"]:
if self.ori_path is None:
path = self.path
else:
path = self.ori_path
msg = _(
'variable "{0}" has a calculating "{1}" with an invalid return_type, should be boolean or string, not "{2}"'
).format(path, self.attribute_name, return_type)
raise DictConsistencyError(msg, 81, self.xmlfiles)
if return_type == 'boolean':
description = self.description
if description is None:
warning = _('the variable "{0}" has a return_type "{1}", for attribute "{2}" but has not description in {3}')
warn(
warning.format(self.path, return_type, self.attribute_name, display_xmlfiles(self.xmlfiles)),
RougailWarning,
)
self.description = _('value is invalid')
else:
description = None
if self.return_type:
raise Exception("pfff")
return self._jinja_to_function(
"valid_with_jinja",
return_type,
"string",
False,
objectspace,
params={'description': description}
)
elif self.attribute_name in PROPERTY_ATTRIBUTE:
return_type = self.return_type

View file

@ -71,7 +71,7 @@ class NotFoundError(Exception):
pass
class ExtensionError(Exception):
class ExtentionError(Exception):
pass

View file

@ -125,7 +125,7 @@ CONVERT_OPTION = {
example="https://example.net",
),
"port": dict(
opttype="PortOption", initkwargs={"allow_private": True}, example="111", func=str,
opttype="PortOption", initkwargs={"allow_private": True}, example="111"
),
"mac": dict(opttype="MACOption", example="00:00:00:00:00"),
"unix_permissions": dict(
@ -392,16 +392,14 @@ def jinja_to_property_help(prop, description, **kwargs):
@function_waiting_for_error
def valid_with_jinja(warnings_only=False, description=None, **kwargs):
def valid_with_jinja(warnings_only=False, **kwargs):
global ValueWarning
value = func["jinja_to_function"](**kwargs)
if value:
if description is None:
description = value
if warnings_only:
raise ValueWarning(description)
raise ValueWarning(value)
else:
raise ValueError(description)
raise ValueError(value)
func["calc_value"] = rougail_calc_value

View file

@ -195,17 +195,16 @@ class UserDatas:
self.values[path]["values"] = value
if option.issubmulti():
value = [[val] for val in value]
if option.issubmulti():
for idx, val in enumerate(value):
if isinstance(val, list):
value[idx] = [convert_value(option, v, needs_convert) for v in val]
elif isinstance(value, list):
value = [convert_value(option, val, needs_convert) for val in value]
if needs_convert:
if option.issubmulti():
for idx, val in enumerate(value):
value[idx] = [convert_value(option, v) for v in val]
else:
value = [convert_value(option, val) for val in value]
self.values[path]["values"] = value
self.values[path]["options"]["needs_convert"] = needs_convert
elif not isinstance(value, list):
value = convert_value(option, value, needs_convert)
self.values[path]["options"]["needs_convert"] = False
elif needs_convert:
value = convert_value(option, value)
return value
def _populate_config(self):
@ -457,16 +456,10 @@ class UserDatas:
option.value.set(value)
def convert_value(option, value, needs_convert):
def convert_value(option, value):
if value == "":
return None
option_type = option.information.get("type")
if option_type == "port":
func = CONVERT_OPTION[option_type]["func"]
try:
return func(value)
except:
return value
if option_type == "choice":
choices = option.value.list()
if value not in choices and isinstance(value, str):

View file

@ -1,17 +1,10 @@
{
"rougail.var1": {
"owner": "default",
"value": [
"val1",
"val2",
"val3"
]
"value": []
},
"rougail.var2": {
"owner": "default",
"value": [
"val4",
"val5"
]
"value": []
}
}

View file

@ -1,11 +1,4 @@
{
"rougail.var1": [
"val1",
"val2",
"val3"
],
"rougail.var2": [
"val4",
"val5"
]
"rougail.var1": [],
"rougail.var2": []
}

View file

@ -1,17 +1,10 @@
{
"rougail.var1": {
"owner": "default",
"value": [
"val1",
"val2",
"val3"
]
"value": []
},
"rougail.var2": {
"owner": "default",
"value": [
"val4",
"val5"
]
"value": []
}
}

View file

@ -1 +1 @@
[]
["rougail.var1", "rougail.var2"]

View file

@ -1,11 +1,4 @@
{
"rougail.var1": [
"val1",
"val2",
"val3"
],
"rougail.var2": [
"val4",
"val5"
]
"rougail.var1": [],
"rougail.var2": []
}

View file

@ -10,10 +10,10 @@ except:
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_rougail.var1'] = "{% if var | length != 3 %}3 values needed, but there are {{ var | length }}{% endif %}"
dict_env['validators_rougail.var1'] = "{% if var | length != 2 %}2 values needed, but there are {{ var | length }}{% endif %}"
dict_env['validators_rougail.var2'] = "{% if var | length < 1 %}a minimum of 1 values are needed, but there are {{ var | length }}{% endif %}"
dict_env['validators_rougail.var2_0'] = "{% if var | length > 4 %}a maximum of 4 values are needed, but there are {{ var | length }}{% endif %}"
option_2 = StrOption(name="var1", doc="the variable", multi=True, default=["val1", "val2", "val3"], default_multi="val1", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var1"), 'var': ParamSelfOption(whole=True), 'description': ParamValue(None)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml'], 'type': 'string'})
option_3 = StrOption(name="var2", doc="the variable", multi=True, default=["val4", "val5"], default_multi="val4", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var2"), 'var': ParamSelfOption(whole=True), 'description': ParamValue(None)})), Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var2_0"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var2"), 'var': ParamSelfOption(whole=True), 'description': ParamValue(None)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml'], 'type': 'string'})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3], properties=frozenset({"standard"}), informations={'ymlfiles': ['']})
option_2 = StrOption(name="var1", doc="the variable", multi=True, validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var1"), 'var': ParamSelfOption(whole=True)}))], properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml'], 'type': 'string'})
option_3 = StrOption(name="var2", doc="the variable", multi=True, validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var2"), 'var': ParamSelfOption(whole=True)})), Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var2_0"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var2"), 'var': ParamSelfOption(whole=True)}))], properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml'], 'type': 'string'})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3], properties=frozenset({"basic"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -6,9 +6,9 @@ load_functions('../rougail-tests/funcs/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_var1'] = "{% if var | length != 3 %}3 values needed, but there are {{ var | length }}{% endif %}"
dict_env['validators_var1'] = "{% if var | length != 2 %}2 values needed, but there are {{ var | length }}{% endif %}"
dict_env['validators_var2'] = "{% if var | length < 1 %}a minimum of 1 values are needed, but there are {{ var | length }}{% endif %}"
dict_env['validators_var2_0'] = "{% if var | length > 4 %}a maximum of 4 values are needed, but there are {{ var | length }}{% endif %}"
option_1 = StrOption(name="var1", doc="the variable", multi=True, default=["val1", "val2", "val3"], default_multi="val1", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var1"), 'var': ParamSelfOption(whole=True), 'description': ParamValue(None)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml'], 'type': 'string'})
option_2 = StrOption(name="var2", doc="the variable", multi=True, default=["val4", "val5"], default_multi="val4", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var2"), 'var': ParamSelfOption(whole=True), 'description': ParamValue(None)})), Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var2_0"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var2"), 'var': ParamSelfOption(whole=True), 'description': ParamValue(None)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml'], 'type': 'string'})
option_1 = StrOption(name="var1", doc="the variable", multi=True, validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var1"), 'var': ParamSelfOption(whole=True)}))], properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml'], 'type': 'string'})
option_2 = StrOption(name="var2", doc="the variable", multi=True, validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var2"), 'var': ParamSelfOption(whole=True)})), Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var2_0"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var2"), 'var': ParamSelfOption(whole=True)}))], properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/01_6string_multi_length/rougail/00-base.yml'], 'type': 'string'})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])

View file

@ -11,6 +11,6 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_rougail.int'] = "{% if _.int > 100 %}\nvalue is too high\n{% endif %}\n"
option_2 = IntOption(name="int", doc="An integer", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.int"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.int"), 'description': ParamValue(None), '_.int': ParamSelfOption(whole=False)}))], properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators/rougail/00-base.yml'], 'type': 'integer'})
option_2 = IntOption(name="int", doc="An integer", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.int"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.int"), '_.int': ParamSelfOption(whole=False)}))], properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators/rougail/00-base.yml'], 'type': 'integer'})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2], properties=frozenset({"basic"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -7,5 +7,5 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_int'] = "{% if _.int > 100 %}\nvalue is too high\n{% endif %}\n"
option_1 = IntOption(name="int", doc="An integer", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_int"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("int"), 'description': ParamValue(None), '_.int': ParamSelfOption(whole=False)}))], properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators/rougail/00-base.yml'], 'type': 'integer'})
option_1 = IntOption(name="int", doc="An integer", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_int"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("int"), '_.int': ParamSelfOption(whole=False)}))], properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators/rougail/00-base.yml'], 'type': 'integer'})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -12,6 +12,6 @@ ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_rougail.var1'] = "{% if _.var1 == _.var2 %}\nvar1 must be different than var2\n{% endif %}\n"
option_3 = StrOption(name="var2", doc="A second variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_differ/rougail/00-base.yml'], 'type': 'string'})
option_2 = StrOption(name="var1", doc="a first variable", default="oui", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_differ/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var1"), 'description': ParamValue(None), '_.var2': ParamOption(option_3, notraisepropertyerror=True), '_.var1': ParamSelfOption(whole=False)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_differ/rougail/00-base.yml'], 'type': 'string', 'test': ('another_value',)})
option_2 = StrOption(name="var1", doc="a first variable", default="oui", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_differ/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var1"), '_.var2': ParamOption(option_3, notraisepropertyerror=True), '_.var1': ParamSelfOption(whole=False)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_differ/rougail/00-base.yml'], 'type': 'string', 'test': ('another_value',)})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3], properties=frozenset({"standard"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -8,5 +8,5 @@ ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_var1'] = "{% if _.var1 == _.var2 %}\nvar1 must be different than var2\n{% endif %}\n"
option_2 = StrOption(name="var2", doc="A second variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_differ/rougail/00-base.yml'], 'type': 'string'})
option_1 = StrOption(name="var1", doc="a first variable", default="oui", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_differ/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var1"), 'description': ParamValue(None), '_.var2': ParamOption(option_2, notraisepropertyerror=True), '_.var1': ParamSelfOption(whole=False)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_differ/rougail/00-base.yml'], 'type': 'string', 'test': ('another_value',)})
option_1 = StrOption(name="var1", doc="a first variable", default="oui", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_differ/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var1"), '_.var2': ParamOption(option_2, notraisepropertyerror=True), '_.var1': ParamSelfOption(whole=False)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_differ/rougail/00-base.yml'], 'type': 'string', 'test': ('another_value',)})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])

View file

@ -11,6 +11,6 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_rougail.var1'] = "{% if _.var1 | length > 9 %}\nlength must be less than 10\n{% endif %}\n"
option_2 = StrOption(name="var1", doc="a second variable", multi=True, default=["no", "yes"], default_multi="no", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_multi/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var1"), 'description': ParamValue(None), '_.var1': ParamSelfOption(whole=False)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_multi/rougail/00-base.yml'], 'type': 'string'})
option_2 = StrOption(name="var1", doc="a second variable", multi=True, default=["no", "yes"], default_multi="no", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_multi/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var1"), '_.var1': ParamSelfOption(whole=False)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_multi/rougail/00-base.yml'], 'type': 'string'})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2], properties=frozenset({"standard"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -7,5 +7,5 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_var1'] = "{% if _.var1 | length > 9 %}\nlength must be less than 10\n{% endif %}\n"
option_1 = StrOption(name="var1", doc="a second variable", multi=True, default=["no", "yes"], default_multi="no", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_multi/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var1"), 'description': ParamValue(None), '_.var1': ParamSelfOption(whole=False)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_multi/rougail/00-base.yml'], 'type': 'string'})
option_1 = StrOption(name="var1", doc="a second variable", multi=True, default=["no", "yes"], default_multi="no", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_multi/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var1"), '_.var1': ParamSelfOption(whole=False)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_multi/rougail/00-base.yml'], 'type': 'string'})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -11,6 +11,6 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_rougail.var1'] = "{% if values | length > 2 %}\nlength must be less than 3\n{% endif %}\n"
option_2 = StrOption(name="var1", doc="a second variable", multi=True, default=["no", "yes"], default_multi="no", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_multi2/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var1"), 'values': ParamSelfOption(whole=True), 'description': ParamValue(None)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_multi2/rougail/00-base.yml'], 'type': 'string', 'test': ('val1', 'val2')})
option_2 = StrOption(name="var1", doc="a second variable", multi=True, default=["no", "yes"], default_multi="no", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_multi2/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var1"), 'values': ParamSelfOption(whole=True)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_multi2/rougail/00-base.yml'], 'type': 'string', 'test': ('val1', 'val2')})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2], properties=frozenset({"standard"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -7,5 +7,5 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_var1'] = "{% if values | length > 2 %}\nlength must be less than 3\n{% endif %}\n"
option_1 = StrOption(name="var1", doc="a second variable", multi=True, default=["no", "yes"], default_multi="no", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_multi2/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var1"), 'values': ParamSelfOption(whole=True), 'description': ParamValue(None)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_multi2/rougail/00-base.yml'], 'type': 'string', 'test': ('val1', 'val2')})
option_1 = StrOption(name="var1", doc="a second variable", multi=True, default=["no", "yes"], default_multi="no", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_multi2/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var1"), 'values': ParamSelfOption(whole=True)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_multi2/rougail/00-base.yml'], 'type': 'string', 'test': ('val1', 'val2')})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -11,6 +11,6 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_rougail.var1'] = "{% if _.var1 != index %}\n value != than index\n{% endif %}"
option_2 = IntOption(name="var1", doc="a second variable", multi=True, default=[0, 1, 2], default_multi=0, validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_multi3/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var1"), 'index': ParamIndex(), 'description': ParamValue(None), '_.var1': ParamSelfOption(whole=False)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_multi3/rougail/00-base.yml'], 'type': 'integer', 'test': (0,)})
option_2 = IntOption(name="var1", doc="a second variable", multi=True, default=[0, 1, 2], default_multi=0, validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_multi3/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var1"), 'index': ParamIndex(), '_.var1': ParamSelfOption(whole=False)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_multi3/rougail/00-base.yml'], 'type': 'integer', 'test': (0,)})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2], properties=frozenset({"standard"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -7,5 +7,5 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_var1'] = "{% if _.var1 != index %}\n value != than index\n{% endif %}"
option_1 = IntOption(name="var1", doc="a second variable", multi=True, default=[0, 1, 2], default_multi=0, validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_multi3/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var1"), 'index': ParamIndex(), 'description': ParamValue(None), '_.var1': ParamSelfOption(whole=False)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_multi3/rougail/00-base.yml'], 'type': 'integer', 'test': (0,)})
option_1 = IntOption(name="var1", doc="a second variable", multi=True, default=[0, 1, 2], default_multi=0, validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_multi3/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var1"), 'index': ParamIndex(), '_.var1': ParamSelfOption(whole=False)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_multi3/rougail/00-base.yml'], 'type': 'integer', 'test': (0,)})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -11,6 +11,6 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_rougail.int'] = "{% if _.int > 100 %}\n value is too high\n{% endif %}"
option_2 = IntOption(name="int", doc="An integer", default=1000, validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.int"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_warnings/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.int"), 'description': ParamValue(None), '_.int': ParamSelfOption(whole=False)}), warnings_only=True)], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_warnings/rougail/00-base.yml'], 'type': 'integer'})
option_2 = IntOption(name="int", doc="An integer", default=1000, validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.int"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_warnings/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.int"), '_.int': ParamSelfOption(whole=False)}), warnings_only=True)], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_warnings/rougail/00-base.yml'], 'type': 'integer'})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2], properties=frozenset({"standard"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -7,5 +7,5 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_int'] = "{% if _.int > 100 %}\n value is too high\n{% endif %}"
option_1 = IntOption(name="int", doc="An integer", default=1000, validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_int"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_warnings/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("int"), 'description': ParamValue(None), '_.int': ParamSelfOption(whole=False)}), warnings_only=True)], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_warnings/rougail/00-base.yml'], 'type': 'integer'})
option_1 = IntOption(name="int", doc="An integer", default=1000, validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_int"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5validators_warnings/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("int"), '_.int': ParamSelfOption(whole=False)}), warnings_only=True)], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/04_5validators_warnings/rougail/00-base.yml'], 'type': 'integer'})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -13,6 +13,6 @@ ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_rougail.var3'] = "{% if _.var3 == _.var2 %}\nvar3 must be different than var2\n{% endif %}\n"
option_2 = StrOption(name="var1", doc="a first variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml'], 'type': 'string'})
option_3 = StrOption(name="var2", doc="a second variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml'], 'type': 'string'})
option_4 = StrOption(name="var3", doc="a third variable", default="yes", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var3"), 'description': ParamValue(None), '_.var3': ParamSelfOption(whole=False), '_.var2': ParamOption(option_3, notraisepropertyerror=True)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml', '../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml'], 'type': 'string', 'test': ('yes',)})
option_4 = StrOption(name="var3", doc="a third variable", default="yes", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.var3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.var3"), '_.var3': ParamSelfOption(whole=False), '_.var2': ParamOption(option_3, notraisepropertyerror=True)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml', '../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml'], 'type': 'string', 'test': ('yes',)})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3, option_4], properties=frozenset({"standard"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -9,5 +9,5 @@ ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_var3'] = "{% if _.var3 == _.var2 %}\nvar3 must be different than var2\n{% endif %}\n"
option_1 = StrOption(name="var1", doc="a first variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml'], 'type': 'string'})
option_2 = StrOption(name="var2", doc="a second variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml'], 'type': 'string'})
option_3 = StrOption(name="var3", doc="a third variable", default="yes", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var3"), 'description': ParamValue(None), '_.var3': ParamSelfOption(whole=False), '_.var2': ParamOption(option_2, notraisepropertyerror=True)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml', '../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml'], 'type': 'string', 'test': ('yes',)})
option_3 = StrOption(name="var3", doc="a third variable", default="yes", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_var3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("var3"), '_.var3': ParamSelfOption(whole=False), '_.var2': ParamOption(option_2, notraisepropertyerror=True)}))], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/20_0validators_differ_redefine/rougail/00-base.yml', '../rougail-tests/structures/20_0validators_differ_redefine/rougail/01-base.yml'], 'type': 'string', 'test': ('yes',)})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2, option_3])

View file

@ -13,7 +13,7 @@ ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_rougail.general.int'] = "{% if _.int == int2 %}\nint and int2 must be different\n{% endif %}\n"
dict_env['validators_rougail.general.int_0'] = "{% if int3 is defined and _.int == int3 %}\nint and int3 must be different\n{% endif %}\n"
option_4 = IntOption(name="int2", doc="a second integer", default=1, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml'], 'type': 'integer'})
option_3 = IntOption(name="int", doc="a first integer", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.general.int"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.general.int"), 'int2': ParamOption(option_4), 'description': ParamValue(None), '_.int': ParamSelfOption(whole=False)})), Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.general.int_0"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.general.int"), 'description': ParamValue(None), '_.int': ParamSelfOption(whole=False)}))], properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml'], 'type': 'integer', 'test': (5,)})
option_3 = IntOption(name="int", doc="a first integer", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.general.int"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.general.int"), 'int2': ParamOption(option_4), '_.int': ParamSelfOption(whole=False)})), Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_rougail.general.int_0"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("rougail.general.int"), '_.int': ParamSelfOption(whole=False)}))], properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml'], 'type': 'integer', 'test': (5,)})
optiondescription_2 = OptionDescription(name="general", doc="a family", children=[option_3, option_4], properties=frozenset({"basic"}), informations={'ymlfiles': ['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml']})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[optiondescription_2], properties=frozenset({"basic"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -9,6 +9,6 @@ ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['validators_general.int'] = "{% if _.int == int2 %}\nint and int2 must be different\n{% endif %}\n"
dict_env['validators_general.int_0'] = "{% if int3 is defined and _.int == int3 %}\nint and int3 must be different\n{% endif %}\n"
option_3 = IntOption(name="int2", doc="a second integer", default=1, properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml'], 'type': 'integer'})
option_2 = IntOption(name="int", doc="a first integer", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_general.int"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("general.int"), 'int2': ParamOption(option_3), 'description': ParamValue(None), '_.int': ParamSelfOption(whole=False)})), Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_general.int_0"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("general.int"), 'description': ParamValue(None), '_.int': ParamSelfOption(whole=False)}))], properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml'], 'type': 'integer', 'test': (5,)})
option_2 = IntOption(name="int", doc="a first integer", validators=[Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_general.int"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("general.int"), 'int2': ParamOption(option_3), '_.int': ParamSelfOption(whole=False)})), Calculation(func['valid_with_jinja'], Params((), kwargs={'__internal_jinja': ParamValue("validators_general.int_0"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml']), '__internal_attribute': ParamValue("validators"), '__internal_variable': ParamValue("general.int"), '_.int': ParamSelfOption(whole=False)}))], properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml'], 'type': 'integer', 'test': (5,)})
optiondescription_1 = OptionDescription(name="general", doc="a family", children=[option_2, option_3], properties=frozenset({"basic"}), informations={'ymlfiles': ['../rougail-tests/structures/24_7validators_variable_optional/rougail/00-base.yml']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -12,7 +12,7 @@ ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['disabled_rougail.leader.follower'] = "{% if _.leader == \"a\" %}\nthe value of \"leader\" is \"a\"\n{% endif %}\n"
option_3 = StrOption(name="leader", doc="a leader", multi=True, default=["a", "b"], properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/44_9calculated_default_leadership_leader/rougail/00-base.yml'], 'type': 'string'})
option_4 = StrOption(name="follower", doc="a follower", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_3)))), properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if the value of \"_.leader\" is \"a\"")), kwargs={'__internal_jinja': ParamValue("disabled_rougail.leader.follower"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/44_9calculated_default_leadership_leader/rougail/00-base.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("rougail.leader.follower"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.leader': ParamOption(option_3, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['../rougail-tests/structures/44_9calculated_default_leadership_leader/rougail/00-base.yml'], 'type': 'string'})
option_4 = StrOption(name="follower", doc="a follower", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_3)))), properties=frozenset({"mandatory", "standard", Calculation(func['jinja_to_property'], Params((ParamValue("disabled"), ParamValue("if the value of \"leader\" is \"a\"")), kwargs={'__internal_jinja': ParamValue("disabled_rougail.leader.follower"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/44_9calculated_default_leadership_leader/rougail/00-base.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("rougail.leader.follower"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.leader': ParamOption(option_3, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'ymlfiles': ['../rougail-tests/structures/44_9calculated_default_leadership_leader/rougail/00-base.yml'], 'type': 'string'})
optiondescription_2 = Leadership(name="leader", doc="leader", children=[option_3, option_4], properties=frozenset({"standard"}), informations={'ymlfiles': ['../rougail-tests/structures/44_9calculated_default_leadership_leader/rougail/00-base.yml']})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[optiondescription_2], properties=frozenset({"standard"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -1,21 +0,0 @@
{
"rougail.dynval1.var": {
"owner": "default",
"value": null
},
"rougail.dynval2.var": {
"owner": "default",
"value": null
},
"rougail.var1": {
"owner": "default",
"value": null
},
"rougail.var2": {
"owner": "default",
"value": [
null,
null
]
}
}

View file

@ -1,9 +0,0 @@
{
"rougail.dynval1.var": null,
"rougail.dynval2.var": null,
"rougail.var1": null,
"rougail.var2": [
null,
null
]
}

View file

@ -1,21 +0,0 @@
{
"rougail.dynval1.var": {
"owner": "default",
"value": null
},
"rougail.dynval2.var": {
"owner": "default",
"value": null
},
"rougail.var1": {
"owner": "default",
"value": null
},
"rougail.var2": {
"owner": "default",
"value": [
null,
null
]
}
}

View file

@ -1 +0,0 @@
["rougail.dynval1.var", "rougail.dynval2.var", "rougail.var1", "rougail.var2"]

View file

@ -1,9 +0,0 @@
{
"rougail.dynval1.var": null,
"rougail.dynval2.var": null,
"rougail.var1": null,
"rougail.var2": [
null,
null
]
}

View file

@ -1,18 +0,0 @@
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
load_functions('../rougail-tests/funcs/test.py')
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="var", doc="A dynamic variable for {{ identifier }}", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_description/rougail/00-base.yml'], 'type': 'string'})
optiondescription_2 = ConvertDynOptionDescription(name="dyn{{ identifier }}", doc="A dynamic famify for {{ identifier }}", identifiers=["val1", "val2"], children=[option_3], properties=frozenset({"basic"}), informations={'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_description/rougail/00-base.yml']})
option_4 = StrOption(name="var1", doc="A new variable", properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamDynOption(option_3, ["val1"]), 'prop': ParamValue("disabled"), 'when': ParamValue("val"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_description/rougail/00-base.yml'], 'type': 'string'})
option_5 = StrOption(name="var2", doc="A new variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_3)), kwargs={'__internal_multi': ParamValue(True)})), properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_description/rougail/00-base.yml'], 'type': 'string'})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[optiondescription_2, option_4, option_5], properties=frozenset({"basic"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -1,13 +0,0 @@
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
load_functions('../rougail-tests/funcs/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
option_2 = StrOption(name="var", doc="A dynamic variable for {{ identifier }}", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_description/rougail/00-base.yml'], 'type': 'string'})
optiondescription_1 = ConvertDynOptionDescription(name="dyn{{ identifier }}", doc="A dynamic famify for {{ identifier }}", identifiers=["val1", "val2"], children=[option_2], properties=frozenset({"basic"}), informations={'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_description/rougail/00-base.yml']})
option_3 = StrOption(name="var1", doc="A new variable", properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((), kwargs={'value': ParamDynOption(option_2, ["val1"]), 'prop': ParamValue("disabled"), 'when': ParamValue("val"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_description/rougail/00-base.yml'], 'type': 'string'})
option_4 = StrOption(name="var2", doc="A new variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_2)), kwargs={'__internal_multi': ParamValue(True)})), properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_description/rougail/00-base.yml'], 'type': 'string'})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, option_3, option_4])

View file

@ -1,12 +0,0 @@
%YAML 1.2
---
version: 1.1
# before
first_variable:
second_variable: # in place
third_variable:
# after
...

View file

@ -181,17 +181,3 @@ def test_isolated_namespace():
cfg = eolobj.run()
assert cfg.option('extra.variable').value.get() == 'no'
assert cfg.option('extra2.variable').value.get() == 'no'
def test_shorthand():
rougailconfig = RougailConfig.copy()
rougailconfig['main_namespace'] = None
rougailconfig['main_structural_directories'] = ['tests/shorthand/']
eolobj = Rougail(rougailconfig=rougailconfig)
cfg = eolobj.run()
results = {"first_variable": "first_variable",
"second_variable": "second_variable (in place)",
"third_variable": "third_variable",
}
for opt in cfg:
assert opt.description() == results[opt.name()]