Compare commits

..

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

28 changed files with 232 additions and 485 deletions

View file

@ -1,13 +1,3 @@
## 1.2.0a42 (2025-11-06)
### Feat
- can add limit length for a variable
### Fix
- black
## 1.2.0a41 (2025-11-06) ## 1.2.0a41 (2025-11-06)
### Feat ### Feat

View file

@ -5,8 +5,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"POT-Creation-Date: 2025-11-06 21:31+0100\n" "POT-Creation-Date: 2025-10-26 15:26+0100\n"
"PO-Revision-Date: 2025-11-06 21:32+0100\n" "PO-Revision-Date: 2025-10-26 15:28+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: fr\n" "Language: fr\n"
@ -86,8 +86,10 @@ msgstr ""
"nom de l'étiquette invalide \"{0}\" ne doit pas être un nom de mode existant" "nom de l'étiquette invalide \"{0}\" ne doit pas être un nom de mode existant"
#: src/rougail/annotator/property.py:168 #: src/rougail/annotator/property.py:168
msgid "" #, fuzzy
"invalid tag name \"{0}\" should not be the name of an available properties" #| msgid ""
#| "invalid tag name \"{0}\" should not be name of an available proprerties"
msgid "invalid tag name \"{0}\" should not be name of an available properties"
msgstr "" msgstr ""
"nom de l'étiquette invalide \"{0}\" ne doit pas être le nom d'une propriétés " "nom de l'étiquette invalide \"{0}\" ne doit pas être le nom d'une propriétés "
"existantes" "existantes"
@ -137,127 +139,97 @@ msgstr ""
"la variable \"{0}\" a l'attribut \"secret_manager\" donc ne devrait pas " "la variable \"{0}\" a l'attribut \"secret_manager\" donc ne devrait pas "
"avoir de valeur par défaut" "avoir de valeur par défaut"
#: src/rougail/annotator/variable.py:154 #: src/rougail/annotator/variable.py:254
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:155
msgid "needs exactly {0} values"
msgstr "nécessite exactement {0} valeurs"
#: 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:158
msgid "needs a maximum of {0} values"
msgstr "nécessite au maximum {0} valeurs"
#: 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:161
msgid "needs a minimum of {0} values"
msgstr "nécessite au minimum {0} valeurs"
#: 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:285
msgid "" msgid ""
"the variable \"{0}\" has regexp attribut but has not the \"regexp\" type" "the variable \"{0}\" has regexp attribut but has not the \"regexp\" type"
msgstr "" msgstr ""
"la variable \"{0}\" a un attribut regexp mais n'a pas le type \"regexp\"" "la variable \"{0}\" a un attribut regexp mais n'a pas le type \"regexp\""
#: src/rougail/annotator/variable.py:328 #: src/rougail/annotator/variable.py:297
msgid "" msgid ""
"the variable \"{0}\" has choices attribut but has not the \"choice\" type" "the variable \"{0}\" has choices attribut but has not the \"choice\" type"
msgstr "" msgstr ""
"la variable \"{0}\" a un attribut choices mais n'a pas le type \"choice\"" "la variable \"{0}\" a un attribut choices mais n'a pas le type \"choice\""
#: src/rougail/annotator/variable.py:356 #: src/rougail/annotator/variable.py:325
msgid "" msgid ""
"the variable \"{0}\" has an unvalid default value \"{1}\" should be in {2}" "the variable \"{0}\" has an unvalid default value \"{1}\" should be in {2}"
msgstr "" msgstr ""
"la variable \"{0}\" a la valeur par défaut invalide \"{1}\" devrait être {2}" "la variable \"{0}\" a la valeur par défaut invalide \"{1}\" devrait être {2}"
#: src/rougail/config/__init__.py:276 #: src/rougail/config/__init__.py:235
msgid "Structure format version by default, if not specified in structure file" msgid "Structure format version by default, if not specified in structure file"
msgstr "" msgstr ""
"La version du format de la structure par défaut, si non spécifier dans le " "La version du format de la structure par défaut, si non spécifier dans le "
"fichier de structure" "fichier de structure"
#: src/rougail/config/__init__.py:284 #: src/rougail/config/__init__.py:243
msgid "File with functions" msgid "File with functions"
msgstr "Fichier avec les fonctions" msgstr "Fichier avec les fonctions"
#: src/rougail/config/__init__.py:296 #: src/rougail/config/__init__.py:255
msgid "All modes level available" msgid "All modes level available"
msgstr "Tous les niveaux de modes valides" msgstr "Tous les niveaux de modes valides"
#: src/rougail/config/__init__.py:308 #: src/rougail/config/__init__.py:267
msgid "Default mode for a family" msgid "Default mode for a family"
msgstr "Mode par défaut pour une famille" msgstr "Mode par défaut pour une famille"
#: src/rougail/config/__init__.py:328 #: src/rougail/config/__init__.py:287
msgid "Default mode for a variable" msgid "Default mode for a variable"
msgstr "Mode par défaut pour une variable" msgstr "Mode par défaut pour une variable"
#: src/rougail/config/__init__.py:352 #: src/rougail/config/__init__.py:311
msgid "Option name for the base option" msgid "Option name for the base option"
msgstr "Nom de l'option pour l'option de base" msgstr "Nom de l'option pour l'option de base"
#: src/rougail/config/__init__.py:357 #: src/rougail/config/__init__.py:316
msgid "In cache file, do not importation of Tiramisu and other dependencies" msgid "In cache file, do not importation of Tiramisu and other dependencies"
msgstr "" msgstr ""
"Dans le fichier de cache, ne pas importer Tiramisu et autres dépendances" "Dans le fichier de cache, ne pas importer Tiramisu et autres dépendances"
#: src/rougail/config/__init__.py:362 #: src/rougail/config/__init__.py:321
msgid "Tiramisu cache filename" msgid "Tiramisu cache filename"
msgstr "Nom du fichier du cache Tiramisu" msgstr "Nom du fichier du cache Tiramisu"
#: src/rougail/config/__init__.py:370 #: src/rougail/config/__init__.py:329
msgid "Name of internal functions that we can use as a function" msgid "Name of internal functions that we can use as a function"
msgstr "" msgstr ""
"Nom des fonctions internes qu'il est possible d'utiliser comme fonction" "Nom des fonctions internes qu'il est possible d'utiliser comme fonction"
#: src/rougail/config/__init__.py:376 #: src/rougail/config/__init__.py:335
msgid "Name of extra annotators" msgid "Name of extra annotators"
msgstr "Nom des annotators supplémentaires" msgstr "Nom des annotators supplémentaires"
#: src/rougail/config/__init__.py:382 #: src/rougail/config/__init__.py:341
msgid "Suffix add to generated options name" msgid "Suffix add to generated options name"
msgstr "Suffix ajouté pour généré le nom des options" msgstr "Suffix ajouté pour généré le nom des options"
#: src/rougail/config/__init__.py:388 #: src/rougail/config/__init__.py:347
msgid "Every variables in calculation are optionals" msgid "Every variables in calculation are optionals"
msgstr "Toutes les variables dans un calcul sont optionnelles" msgstr "Toutes les variables dans un calcul sont optionnelles"
#: src/rougail/config/__init__.py:392 #: src/rougail/config/__init__.py:351
msgid "Loads redefine variables even if there don't already exists" msgid "Loads redefine variables even if there don't already exists"
msgstr "Charger les variables redéfinis même si elles n'existe pas" msgstr "Charger les variables redéfinis même si elles n'existe pas"
#: src/rougail/config/__init__.py:399 #: src/rougail/config/__init__.py:358
msgid "The secret pattern to build item name in Bitwarden" msgid "The secret pattern to build item name in Bitwarden"
msgstr "Le patron de secret pour construire le nom de l'élément dans Bitwarden" msgstr "Le patron de secret pour construire le nom de l'élément dans Bitwarden"
#: src/rougail/config/__init__.py:400 #: src/rougail/config/__init__.py:359
msgid "The pattern is in Jinja format" msgid "The pattern is in Jinja format"
msgstr "Le patron est au format Jinja" msgstr "Le patron est au format Jinja"
#: src/rougail/config/__init__.py:428 #: src/rougail/config/__init__.py:387
msgid "Select for {0}" msgid "Select for {0}"
msgstr "Sélection pour {0}" msgstr "Sélection pour {0}"
#: src/rougail/config/__init__.py:508 #: src/rougail/config/__init__.py:467
msgid "Override default parameters for option type" msgid "Override default parameters for option type"
msgstr "Sur charger les paramètre par défaut pour le type d'option" msgstr "Sur charger les paramètre par défaut pour le type d'option"
#: src/rougail/config/__init__.py:511 #: src/rougail/config/__init__.py:470
msgid "Default parameters for option type" msgid "Default parameters for option type"
msgstr "Paramètre par défaut pour le type d'option" msgstr "Paramètre par défaut pour le type d'option"
@ -296,42 +268,42 @@ msgstr ""
"définition invalide pour la définition des \"structures\" ({0}), aucun " "définition invalide pour la définition des \"structures\" ({0}), aucun "
"fichier de structure ne peut être chargé !" "fichier de structure ne peut être chargé !"
#: src/rougail/convert/object_model.py:121 #: src/rougail/convert/object_model.py:122
msgid "cannot find variable \"{0}\" defined in attribute \"{1}\" for \"{2}\"" msgid "cannot find variable \"{0}\" defined in attribute \"{1}\" for \"{2}\""
msgstr "" msgstr ""
"ne peut trouver la variable \"{0}\" défini dans l'attribut \"{1}\" pour " "ne peut trouver la variable \"{0}\" défini dans l'attribut \"{1}\" pour "
"\"{2}\"" "\"{2}\""
#: src/rougail/convert/object_model.py:127 #: src/rougail/convert/object_model.py:128
msgid "" msgid ""
"the variable \"{0}\" is in fact a family in attribute \"{1}\" for \"{2}\"" "the variable \"{0}\" is in fact a family in attribute \"{1}\" for \"{2}\""
msgstr "" msgstr ""
"la variable \"{0}\" est en faite une famille dans l'attribut \"{1}\" pour " "la variable \"{0}\" est en faite une famille dans l'attribut \"{1}\" pour "
"\"{2}\"" "\"{2}\""
#: src/rougail/convert/object_model.py:132 #: src/rougail/convert/object_model.py:133
#: src/rougail/convert/object_model.py:484 #: src/rougail/convert/object_model.py:479
msgid "unknown object \"{0}\" in attribute \"{1}\" for \"{2}\"" msgid "unknown object \"{0}\" in attribute \"{1}\" for \"{2}\""
msgstr "objet inconnu \"{0}\" dans l'attribut \"{1}\" pour \"{2}\"" msgstr "objet inconnu \"{0}\" dans l'attribut \"{1}\" pour \"{2}\""
#: src/rougail/convert/object_model.py:151 #: src/rougail/convert/object_model.py:152
msgid "" msgid ""
"identifier parameter for \"{0}\" in \"{1}\" cannot be set none dynamic family" "identifier parameter for \"{0}\" in \"{1}\" cannot be set none dynamic family"
msgstr "" msgstr ""
"le paramètre identifier pour \"{0}\" dans \"{1}\" ne peut être placé pour " "le paramètre identifier pour \"{0}\" dans \"{1}\" ne peut être placé pour "
"une famille non dynamique" "une famille non dynamique"
#: src/rougail/convert/object_model.py:180 #: src/rougail/convert/object_model.py:181
msgid "cannot find variable \"{0}\" defined in \"{1}\" for \"{2}\"" msgid "cannot find variable \"{0}\" defined in \"{1}\" for \"{2}\""
msgstr "ne peut trouver la variable \"{0}\" défini dans \"{1}\" pour \"{2}\"" msgstr "ne peut trouver la variable \"{0}\" défini dans \"{1}\" pour \"{2}\""
#: src/rougail/convert/object_model.py:185 #: src/rougail/convert/object_model.py:186
msgid "variable \"{0}\" defined in \"{1}\" for \"{2}\" is a dynamic variable" msgid "variable \"{0}\" defined in \"{1}\" for \"{2}\" is a dynamic variable"
msgstr "" msgstr ""
"la variable \"{0}\" défini dans \"{1}\" pour \"{2}\" est une variable " "la variable \"{0}\" défini dans \"{1}\" pour \"{2}\" est une variable "
"dynamique" "dynamique"
#: src/rougail/convert/object_model.py:202 #: src/rougail/convert/object_model.py:203
msgid "" msgid ""
"the variable \"{0}\" is not a follower, so cannot have index type for param " "the variable \"{0}\" is not a follower, so cannot have index type for param "
"in \"{1}\"" "in \"{1}\""
@ -339,15 +311,7 @@ msgstr ""
"la variable \"{0}\" n'est pas suiveuse, donc ne peut avoir de type index " "la variable \"{0}\" n'est pas suiveuse, donc ne peut avoir de type index "
"comme paramètre dans \"{1}\"" "comme paramètre dans \"{1}\""
#: src/rougail/convert/object_model.py:252 #: src/rougail/convert/object_model.py:405
msgid ""
"\"warnings\" are only available with attribute \"{self.attribute_name}\" for "
"variable \"{self.ori_path}\""
msgstr ""
"\"warnings\" est seulement utilisable avec l'attribut \"{self.attribute_name}"
"\" pour la variable \"{self.ori_path}\""
#: src/rougail/convert/object_model.py:410
msgid "" msgid ""
"variable \"{0}\" has a calculating \"{1}\" with an invalid return_type, " "variable \"{0}\" has a calculating \"{1}\" with an invalid return_type, "
"should be boolean or string, not \"{2}\"" "should be boolean or string, not \"{2}\""
@ -355,7 +319,7 @@ msgstr ""
"la variable \"{0}\" a un calcul \"{1}\" avec un return_type invalide, " "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}\"" "devrait être un booléen ou une chaîne de caractère, et pas \"{2}\""
#: src/rougail/convert/object_model.py:479 #: src/rougail/convert/object_model.py:474
msgid "" msgid ""
"a variable \"{0}\" is needs in attribute \"{1}\" for \"{2}\" but it's a " "a variable \"{0}\" is needs in attribute \"{1}\" for \"{2}\" but it's a "
"family" "family"
@ -363,7 +327,7 @@ msgstr ""
"une variable \"{0}\" est nécessaire pour l'attribut \"{1}\" pour \"{2}\" " "une variable \"{0}\" est nécessaire pour l'attribut \"{1}\" pour \"{2}\" "
"mais c'est une famille" "mais c'est une famille"
#: src/rougail/convert/object_model.py:504 #: src/rougail/convert/object_model.py:499
msgid "" msgid ""
"variable \"{0}\" has an attribute \"{1}\" calculated with the unknown " "variable \"{0}\" has an attribute \"{1}\" calculated with the unknown "
"variable \"{2}\"" "variable \"{2}\""
@ -371,7 +335,7 @@ msgstr ""
"la variable \"{0}\" a un attribut invalide \"{1}\" calculé avec la variable " "la variable \"{0}\" a un attribut invalide \"{1}\" calculé avec la variable "
"inconnue \"{2}\"" "inconnue \"{2}\""
#: src/rougail/convert/object_model.py:556 #: src/rougail/convert/object_model.py:551
msgid "" msgid ""
"the variable \"{0}\" has an invalid \"{1}\" the variable \"{2}\" is in a sub " "the variable \"{0}\" has an invalid \"{1}\" the variable \"{2}\" is in a sub "
"dynamic option" "dynamic option"
@ -379,14 +343,14 @@ msgstr ""
"la variable \"{0}\" a un attribut invalide \"{1}\", la variable \"{2}\" est " "la variable \"{0}\" a un attribut invalide \"{1}\", la variable \"{2}\" est "
"dans une sous option dynamique" "dans une sous option dynamique"
#: src/rougail/convert/object_model.py:565 #: src/rougail/convert/object_model.py:560
msgid "" msgid ""
"the leader \"{0}\" has an invalid \"{1}\" the follower \"{2}\" is a multi" "the leader \"{0}\" has an invalid \"{1}\" the follower \"{2}\" is a multi"
msgstr "" msgstr ""
"la variable meneuse \"{0}\" a un attribut invalide \"{1}\", la variable " "la variable meneuse \"{0}\" a un attribut invalide \"{1}\", la variable "
"suiveuse \"{2}\" est multiple" "suiveuse \"{2}\" est multiple"
#: src/rougail/convert/object_model.py:607 #: src/rougail/convert/object_model.py:602
msgid "" msgid ""
"the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" " "the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" "
"must not be multi" "must not be multi"
@ -394,7 +358,7 @@ msgstr ""
"la variable \"{0}\" a un attribut invalide \"{1}\", la variable \"{2}\" ne " "la variable \"{0}\" a un attribut invalide \"{1}\", la variable \"{2}\" ne "
"doit pas être multiple" "doit pas être multiple"
#: src/rougail/convert/object_model.py:621 #: src/rougail/convert/object_model.py:616
msgid "" msgid ""
"the variable \"{0}\" has an invalid attribute \"{1}\", the variable must not " "the variable \"{0}\" has an invalid attribute \"{1}\", the variable must not "
"be a multi or the variable \"{2}\" must be multi" "be a multi or the variable \"{2}\" must be multi"
@ -402,7 +366,7 @@ msgstr ""
"la variable \"{0}\" a un attribut invalide \"{1}\", la variable ne doit pas " "la variable \"{0}\" a un attribut invalide \"{1}\", la variable ne doit pas "
"être multiple ou la variable \"{2}\" doit être multiple" "être multiple ou la variable \"{2}\" doit être multiple"
#: src/rougail/convert/object_model.py:635 #: src/rougail/convert/object_model.py:630
msgid "" msgid ""
"the variable \"{0}\" has an invalid attribute \"{1}\", the variable must be " "the variable \"{0}\" has an invalid attribute \"{1}\", the variable must be "
"a multi or the variable \"{2}\" must not be multi" "a multi or the variable \"{2}\" must not be multi"
@ -410,7 +374,7 @@ msgstr ""
"la variable \"{0}\" a un attribut invalide \"{1}\", la variable doit être " "la variable \"{0}\" a un attribut invalide \"{1}\", la variable doit être "
"multiple ou la variable \"{2}\" ne doit pas être multiple" "multiple ou la variable \"{2}\" ne doit pas être multiple"
#: src/rougail/convert/object_model.py:649 #: src/rougail/convert/object_model.py:644
msgid "" msgid ""
"the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" " "the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" "
"is multi but is inside a list" "is multi but is inside a list"
@ -418,7 +382,7 @@ msgstr ""
"la variable \"{0}\" a un attribut invalide \"{1}\", la variable \"{2}\" est " "la variable \"{0}\" a un attribut invalide \"{1}\", la variable \"{2}\" est "
"multiple mais est dans une liste" "multiple mais est dans une liste"
#: src/rougail/convert/object_model.py:671 #: src/rougail/convert/object_model.py:666
msgid "" msgid ""
"the variable \"{0}\" is waiting for a list as \"{1}\" but the attribute " "the variable \"{0}\" is waiting for a list as \"{1}\" but the attribute "
"\"default\" is not a list (\"{2}\")" "\"default\" is not a list (\"{2}\")"
@ -426,7 +390,7 @@ msgstr ""
"la variable \"{0}\" attend une liste comme \"{1}\" mais l'attribut " "la variable \"{0}\" attend une liste comme \"{1}\" mais l'attribut "
"\"default\" n'est pas une liste \"{2}\"" "\"default\" n'est pas une liste \"{2}\""
#: src/rougail/convert/object_model.py:673 #: src/rougail/convert/object_model.py:668
msgid "" msgid ""
"the variable \"{0}\" is not waiting for a list as \"{1}\" but the attribute " "the variable \"{0}\" is not waiting for a list as \"{1}\" but the attribute "
"\"default\" is a list (\"{2}\")" "\"default\" is a list (\"{2}\")"
@ -434,7 +398,7 @@ msgstr ""
"la variable \"{0}\" n'attend pas une liste comme \"{1}\" mais l'attribut " "la variable \"{0}\" n'attend pas une liste comme \"{1}\" mais l'attribut "
"\"default\" est une liste \"{2}\"" "\"default\" est une liste \"{2}\""
#: src/rougail/convert/object_model.py:689 #: src/rougail/convert/object_model.py:684
msgid "" msgid ""
"\"{0}\" attribut shall not have an \"optional\" attribute without the " "\"{0}\" attribut shall not have an \"optional\" attribute without the "
"\"default\" attribute for variable \"{1}\"" "\"default\" attribute for variable \"{1}\""
@ -442,7 +406,7 @@ msgstr ""
"l'attribut \"{0}\" ne devrait pas avoir d'attribut \"optional\" sans " "l'attribut \"{0}\" ne devrait pas avoir d'attribut \"optional\" sans "
"l'attribut \"default\" pour la variable \"{1}\"" "l'attribut \"default\" pour la variable \"{1}\""
#: src/rougail/convert/object_model.py:713 #: src/rougail/convert/object_model.py:708
msgid "" msgid ""
"variable \"{0}\" has a default value calculated with \"{1}\" which has " "variable \"{0}\" has a default value calculated with \"{1}\" which has "
"incompatible type" "incompatible type"
@ -450,7 +414,7 @@ msgstr ""
"la variable \"{0}\" a une valeur par défaut calculé a partir de \"{1}\" " "la variable \"{0}\" a une valeur par défaut calculé a partir de \"{1}\" "
"laquelle a un type incompatible" "laquelle a un type incompatible"
#: src/rougail/convert/object_model.py:756 #: src/rougail/convert/object_model.py:751
msgid "" msgid ""
"the variable \"{0}\" is waiting for a boolean as \"{1}\" but the attribute " "the variable \"{0}\" is waiting for a boolean as \"{1}\" but the attribute "
"\"default\" is not a boolean (\"{2}\")" "\"default\" is not a boolean (\"{2}\")"
@ -458,7 +422,7 @@ msgstr ""
"la variable \"{0}\" attend un booléan comme \"{1}\" mais l'attribut " "la variable \"{0}\" attend un booléan comme \"{1}\" mais l'attribut "
"\"default\" n'est pas une booléan (\"{2}\")" "\"default\" n'est pas une booléan (\"{2}\")"
#: src/rougail/convert/object_model.py:776 #: src/rougail/convert/object_model.py:771
msgid "" msgid ""
"\"when\" is not allowed in format version 1.0 for attribute \"{0}\" for " "\"when\" is not allowed in format version 1.0 for attribute \"{0}\" for "
"variable \"{1}\"" "variable \"{1}\""
@ -466,7 +430,7 @@ msgstr ""
"\"when\" n'est pas autorisé avec le format en version 1.0 pour l'attribut " "\"when\" n'est pas autorisé avec le format en version 1.0 pour l'attribut "
"\"{0}\" pour la variable \"{1}\"" "\"{0}\" pour la variable \"{1}\""
#: src/rougail/convert/object_model.py:781 #: src/rougail/convert/object_model.py:776
msgid "" msgid ""
"the variable \"{0}\" has an invalid attribute \"{1}\", \"when\" and " "the variable \"{0}\" has an invalid attribute \"{1}\", \"when\" and "
"\"when_not\" cannot set together" "\"when_not\" cannot set together"
@ -474,7 +438,7 @@ msgstr ""
"la variable \"{0}\" a un attribut invalide \"{1}\", \"when\" et \"when_not\" " "la variable \"{0}\" a un attribut invalide \"{1}\", \"when\" et \"when_not\" "
"ne peuvent pas être défini ensemble" "ne peuvent pas être défini ensemble"
#: src/rougail/convert/object_model.py:789 #: src/rougail/convert/object_model.py:784
msgid "" msgid ""
"\"when_not\" is not allowed in format version 1.0 for attribute \"{0}\" for " "\"when_not\" is not allowed in format version 1.0 for attribute \"{0}\" for "
"variable \"{1}\"" "variable \"{1}\""
@ -482,7 +446,7 @@ msgstr ""
"\"when_not\" n'est pas autorisé au format 1.0 pour l'attribut \"{0}\" pour " "\"when_not\" n'est pas autorisé au format 1.0 pour l'attribut \"{0}\" pour "
"la variable variable \"{1}\"" "la variable variable \"{1}\""
#: src/rougail/convert/object_model.py:845 #: src/rougail/convert/object_model.py:840
msgid "" msgid ""
"cannot find variable \"{0}\" for the information \"{1}\" when calculating " "cannot find variable \"{0}\" for the information \"{1}\" when calculating "
"\"{2}\"" "\"{2}\""
@ -490,19 +454,19 @@ msgstr ""
"ne peut trouver la variable \"{0}\" pour l'information \"{1}\" lors du " "ne peut trouver la variable \"{0}\" pour l'information \"{1}\" lors du "
"calcul de \"{2}\"" "calcul de \"{2}\""
#: src/rougail/convert/object_model.py:850 #: src/rougail/convert/object_model.py:845
msgid "" msgid ""
"identifier not allowed for the information \"{0}\" when calculating \"{1}\"" "identifier not allowed for the information \"{0}\" when calculating \"{1}\""
msgstr "" msgstr ""
"identifier n'est pas autorisé pour l'information \"{0}\" lors du calcul de " "identifier n'est pas autorisé pour l'information \"{0}\" lors du calcul de "
"\"{1}\"" "\"{1}\""
#: src/rougail/convert/object_model.py:902 #: src/rougail/convert/object_model.py:897
msgid "\"when\" is not allowed in format version 1.0 for attribute \"{0}\"" 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}\"" msgstr "\"when\" n'est pas autorisé au format 1.0 pour l'attribut \"{0}\""
#: src/rougail/convert/object_model.py:908 #: src/rougail/convert/object_model.py:903
#: src/rougail/convert/object_model.py:918 #: src/rougail/convert/object_model.py:913
msgid "" msgid ""
"the identifier has an invalid attribute \"{0}\", \"when\" and \"when_not\" " "the identifier has an invalid attribute \"{0}\", \"when\" and \"when_not\" "
"cannot set together" "cannot set together"
@ -510,7 +474,7 @@ msgstr ""
"l'identifiant a un attribut invalide \"{0}\", \"when\" et \"when_not\" ne " "l'identifiant a un attribut invalide \"{0}\", \"when\" et \"when_not\" ne "
"peuvent pas être défini ensemble" "peuvent pas être défini ensemble"
#: src/rougail/convert/object_model.py:944 #: src/rougail/convert/object_model.py:939
msgid "" msgid ""
"the variable \"{0}\" is not a follower, so cannot have index type for \"{1}\"" "the variable \"{0}\" is not a follower, so cannot have index type for \"{1}\""
msgstr "" msgstr ""
@ -530,7 +494,7 @@ msgid "internal error, {0} is not a dynamic variable"
msgstr "erreur interne, \"{0}\" n'est pas une variable dynamique" msgstr "erreur interne, \"{0}\" n'est pas une variable dynamique"
#: src/rougail/error.py:61 src/rougail/tiramisu.py:157 #: src/rougail/error.py:61 src/rougail/tiramisu.py:157
#: src/rougail/user_datas.py:407 src/rougail/user_datas.py:410 #: src/rougail/user_datas.py:392 src/rougail/user_datas.py:395
msgid "{0} in {1}" msgid "{0} in {1}"
msgstr "{0} dans {1}" msgstr "{0} dans {1}"
@ -588,24 +552,24 @@ msgstr ""
"ne peut calculer l'attribut \"{0}\" pour la variable \"{1}\" dans {2} avec " "ne peut calculer l'attribut \"{0}\" pour la variable \"{1}\" dans {2} avec "
"les paramètres \"{3}\" : {4}" "les paramètres \"{3}\" : {4}"
#: src/rougail/user_datas.py:145 #: src/rougail/user_datas.py:135
msgid "" msgid ""
"cannot load variable path \"{0}\", the identifier \"{1}\" is not valid in {2}" "cannot load variable path \"{0}\", the identifier \"{1}\" is not valid in {2}"
msgstr "" msgstr ""
"ne peut charger la variable \"{0}\", l'identifiant \"{1}\" n'est pas valide " "ne peut charger la variable \"{0}\", l'identifiant \"{1}\" n'est pas valide "
"dans {2}" "dans {2}"
#: src/rougail/user_datas.py:228 #: src/rougail/user_datas.py:218
msgid "the variable \"{0}\" contains secrets and should not be defined in {1}" msgid "the variable \"{0}\" contains secrets and should not be defined in {1}"
msgstr "" msgstr ""
"la variable \"{0}\" contient des secrets et ne devrait pas être défini dans " "la variable \"{0}\" contient des secrets et ne devrait pas être défini dans "
"{1}" "{1}"
#: src/rougail/user_datas.py:268 #: src/rougail/user_datas.py:257
msgid "loaded from {0}" msgid "loaded from {0}"
msgstr "chargée depuis {0}" msgstr "chargée depuis {0}"
#: src/rougail/user_datas.py:308 #: src/rougail/user_datas.py:297
msgid "" msgid ""
"cannot set the value \"{0}\" to the family {1}, it will be ignored when " "cannot set the value \"{0}\" to the family {1}, it will be ignored when "
"loading from {2}" "loading from {2}"
@ -613,11 +577,7 @@ msgstr ""
"impossible de définir la valeur \"{0}\" à la famille {1}, elle sera ignorée " "impossible de définir la valeur \"{0}\" à la famille {1}, elle sera ignorée "
"lors du chargement depuis {2}" "lors du chargement depuis {2}"
#: src/rougail/user_datas.py:319 src/rougail/user_datas.py:336 #: src/rougail/user_datas.py:309
msgid "{0} loaded from {1}"
msgstr "{0} chargée depuis {1}"
#: src/rougail/user_datas.py:324
msgid "" msgid ""
"variable or family \"{0}\" does not exist, it will be ignored when loading " "variable or family \"{0}\" does not exist, it will be ignored when loading "
"from {1}" "from {1}"
@ -625,7 +585,7 @@ msgstr ""
"la variable ou la famille \"{0}\" n'existe pas, elle sera ignorée lors du " "la variable ou la famille \"{0}\" n'existe pas, elle sera ignorée lors du "
"chargement depuis {1}" "chargement depuis {1}"
#: src/rougail/user_datas.py:330 #: src/rougail/user_datas.py:315
msgid "" msgid ""
"\"{0}\" is the name of a dynamic family, it will be ignored when loading " "\"{0}\" is the name of a dynamic family, it will be ignored when loading "
"from {1}" "from {1}"
@ -633,7 +593,11 @@ msgstr ""
"\"{0}\" est le nom d'une famille dynamique, il sera ignoré lors du " "\"{0}\" est le nom d'une famille dynamique, il sera ignoré lors du "
"chargement depuis {1}" "chargement depuis {1}"
#: src/rougail/user_datas.py:364 #: src/rougail/user_datas.py:321
msgid "{0} loaded from {1}"
msgstr "{0} chargée depuis {1}"
#: src/rougail/user_datas.py:349
msgid "" msgid ""
"variable {0} at index \"{1}\" is {2}, it will be ignored when loading from " "variable {0} at index \"{1}\" is {2}, it will be ignored when loading from "
"{3}" "{3}"
@ -641,23 +605,23 @@ msgstr ""
"la variable {0} à l'index \"{1}\" est {2}, elle sera ignorée lors du " "la variable {0} à l'index \"{1}\" est {2}, elle sera ignorée lors du "
"chargement depuis {3}" "chargement depuis {3}"
#: src/rougail/user_datas.py:375 #: src/rougail/user_datas.py:360
msgid "" msgid ""
"family {0} is {1}, {2} at index \"{3}\" will be ignored when loading from {4}" "family {0} is {1}, {2} at index \"{3}\" will be ignored when loading from {4}"
msgstr "" msgstr ""
"la famille {0} est {1}, {2} à l'index \"{3}\" sera ignorée lors du " "la famille {0} est {1}, {2} à l'index \"{3}\" sera ignorée lors du "
"chargement depuis {4}" "chargement depuis {4}"
#: src/rougail/user_datas.py:388 #: src/rougail/user_datas.py:373
msgid "variable {0} is {1}, it will be ignored when loading from {2}" msgid "variable {0} is {1}, it will be ignored when loading from {2}"
msgstr "" msgstr ""
"la variable {0} est {1}, elle sera ignorée lors du chargement depuis {2}" "la variable {0} est {1}, elle sera ignorée lors du chargement depuis {2}"
#: src/rougail/user_datas.py:396 #: src/rougail/user_datas.py:381
msgid "family {0} is {1}, {2} will be ignored when loading from {3}" 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}" msgstr "la famille {0} est {1}, {2} sera ignorée lors du chargement depuis {3}"
#: src/rougail/user_datas.py:416 #: src/rougail/user_datas.py:401
msgid "" msgid ""
"the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it will " "the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it will "
"be ignored when loading from {5}" "be ignored when loading from {5}"
@ -665,7 +629,7 @@ msgstr ""
"la valeur \"{0}\" est un invalide {1} 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}" "sera ignorée lors du chargement depuis {5}"
#: src/rougail/user_datas.py:430 #: src/rougail/user_datas.py:415
msgid "" msgid ""
"the value \"{0}\" is an invalid {1} for {2}, {3}, it will be ignored when " "the value \"{0}\" is an invalid {1} for {2}, {3}, it will be ignored when "
"loading from {4}" "loading from {4}"
@ -705,28 +669,6 @@ msgstr "unique"
msgid "auto modified" msgid "auto modified"
msgstr "auto modifiée" msgstr "auto modifiée"
#, fuzzy
#~| msgid ""
#~| "we need {0} values when there are {{{{ var | length }}}} ({{{{ var | "
#~| "join(\", \")}}}})"
#~ msgid ""
#~ "it needs {0} values maximum when there are {{{{ var | length }}}} "
#~ "({{{{ var | join(\", \")}}}})"
#~ msgstr ""
#~ "we need {0} values when there are {{{{ var | length }}}} ({{{{ var | "
#~ "join(\", \")}}}})"
#, fuzzy
#~| msgid ""
#~| "we need {0} values when there are {{{{ var | length }}}} ({{{{ var | "
#~| "join(\", \")}}}})"
#~ msgid ""
#~ "it needs {0} values minimum when there are {{{{ var | length }}}} "
#~ "({{{{ var | join(\", \")}}}})"
#~ msgstr ""
#~ "we need {0} values when there are {{{{ var | length }}}} ({{{{ var | "
#~ "join(\", \")}}}})"
#~ msgid "" #~ msgid ""
#~ "the variable \"{0}\" is a family, so cannot set the value \"{1}\" in {2}" #~ "the variable \"{0}\" is a family, so cannot set the value \"{1}\" in {2}"
#~ msgstr "" #~ msgstr ""

View file

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2025-11-06 21:32+0100\n" "POT-Creation-Date: 2025-10-26 15:29+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -56,7 +56,7 @@ msgid "invalid tag name \"{0}\" should not be a name of an existing mode"
msgstr "" msgstr ""
#: src/rougail/annotator/property.py:168 #: src/rougail/annotator/property.py:168
msgid "invalid tag name \"{0}\" should not be the name of an available properties" msgid "invalid tag name \"{0}\" should not be name of an available properties"
msgstr "" msgstr ""
#: src/rougail/annotator/value.py:78 #: src/rougail/annotator/value.py:78
@ -87,115 +87,87 @@ msgstr ""
msgid "the variable \"{0}\" has attribute \"secret_manager\" so must not have default value" msgid "the variable \"{0}\" has attribute \"secret_manager\" so must not have default value"
msgstr "" msgstr ""
#: src/rougail/annotator/variable.py:154 #: src/rougail/annotator/variable.py:254
msgid "{0} values needed, but there are {{{{ var | length }}}}"
msgstr ""
#: src/rougail/annotator/variable.py:155
msgid "needs exactly {0} values"
msgstr ""
#: 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:158
msgid "needs a maximum of {0} values"
msgstr ""
#: 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:161
msgid "needs a minimum of {0} values"
msgstr ""
#: src/rougail/annotator/variable.py:223
msgid "the \"{0}\" default value is a calculation with itself"
msgstr ""
#: src/rougail/annotator/variable.py:285
msgid "the variable \"{0}\" has regexp attribut but has not the \"regexp\" type" msgid "the variable \"{0}\" has regexp attribut but has not the \"regexp\" type"
msgstr "" msgstr ""
#: src/rougail/annotator/variable.py:328 #: src/rougail/annotator/variable.py:297
msgid "the variable \"{0}\" has choices attribut but has not the \"choice\" type" msgid "the variable \"{0}\" has choices attribut but has not the \"choice\" type"
msgstr "" msgstr ""
#: src/rougail/annotator/variable.py:356 #: src/rougail/annotator/variable.py:325
msgid "the variable \"{0}\" has an unvalid default value \"{1}\" should be in {2}" msgid "the variable \"{0}\" has an unvalid default value \"{1}\" should be in {2}"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:276 #: src/rougail/config/__init__.py:235
msgid "Structure format version by default, if not specified in structure file" msgid "Structure format version by default, if not specified in structure file"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:284 #: src/rougail/config/__init__.py:243
msgid "File with functions" msgid "File with functions"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:296 #: src/rougail/config/__init__.py:255
msgid "All modes level available" msgid "All modes level available"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:308 #: src/rougail/config/__init__.py:267
msgid "Default mode for a family" msgid "Default mode for a family"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:328 #: src/rougail/config/__init__.py:287
msgid "Default mode for a variable" msgid "Default mode for a variable"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:352 #: src/rougail/config/__init__.py:311
msgid "Option name for the base option" msgid "Option name for the base option"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:357 #: src/rougail/config/__init__.py:316
msgid "In cache file, do not importation of Tiramisu and other dependencies" msgid "In cache file, do not importation of Tiramisu and other dependencies"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:362 #: src/rougail/config/__init__.py:321
msgid "Tiramisu cache filename" msgid "Tiramisu cache filename"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:370 #: src/rougail/config/__init__.py:329
msgid "Name of internal functions that we can use as a function" msgid "Name of internal functions that we can use as a function"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:376 #: src/rougail/config/__init__.py:335
msgid "Name of extra annotators" msgid "Name of extra annotators"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:382 #: src/rougail/config/__init__.py:341
msgid "Suffix add to generated options name" msgid "Suffix add to generated options name"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:388 #: src/rougail/config/__init__.py:347
msgid "Every variables in calculation are optionals" msgid "Every variables in calculation are optionals"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:392 #: src/rougail/config/__init__.py:351
msgid "Loads redefine variables even if there don't already exists" msgid "Loads redefine variables even if there don't already exists"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:399 #: src/rougail/config/__init__.py:358
msgid "The secret pattern to build item name in Bitwarden" msgid "The secret pattern to build item name in Bitwarden"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:400 #: src/rougail/config/__init__.py:359
msgid "The pattern is in Jinja format" msgid "The pattern is in Jinja format"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:428 #: src/rougail/config/__init__.py:387
msgid "Select for {0}" msgid "Select for {0}"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:508 #: src/rougail/config/__init__.py:467
msgid "Override default parameters for option type" msgid "Override default parameters for option type"
msgstr "" msgstr ""
#: src/rougail/config/__init__.py:511 #: src/rougail/config/__init__.py:470
msgid "Default parameters for option type" msgid "Default parameters for option type"
msgstr "" msgstr ""
@ -231,125 +203,121 @@ msgstr ""
msgid "invalid \"structural\" definition ({0}), we cannot load any structural file!" msgid "invalid \"structural\" definition ({0}), we cannot load any structural file!"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:121 #: src/rougail/convert/object_model.py:122
msgid "cannot find variable \"{0}\" defined in attribute \"{1}\" for \"{2}\"" msgid "cannot find variable \"{0}\" defined in attribute \"{1}\" for \"{2}\""
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:127 #: src/rougail/convert/object_model.py:128
msgid "the variable \"{0}\" is in fact a family in attribute \"{1}\" for \"{2}\"" msgid "the variable \"{0}\" is in fact a family in attribute \"{1}\" for \"{2}\""
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:132 #: src/rougail/convert/object_model.py:133
#: src/rougail/convert/object_model.py:484 #: src/rougail/convert/object_model.py:479
msgid "unknown object \"{0}\" in attribute \"{1}\" for \"{2}\"" msgid "unknown object \"{0}\" in attribute \"{1}\" for \"{2}\""
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:151 #: src/rougail/convert/object_model.py:152
msgid "identifier parameter for \"{0}\" in \"{1}\" cannot be set none dynamic family" msgid "identifier parameter for \"{0}\" in \"{1}\" cannot be set none dynamic family"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:180 #: src/rougail/convert/object_model.py:181
msgid "cannot find variable \"{0}\" defined in \"{1}\" for \"{2}\"" msgid "cannot find variable \"{0}\" defined in \"{1}\" for \"{2}\""
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:185 #: src/rougail/convert/object_model.py:186
msgid "variable \"{0}\" defined in \"{1}\" for \"{2}\" is a dynamic variable" msgid "variable \"{0}\" defined in \"{1}\" for \"{2}\" is a dynamic variable"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:202 #: src/rougail/convert/object_model.py:203
msgid "the variable \"{0}\" is not a follower, so cannot have index type for param in \"{1}\"" msgid "the variable \"{0}\" is not a follower, so cannot have index type for param in \"{1}\""
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:252 #: src/rougail/convert/object_model.py:405
msgid "\"warnings\" are only available with attribute \"{self.attribute_name}\" for variable \"{self.ori_path}\""
msgstr ""
#: 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}\"" msgid "variable \"{0}\" has a calculating \"{1}\" with an invalid return_type, should be boolean or string, not \"{2}\""
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:479 #: src/rougail/convert/object_model.py:474
msgid "a variable \"{0}\" is needs in attribute \"{1}\" for \"{2}\" but it's a family" msgid "a variable \"{0}\" is needs in attribute \"{1}\" for \"{2}\" but it's a family"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:504 #: src/rougail/convert/object_model.py:499
msgid "variable \"{0}\" has an attribute \"{1}\" calculated with the unknown variable \"{2}\"" msgid "variable \"{0}\" has an attribute \"{1}\" calculated with the unknown variable \"{2}\""
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:556 #: src/rougail/convert/object_model.py:551
msgid "the variable \"{0}\" has an invalid \"{1}\" the variable \"{2}\" is in a sub dynamic option" msgid "the variable \"{0}\" has an invalid \"{1}\" the variable \"{2}\" is in a sub dynamic option"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:565 #: src/rougail/convert/object_model.py:560
msgid "the leader \"{0}\" has an invalid \"{1}\" the follower \"{2}\" is a multi" msgid "the leader \"{0}\" has an invalid \"{1}\" the follower \"{2}\" is a multi"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:607 #: src/rougail/convert/object_model.py:602
msgid "the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" must not be multi" msgid "the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" must not be multi"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:621 #: src/rougail/convert/object_model.py:616
msgid "the variable \"{0}\" has an invalid attribute \"{1}\", the variable must not be a multi or the variable \"{2}\" must be multi" msgid "the variable \"{0}\" has an invalid attribute \"{1}\", the variable must not be a multi or the variable \"{2}\" must be multi"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:635 #: src/rougail/convert/object_model.py:630
msgid "the variable \"{0}\" has an invalid attribute \"{1}\", the variable must be a multi or the variable \"{2}\" must not be multi" msgid "the variable \"{0}\" has an invalid attribute \"{1}\", the variable must be a multi or the variable \"{2}\" must not be multi"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:649 #: src/rougail/convert/object_model.py:644
msgid "the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" is multi but is inside a list" msgid "the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" is multi but is inside a list"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:671 #: src/rougail/convert/object_model.py:666
msgid "the variable \"{0}\" is waiting for a list as \"{1}\" but the attribute \"default\" is not a list (\"{2}\")" msgid "the variable \"{0}\" is waiting for a list as \"{1}\" but the attribute \"default\" is not a list (\"{2}\")"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:673 #: src/rougail/convert/object_model.py:668
msgid "the variable \"{0}\" is not waiting for a list as \"{1}\" but the attribute \"default\" is a list (\"{2}\")" msgid "the variable \"{0}\" is not waiting for a list as \"{1}\" but the attribute \"default\" is a list (\"{2}\")"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:689 #: src/rougail/convert/object_model.py:684
msgid "\"{0}\" attribut shall not have an \"optional\" attribute without the \"default\" attribute for variable \"{1}\"" msgid "\"{0}\" attribut shall not have an \"optional\" attribute without the \"default\" attribute for variable \"{1}\""
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:713 #: src/rougail/convert/object_model.py:708
msgid "variable \"{0}\" has a default value calculated with \"{1}\" which has incompatible type" msgid "variable \"{0}\" has a default value calculated with \"{1}\" which has incompatible type"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:756 #: src/rougail/convert/object_model.py:751
msgid "the variable \"{0}\" is waiting for a boolean as \"{1}\" but the attribute \"default\" is not a boolean (\"{2}\")" msgid "the variable \"{0}\" is waiting for a boolean as \"{1}\" but the attribute \"default\" is not a boolean (\"{2}\")"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:776 #: src/rougail/convert/object_model.py:771
msgid "\"when\" is not allowed in format version 1.0 for attribute \"{0}\" for variable \"{1}\"" msgid "\"when\" is not allowed in format version 1.0 for attribute \"{0}\" for variable \"{1}\""
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:781 #: src/rougail/convert/object_model.py:776
msgid "the variable \"{0}\" has an invalid attribute \"{1}\", \"when\" and \"when_not\" cannot set together" msgid "the variable \"{0}\" has an invalid attribute \"{1}\", \"when\" and \"when_not\" cannot set together"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:789 #: src/rougail/convert/object_model.py:784
msgid "\"when_not\" is not allowed in format version 1.0 for attribute \"{0}\" for variable \"{1}\"" msgid "\"when_not\" is not allowed in format version 1.0 for attribute \"{0}\" for variable \"{1}\""
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:845 #: src/rougail/convert/object_model.py:840
msgid "cannot find variable \"{0}\" for the information \"{1}\" when calculating \"{2}\"" msgid "cannot find variable \"{0}\" for the information \"{1}\" when calculating \"{2}\""
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:850 #: src/rougail/convert/object_model.py:845
msgid "identifier not allowed for the information \"{0}\" when calculating \"{1}\"" msgid "identifier not allowed for the information \"{0}\" when calculating \"{1}\""
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:902 #: src/rougail/convert/object_model.py:897
msgid "\"when\" is not allowed in format version 1.0 for attribute \"{0}\"" msgid "\"when\" is not allowed in format version 1.0 for attribute \"{0}\""
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:908 #: src/rougail/convert/object_model.py:903
#: src/rougail/convert/object_model.py:918 #: src/rougail/convert/object_model.py:913
msgid "the identifier has an invalid attribute \"{0}\", \"when\" and \"when_not\" cannot set together" msgid "the identifier has an invalid attribute \"{0}\", \"when\" and \"when_not\" cannot set together"
msgstr "" msgstr ""
#: src/rougail/convert/object_model.py:944 #: src/rougail/convert/object_model.py:939
msgid "the variable \"{0}\" is not a follower, so cannot have index type for \"{1}\"" msgid "the variable \"{0}\" is not a follower, so cannot have index type for \"{1}\""
msgstr "" msgstr ""
@ -362,7 +330,7 @@ msgid "internal error, {0} is not a dynamic variable"
msgstr "" msgstr ""
#: src/rougail/error.py:61 src/rougail/tiramisu.py:157 #: src/rougail/error.py:61 src/rougail/tiramisu.py:157
#: src/rougail/user_datas.py:407 src/rougail/user_datas.py:410 #: src/rougail/user_datas.py:392 src/rougail/user_datas.py:395
msgid "{0} in {1}" msgid "{0} in {1}"
msgstr "" msgstr ""
@ -414,55 +382,55 @@ msgstr ""
msgid "cannot calculating \"{0}\" attribute for variable \"{1}\" in {2} with parameters \"{3}\": {4}" msgid "cannot calculating \"{0}\" attribute for variable \"{1}\" in {2} with parameters \"{3}\": {4}"
msgstr "" msgstr ""
#: src/rougail/user_datas.py:145 #: src/rougail/user_datas.py:135
msgid "cannot load variable path \"{0}\", the identifier \"{1}\" is not valid in {2}" msgid "cannot load variable path \"{0}\", the identifier \"{1}\" is not valid in {2}"
msgstr "" msgstr ""
#: src/rougail/user_datas.py:228 #: src/rougail/user_datas.py:218
msgid "the variable \"{0}\" contains secrets and should not be defined in {1}" msgid "the variable \"{0}\" contains secrets and should not be defined in {1}"
msgstr "" msgstr ""
#: src/rougail/user_datas.py:268 #: src/rougail/user_datas.py:257
msgid "loaded from {0}" msgid "loaded from {0}"
msgstr "" msgstr ""
#: src/rougail/user_datas.py:308 #: src/rougail/user_datas.py:297
msgid "cannot set the value \"{0}\" to the family {1}, it will be ignored when loading from {2}" msgid "cannot set the value \"{0}\" to the family {1}, it will be ignored when loading from {2}"
msgstr "" msgstr ""
#: src/rougail/user_datas.py:319 src/rougail/user_datas.py:336 #: src/rougail/user_datas.py:309
msgid "{0} loaded from {1}"
msgstr ""
#: src/rougail/user_datas.py:324
msgid "variable or family \"{0}\" does not exist, it will be ignored when loading from {1}" msgid "variable or family \"{0}\" does not exist, it will be ignored when loading from {1}"
msgstr "" msgstr ""
#: src/rougail/user_datas.py:330 #: src/rougail/user_datas.py:315
msgid "\"{0}\" is the name of a dynamic family, it will be ignored when loading from {1}" msgid "\"{0}\" is the name of a dynamic family, it will be ignored when loading from {1}"
msgstr "" msgstr ""
#: src/rougail/user_datas.py:364 #: src/rougail/user_datas.py:321
msgid "{0} loaded from {1}"
msgstr ""
#: src/rougail/user_datas.py:349
msgid "variable {0} at index \"{1}\" is {2}, it will be ignored when loading from {3}" msgid "variable {0} at index \"{1}\" is {2}, it will be ignored when loading from {3}"
msgstr "" msgstr ""
#: src/rougail/user_datas.py:375 #: src/rougail/user_datas.py:360
msgid "family {0} is {1}, {2} at index \"{3}\" will be ignored when loading from {4}" msgid "family {0} is {1}, {2} at index \"{3}\" will be ignored when loading from {4}"
msgstr "" msgstr ""
#: src/rougail/user_datas.py:388 #: src/rougail/user_datas.py:373
msgid "variable {0} is {1}, it will be ignored when loading from {2}" msgid "variable {0} is {1}, it will be ignored when loading from {2}"
msgstr "" msgstr ""
#: src/rougail/user_datas.py:396 #: src/rougail/user_datas.py:381
msgid "family {0} is {1}, {2} will be ignored when loading from {3}" msgid "family {0} is {1}, {2} will be ignored when loading from {3}"
msgstr "" msgstr ""
#: src/rougail/user_datas.py:416 #: src/rougail/user_datas.py:401
msgid "the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it will be ignored when loading from {5}" msgid "the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it will be ignored when loading from {5}"
msgstr "" msgstr ""
#: src/rougail/user_datas.py:430 #: src/rougail/user_datas.py:415
msgid "the value \"{0}\" is an invalid {1} for {2}, {3}, it will be ignored when loading from {4}" msgid "the value \"{0}\" is an invalid {1} for {2}, {3}, it will be ignored when loading from {4}"
msgstr "" msgstr ""

View file

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

View file

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

View file

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

View file

@ -147,15 +147,12 @@ class Annotator(Walk):
for tag in variable.tags: for tag in variable.tags:
self.check_tag(tag, variable.xmlfiles) self.check_tag(tag, variable.xmlfiles)
self.objectspace.properties.add(variable.path, tag, True) self.objectspace.properties.add(variable.path, tag, True)
self.objectspace.informations.add( self.objectspace.informations.add(variable.path, "tags", tuple(variable.tags))
variable.path, "tags", tuple(variable.tags)
)
def check_tag( def check_tag(self,
self, tag: str,
tag: str, xmlfiles: List[str],
xmlfiles: List[str], ):
):
match = NAME_REGEXP.search(tag) match = NAME_REGEXP.search(tag)
if not match: if not match:
msg = _( msg = _(
@ -169,7 +166,7 @@ class Annotator(Walk):
raise DictConsistencyError(msg, 82, xmlfiles) raise DictConsistencyError(msg, 82, xmlfiles)
if tag in PROPERTIES_MAKE_SENSE: if tag in PROPERTIES_MAKE_SENSE:
msg = _( msg = _(
'invalid tag name "{0}" should not be the name of an available properties' 'invalid tag name "{0}" should not be name of an available properties'
).format(tag) ).format(tag)
raise DictConsistencyError(msg, 82, xmlfiles) raise DictConsistencyError(msg, 82, xmlfiles)

View file

@ -29,13 +29,7 @@ from tiramisu.error import display_list
from rougail.i18n import _ from rougail.i18n import _
from rougail.utils import calc_multi_for_type_variable from rougail.utils import calc_multi_for_type_variable
from rougail.error import DictConsistencyError from rougail.error import DictConsistencyError
from rougail.convert.object_model import ( from rougail.convert.object_model import Calculation, VariableCalculation, IndexCalculation
Calculation,
VariableCalculation,
VariableParam,
IndexCalculation,
JinjaCalculation,
)
from rougail.tiramisu import display_xmlfiles, RENAME_TYPE from rougail.tiramisu import display_xmlfiles, RENAME_TYPE
from warnings import warn from warnings import warn
@ -122,87 +116,37 @@ class Annotator(Walk): # pylint: disable=R0903
continue continue
if variable.type in RENAME_TYPE: if variable.type in RENAME_TYPE:
warning = f'the variable "{ variable.path }" has a depreciated type "{variable.type}", please use "{RENAME_TYPE[variable.type]}" instead in {display_xmlfiles(variable.xmlfiles)}' warning = f'the variable "{ variable.path }" has a depreciated type "{variable.type}", please use "{RENAME_TYPE[variable.type]}" instead in {display_xmlfiles(variable.xmlfiles)}'
warn( warn(warning,
warning, DeprecationWarning,
DeprecationWarning, )
)
variable.type = RENAME_TYPE[variable.type] variable.type = RENAME_TYPE[variable.type]
if variable.type == "cidr": if variable.type == 'cidr':
warning = f'the variable "{ variable.path }" has a depreciated type "{variable.type}", please use type "ip" with attribute cidr=True instead in {display_xmlfiles(variable.xmlfiles)}' warning = f'the variable "{ variable.path }" has a depreciated type "{variable.type}", please use type "ip" with attribute cidr=True instead in {display_xmlfiles(variable.xmlfiles)}'
warn( warn(warning,
warning, DeprecationWarning,
DeprecationWarning, )
) if variable.type == 'network_cidr':
if variable.type == "network_cidr":
warning = f'the variable "{ variable.path }" has a depreciated type "{variable.type}", please use type "network" with attribute cidr=True instead in {display_xmlfiles(variable.xmlfiles)}' warning = f'the variable "{ variable.path }" has a depreciated type "{variable.type}", please use type "network" with attribute cidr=True instead in {display_xmlfiles(variable.xmlfiles)}'
warn( warn(warning,
warning, DeprecationWarning,
DeprecationWarning, )
)
self.objectspace.informations.add( self.objectspace.informations.add(
variable.path, "ymlfiles", variable.xmlfiles variable.path, "ymlfiles", variable.xmlfiles
) )
if variable.version != "1.0" and variable.type is None: if variable.version != "1.0" and variable.type is None:
if isinstance(variable.default, IndexCalculation): if isinstance(
variable.type = "integer" variable.default, IndexCalculation
elif isinstance(variable.default, VariableCalculation): ):
variable.type = 'integer'
elif isinstance(
variable.default, VariableCalculation
):
calculated_variable_path, calculated_variable, identifier = ( calculated_variable_path, calculated_variable, identifier = (
variable.default.get_variable(self.objectspace) variable.default.get_variable(self.objectspace)
) )
if calculated_variable is not None: if calculated_variable is not None:
self._default_variable_copy_informations( self._default_variable_copy_informations(variable, calculated_variable)
variable, calculated_variable
)
self._convert_variable(variable) self._convert_variable(variable)
if variable.multi and variable.params:
indexes_to_remove = []
for idx, param in enumerate(variable.params):
if param.key == "multi_length":
jinja = f'{{% if var | length != {param.value} %}}{_("{0} values needed, but there are {{{{ var | length }}}}").format(param.value)}{{% endif %}}'
description = _("needs exactly {0} values").format(param.value)
elif param.key == "multi_max_length":
jinja = f'{{% if var | length > {param.value} %}}{_("a maximum of {0} values are needed, but there are {{{{ var | length }}}}").format(param.value)}{{% endif %}}'
description = _("needs a maximum of {0} values").format(
param.value
)
elif param.key == "multi_min_length":
jinja = f'{{% if var | length < {param.value} %}}{_("a minimum of {0} values are needed, but there are {{{{ var | length }}}}").format(param.value)}{{% endif %}}'
description = _("needs a minimum of {0} values").format(
param.value
)
else:
continue
indexes_to_remove.append(idx)
if variable.validators is None:
variable.validators = []
variable.validators.append(
JinjaCalculation(
path=variable.path,
inside_list=True,
version=variable.version,
xmlfiles=variable.xmlfiles,
attribute_name="validators",
namespace=variable.namespace,
jinja=jinja,
description=description,
params=[
VariableParam(
variable.path,
"validators",
False,
variable.xmlfiles,
key="var",
namespace=variable.namespace,
type="variable",
variable=variable.path,
whole=True,
)
],
)
)
for idx in reversed(indexes_to_remove):
variable.params.pop(idx)
def _convert_variable_inference( def _convert_variable_inference(
self, self,
@ -245,8 +189,10 @@ class Annotator(Walk): # pylint: disable=R0903
and variable.path == calculated_variable.default.path and variable.path == calculated_variable.default.path
): ):
msg = _( msg = _(
'the "{0}" default value is a calculation with itself' 'the "{0}" default value is a calculation with itself'.format(
).format(variable.path) variable.path
)
)
raise DictConsistencyError(msg, 75, variable.xmlfiles) raise DictConsistencyError(msg, 75, variable.xmlfiles)
self._convert_variable_multi(calculated_variable) self._convert_variable_multi(calculated_variable)
variable.multi = calc_multi_for_type_variable( variable.multi = calc_multi_for_type_variable(

View file

@ -25,7 +25,6 @@ details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
""" """
from pathlib import Path from pathlib import Path
from tiramisu import Config from tiramisu import Config
from ruamel.yaml import YAML from ruamel.yaml import YAML
@ -166,8 +165,7 @@ class _RougailConfig:
return ret return ret
def __contains__( def __contains__(
self, self, key,
key,
) -> None: ) -> None:
try: try:
self.__getitem__(key) self.__getitem__(key)
@ -206,7 +204,7 @@ class _RougailConfig:
return values return values
class RConfigLeadership: class RConfigLeadership():
def __init__(self, config, option, leader, followers): def __init__(self, config, option, leader, followers):
self.config = config self.config = config
self.option = option self.option = option
@ -222,11 +220,11 @@ class RConfigLeadership:
value, value,
) -> None: ) -> None:
self.config.property.read_write() self.config.property.read_write()
names = self.option.option("names") names = self.option.option('names')
leader = names.value.get() leader = names.value.get()
leader.append(key) leader.append(key)
names.value.set(leader) names.value.set(leader)
directories = self.option.option("directories", len(leader) - 1) directories = self.option.option('directories', len(leader) - 1)
directories.value.set(value) directories.value.set(value)
self.leader.append(key) self.leader.append(key)
self.followers.append(value) self.followers.append(value)

View file

@ -161,7 +161,7 @@ class ParserVariable:
def load_config(self) -> None: def load_config(self) -> None:
rougailconfig = self.rougailconfig rougailconfig = self.rougailconfig
self.suffix = rougailconfig["suffix"] self.suffix = rougailconfig["suffix"]
self.default_structural_format_version = rougailconfig[ self.default_structural_format_version= rougailconfig[
"default_structural_format_version" "default_structural_format_version"
] ]
self.custom_types = rougailconfig["custom_types"] self.custom_types = rougailconfig["custom_types"]
@ -586,11 +586,10 @@ class ParserVariable:
del family["variable"] del family["variable"]
if self.version != "1.0": if self.version != "1.0":
warning = f'"variable" attribute in dynamic family "{ path }" is depreciated in {filename}' warning = f'"variable" attribute in dynamic family "{ path }" is depreciated in {filename}'
warn( warn(warning,
warning, DeprecationWarning,
DeprecationWarning, stacklevel=2,
stacklevel=2, )
)
if "variable" in family: if "variable" in family:
raise Exception( raise Exception(
f'dynamic family must not have "variable" attribute for "{family["path"]}" in {family["xmlfiles"]}' f'dynamic family must not have "variable" attribute for "{family["path"]}" in {family["xmlfiles"]}'

View file

@ -249,9 +249,7 @@ class Calculation(BaseModel):
def get_params(self, objectspace): def get_params(self, objectspace):
if self.warnings is not None and self.attribute_name != "validators": if self.warnings is not None and self.attribute_name != "validators":
msg = _( msg = _('"warnings" are only available with attribute "{self.attribute_name}" for variable "{self.ori_path}"')
'"warnings" are only available with attribute "{self.attribute_name}" for variable "{self.ori_path}"'
)
raise DictConsistencyError(msg, 83, xmlfiles) raise DictConsistencyError(msg, 83, xmlfiles)
if not self.params: if not self.params:
return {} return {}
@ -312,11 +310,10 @@ class JinjaCalculation(Calculation):
objectspace.jinja[jinja_path] = self.jinja objectspace.jinja[jinja_path] = self.jinja
if return_type in RENAME_TYPE: if return_type in RENAME_TYPE:
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)}' 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( warn(warning,
warning, DeprecationWarning,
DeprecationWarning, stacklevel=2,
stacklevel=2, )
)
return_type = RENAME_TYPE[return_type] return_type = RENAME_TYPE[return_type]
default = { default = {
"function": function, "function": function,
@ -421,11 +418,7 @@ class JinjaCalculation(Calculation):
False, False,
objectspace, objectspace,
add_help=True, add_help=True,
params={ params={None: [self.attribute_name, description], "when": True, "inverse": False},
None: [self.attribute_name, description],
"when": True,
"inverse": False,
},
) )
elif self.attribute_name == "choices": elif self.attribute_name == "choices":
return_type = self.return_type return_type = self.return_type
@ -675,13 +668,9 @@ class _VariableCalculation(Calculation):
value_is_multi = isinstance(default, list) value_is_multi = isinstance(default, list)
if expected_multiple_value != value_is_multi: if expected_multiple_value != value_is_multi:
if self.attribute_name != "default" or expected_multiple_value: if self.attribute_name != "default" or expected_multiple_value:
msg = _( msg = _('the variable "{0}" is waiting for a list as "{1}" but the attribute "default" is not a list ("{2}")')
'the variable "{0}" is waiting for a list as "{1}" but the attribute "default" is not a list ("{2}")'
)
else: else:
msg = _( msg = _('the variable "{0}" is not waiting for a list as "{1}" but the attribute "default" is a list ("{2}")')
'the variable "{0}" is not waiting for a list as "{1}" but the attribute "default" is a list ("{2}")'
)
msg = msg.format(self.path, self.attribute_name, default) msg = msg.format(self.path, self.attribute_name, default)
raise DictConsistencyError(msg, 77, self.xmlfiles) raise DictConsistencyError(msg, 77, self.xmlfiles)
return default return default
@ -696,11 +685,7 @@ class VariableCalculation(_VariableCalculation):
self, self,
objectspace, objectspace,
) -> dict: ) -> dict:
if ( if self.attribute_name != "default" and self.optional and self.default is undefined:
self.attribute_name != "default"
and self.optional
and self.default is undefined
):
msg = _( msg = _(
'"{0}" attribut shall not have an "optional" attribute without the "default" attribute for variable "{1}"' '"{0}" attribut shall not have an "optional" attribute without the "default" attribute for variable "{1}"'
).format(self.attribute_name, self.variable) ).format(self.attribute_name, self.variable)
@ -710,8 +695,10 @@ class VariableCalculation(_VariableCalculation):
variable_in_calculation, variable_in_calculation,
variable_in_calculation_identifier, variable_in_calculation_identifier,
) = self.get_variable(objectspace) ) = self.get_variable(objectspace)
if not variable_in_calculation and ( if (
self.optional or objectspace.force_optional not variable_in_calculation
and (self.optional
or objectspace.force_optional)
): ):
if self.default is not undefined: if self.default is not undefined:
return self.get_default_value_optional(objectspace, self.default) return self.get_default_value_optional(objectspace, self.default)
@ -756,18 +743,17 @@ class VariablePropertyCalculation(_VariableCalculation):
variable_in_calculation_identifier, variable_in_calculation_identifier,
) = self.get_variable(objectspace) ) = self.get_variable(objectspace)
if ( if (
# self.default is not undefined and # self.default is not undefined and
not variable_in_calculation not variable_in_calculation
and (self.optional or objectspace.force_optional) and (self.optional
or objectspace.force_optional)
): ):
if self.default is undefined: if self.default is undefined:
default = False default = False
else: else:
default = self.default default = self.default
if not isinstance(default, bool): if not isinstance(default, bool):
msg = _( msg = _('the variable "{0}" is waiting for a boolean as "{1}" but the attribute "default" is not a boolean ("{2}")')
'the variable "{0}" is waiting for a boolean as "{1}" but the attribute "default" is not a boolean ("{2}")'
)
msg = msg.format(self.path, self.attribute_name, default) msg = msg.format(self.path, self.attribute_name, default)
raise DictConsistencyError(msg, 79, self.xmlfiles) raise DictConsistencyError(msg, 79, self.xmlfiles)
return self.get_default_value_optional(objectspace, default) return self.get_default_value_optional(objectspace, default)
@ -776,7 +762,7 @@ class VariablePropertyCalculation(_VariableCalculation):
variable_in_calculation_path, variable_in_calculation_path,
variable_in_calculation, variable_in_calculation,
variable_in_calculation_identifier, variable_in_calculation_identifier,
key="value", key="value"
) )
params["prop"] = self.attribute_name params["prop"] = self.attribute_name
if objectspace.force_optional and ( if objectspace.force_optional and (

View file

@ -204,8 +204,8 @@ class Paths:
option = self._data[path] option = self._data[path]
option_namespace = option.namespace option_namespace = option.namespace
if ( if (
self.isolated_namespace self.isolated_namespace and
and self.default_namespace not in [namespace, option_namespace] self.default_namespace not in [namespace, option_namespace]
and namespace != option_namespace and namespace != option_namespace
): ):
msg = _( msg = _(

View file

@ -231,10 +231,8 @@ class Common:
elif ret is not None: elif ret is not None:
calc_properties.append(ret) calc_properties.append(ret)
if properties or calc_properties: if properties or calc_properties:
return ( return "frozenset({" + ", ".join(sorted(properties) + calc_properties) + "})"
"frozenset({" + ", ".join(sorted(properties) + calc_properties) + "})" raise Exception('ca existe alors ...')
)
raise Exception("ca existe alors ...")
def calculation_property( def calculation_property(
self, self,
@ -247,6 +245,7 @@ class Common:
return None return None
return value return value
def calc_properties( def calc_properties(
self, self,
prop, prop,
@ -469,7 +468,7 @@ class Variable(Common):
keys["values"] = self.populate_calculation( keys["values"] = self.populate_calculation(
self.elt.choices, return_a_tuple=True self.elt.choices, return_a_tuple=True
) )
if keys["values"] == "(,)": if keys["values"] == '(,)':
keys["values"] = tuple() keys["values"] = tuple()
except VariableCalculationDependencyError: except VariableCalculationDependencyError:
keys["values"] = tuple() keys["values"] = tuple()

View file

@ -39,10 +39,9 @@ class Walker:
rougailconfig = self.convert.rougailconfig rougailconfig = self.convert.rougailconfig
self.sort_structural_files_all = rougailconfig["sort_structural_files_all"] self.sort_structural_files_all = rougailconfig["sort_structural_files_all"]
if rougailconfig["main_namespace"]: if rougailconfig["main_namespace"]:
self.convert.paths = Paths( self.convert.paths = Paths(rougailconfig["main_namespace"],
rougailconfig["main_namespace"], rougailconfig["isolated_namespace"],
rougailconfig["isolated_namespace"], )
)
self.load_with_extra( self.load_with_extra(
rougailconfig["extra_namespaces"], rougailconfig["extra_namespaces"],
rougailconfig["main_namespace"], rougailconfig["main_namespace"],

View file

@ -36,12 +36,7 @@ from unicodedata import normalize, combining
from jinja2 import StrictUndefined, DictLoader from jinja2 import StrictUndefined, DictLoader
from jinja2.sandbox import SandboxedEnvironment from jinja2.sandbox import SandboxedEnvironment
from re import findall from re import findall
from tiramisu import ( from tiramisu import DynOptionDescription, calc_value, function_waiting_for_error, undefined
DynOptionDescription,
calc_value,
function_waiting_for_error,
undefined,
)
from tiramisu.error import ( from tiramisu.error import (
ValueWarning, ValueWarning,
ConfigError, ConfigError,
@ -139,7 +134,7 @@ CONVERT_OPTION = {
# #
"symlink": dict(opttype="SymLinkOption"), "symlink": dict(opttype="SymLinkOption"),
} }
RENAME_TYPE = {"number": "integer"} RENAME_TYPE = {'number': 'integer'}
def get_identifier_from_dynamic_family(true_name, name) -> str: def get_identifier_from_dynamic_family(true_name, name) -> str:
@ -377,16 +372,14 @@ def variable_to_property(*, prop, value=undefined, when, inverse, **kwargs):
@function_waiting_for_error @function_waiting_for_error
def jinja_to_property(prop, description, when, inverse, **kwargs): def jinja_to_property(prop, description, when, inverse, **kwargs):
value = func["jinja_to_function"](**kwargs) value = func["jinja_to_function"](**kwargs)
if kwargs["__internal_type"] == "string": if kwargs["__internal_type"] == 'string':
value = value is not None value = value is not None
return func["variable_to_property"]( return func["variable_to_property"](prop=prop, value=value, when=when, inverse=inverse)
prop=prop, value=value, when=when, inverse=inverse
)
@function_waiting_for_error @function_waiting_for_error
def jinja_to_property_help(prop, description, **kwargs): def jinja_to_property_help(prop, description, **kwargs):
if kwargs["__internal_type"] == "string": if kwargs["__internal_type"] == 'string':
description = func["jinja_to_function"](**kwargs) description = func["jinja_to_function"](**kwargs)
return (prop, f'"{prop}" ({description})') return (prop, f'"{prop}" ({description})')
@ -415,7 +408,6 @@ class ConvertDynOptionDescription(DynOptionDescription):
"""Identifier could be an integer, we should convert it in str """Identifier could be an integer, we should convert it in str
Identifier could also contain invalid character, so we should "normalize" it Identifier could also contain invalid character, so we should "normalize" it
""" """
@staticmethod @staticmethod
def convert_identifier_to_path(identifier): def convert_identifier_to_path(identifier):
if identifier is None: if identifier is None:
@ -446,9 +438,7 @@ class ConvertDynOptionDescription(DynOptionDescription):
if "{{ identifier }}" in display: if "{{ identifier }}" in display:
return display.replace( return display.replace(
"{{ identifier }}", "{{ identifier }}",
self.convert_identifier_to_path( self.convert_identifier_to_path(self.get_identifiers(subconfig, from_display_name=True)[-1]),
self.get_identifiers(subconfig, from_display_name=True)[-1]
),
) )
return display return display

View file

@ -238,7 +238,7 @@ class UserDatas:
if index is not None: if index is not None:
if isinstance(value, tuple): if isinstance(value, tuple):
self.values[values_path]["values"] = [] self.values[values_path]["values"] = []
# for i in range(len(option.parent().leader().value.get())): # for i in range(len(option.parent().leader().value.get())):
for i in range(option.value.len()): for i in range(option.value.len()):
self.values[values_path]["values"].append(value) self.values[values_path]["values"].append(value)
value = self.values[values_path]["values"] value = self.values[values_path]["values"]
@ -256,7 +256,7 @@ class UserDatas:
option.value.pop(idx) option.value.pop(idx)
try: try:
self.set_value(option, value, options) self.set_value(option, value, options)
# option.value.set(value) # option.value.set(value)
value_is_set = True value_is_set = True
except Exception as err: except Exception as err:
if path != option.path(): if path != option.path():
@ -265,9 +265,7 @@ class UserDatas:
if "source" in self.values[values_path]: if "source" in self.values[values_path]:
option_without_index.information.set( option_without_index.information.set(
"loaded_from", "loaded_from",
_("loaded from {0}").format( _("loaded from {0}").format(self.values[values_path]["source"]),
self.values[values_path]["source"]
),
) )
# value is correctly set, remove variable to the set # value is correctly set, remove variable to the set
if index is not None: if index is not None:
@ -299,7 +297,7 @@ class UserDatas:
if "{{ identifier }}" in path: if "{{ identifier }}" in path:
continue continue
value = options["values"] value = options["values"]
if options.get("secret_manager"): if options.get('secret_manager'):
option = self.config.forcepermissive.option(path) option = self.config.forcepermissive.option(path)
else: else:
option = self.config.option(path) option = self.config.option(path)
@ -357,9 +355,7 @@ class UserDatas:
self.set_value(option, value, options.get("options", {})) self.set_value(option, value, options.get("options", {}))
except PropertiesOptionError as err: except PropertiesOptionError as err:
if err.code == "property-error": if err.code == "property-error":
properties = display_list( properties = display_list([_(prop) for prop in err.proptype], add_quote=False)
[_(prop) for prop in err.proptype], add_quote=False
)
err_path = err._subconfig.path err_path = err._subconfig.path
display_name = option.description(with_quote=True) display_name = option.description(with_quote=True)
if index is not None: if index is not None:
@ -450,9 +446,7 @@ class UserDatas:
is_secret_manager = options.get("secret_manager", False) is_secret_manager = options.get("secret_manager", False)
if is_secret_manager and isinstance(value, tuple): if is_secret_manager and isinstance(value, tuple):
# it's a function # it's a function
value = value[0]( value = value[0](*value[1:], option=option, warnings=self.warnings, errors=self.errors)
*value[1:], option=option, warnings=self.warnings, errors=self.errors
)
option.value.set(value) option.value.set(value)

View file

@ -217,4 +217,5 @@ def get_properties_to_string():
] ]
undefined = Undefined() undefined = Undefined()

View file

@ -1,10 +0,0 @@
{
"rougail.var1": {
"owner": "default",
"value": []
},
"rougail.var2": {
"owner": "default",
"value": []
}
}

View file

@ -1,4 +0,0 @@
{
"rougail.var1": [],
"rougail.var2": []
}

View file

@ -1,10 +0,0 @@
{
"rougail.var1": {
"owner": "default",
"value": []
},
"rougail.var2": {
"owner": "default",
"value": []
}
}

View file

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

View file

@ -1,4 +0,0 @@
{
"rougail.var1": [],
"rougail.var2": []
}

View file

@ -1,19 +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")
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, 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

@ -1,14 +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")
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, 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

@ -47,7 +47,7 @@ excludes = set([
]) ])
test_ok -= excludes test_ok -= excludes
test_raise -= excludes test_raise -= excludes
# test_ok = ['01_6string_multi_length'] #test_ok = ['04_5validators_warnings_all']
#test_ok = [] #test_ok = []
# test_raise = ['80unknown_default_variable_inside_dynamic_family'] # test_raise = ['80unknown_default_variable_inside_dynamic_family']
#test_raise = [] #test_raise = []

View file

@ -31,7 +31,7 @@ excludes = set([])
# excludes = set(['60_5family_dynamic_variable_outside_sub_suffix']) # excludes = set(['60_5family_dynamic_variable_outside_sub_suffix'])
test_ok -= excludes test_ok -= excludes
# test_ok = ['01_6string_multi_length'] #test_ok = ['04_5disabled_calculation_boolean']
test_ok = list(test_ok) test_ok = list(test_ok)