Compare commits

..

No commits in common. "bb1f117ed1d38b74f1a87a1ff6d5bbc988709f2a" and "e71d4600d7d78110673283d36180533024835e7d" have entirely different histories.

51 changed files with 129 additions and 560 deletions

View file

@ -1,13 +1,3 @@
## 1.2.0a23 (2025-05-09)
### Fix
- add_quotes
- tiramisu_display_name could display only description
- use own undefined
- support of default_dictionary_format_version file in tests
- simplify version support
## 1.2.0a22 (2025-05-05) ## 1.2.0a22 (2025-05-05)
### Fix ### Fix

View file

@ -5,8 +5,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"POT-Creation-Date: 2025-05-08 21:35+0200\n" "POT-Creation-Date: 2025-05-03 22:50+0200\n"
"PO-Revision-Date: 2025-05-08 21:37+0200\n" "PO-Revision-Date: 2025-05-03 22:50+0200\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: fr\n" "Language: fr\n"
@ -135,12 +135,6 @@ msgid ""
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.py:226
msgid "Structure format version by default, if not specified in structure file"
msgstr ""
"La version du format de la structure par défaut, si non spécifier dans le "
"fichier de structure"
#: src/rougail/config.py:234 #: src/rougail/config.py:234
msgid "File with functions" msgid "File with functions"
msgstr "Fichier avec les fonctions" msgstr "Fichier avec les fonctions"
@ -199,47 +193,39 @@ msgstr "Le patron de secret pour construire le nom de l'élément dans Bitwarden
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.py:378 #: src/rougail/config.py:458
msgid "Select for {0}"
msgstr "Sélection pour {0}"
#: src/rougail/config.py:457
msgid "Override default parameters for option type"
msgstr "Sur charger les paramètre par défaut pour le type d'option"
#: src/rougail/config.py:460
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"
#: src/rougail/convert.py:280 #: src/rougail/convert.py:281
msgid "unknown type {0} for {1}" msgid "unknown type {0} for {1}"
msgstr "type {0} inconnu pour {1}" msgstr "type {0} inconnu pour {1}"
#: src/rougail/convert.py:411 #: src/rougail/convert.py:416
msgid "family \"{0}\" define multiple time" msgid "family \"{0}\" define multiple time"
msgstr "la famille \"{0}\" est définit plusieurs fois" msgstr "la famille \"{0}\" est définit plusieurs fois"
#: src/rougail/convert.py:667 #: src/rougail/convert.py:679
msgid "variable \"{0}\" define multiple time" msgid "variable \"{0}\" define multiple time"
msgstr "la variable \"{0}\" est définit plusieurs fois" msgstr "la variable \"{0}\" est définit plusieurs fois"
#: src/rougail/convert.py:767 #: src/rougail/convert.py:782
msgid "params must be a dict for {0}" msgid "params must be a dict for {0}"
msgstr "params doit être une dict pour {0}" msgstr "params doit être une dict pour {0}"
#: src/rougail/convert.py:788 #: src/rougail/convert.py:803
msgid "\"{0}\" has an invalid \"params\" for {1}: {2}" msgid "\"{0}\" has an invalid \"params\" for {1}: {2}"
msgstr "\"{0}\" a un attribut \"params\" invalide pour {1}: {2}" msgstr "\"{0}\" a un attribut \"params\" invalide pour {1}: {2}"
#: src/rougail/convert.py:802 #: src/rougail/convert.py:817
msgid "secret_manager must be a dict for {0}" msgid "secret_manager must be a dict for {0}"
msgstr "secret_manager doit être une dict pour {0}" msgstr "secret_manager doit être une dict pour {0}"
#: src/rougail/convert.py:1129 #: src/rougail/convert.py:1147
msgid "Cannot execute annotate multiple time" msgid "Cannot execute annotate multiple time"
msgstr "Ne peut exécuter l'annotation plusieurs fois" msgstr "Ne peut exécuter l'annotation plusieurs fois"
#: src/rougail/convert.py:1136 #: src/rougail/convert.py:1154
msgid "" msgid ""
"invalid \"structural\" definition ({0}), we cannot load any structural file!" "invalid \"structural\" definition ({0}), we cannot load any structural file!"
msgstr "" msgstr ""
@ -251,45 +237,45 @@ msgstr ""
msgid "{0} in {1}" msgid "{0} in {1}"
msgstr "{0} dans {1}" msgstr "{0} dans {1}"
#: src/rougail/object_model.py:50 #: src/rougail/object_model.py:51
msgid "unknown boolean value \"{0}\"" msgid "unknown boolean value \"{0}\""
msgstr "valeur du booléen inconnue \"{0}\"" msgstr "valeur du booléen inconnue \"{0}\""
#: src/rougail/object_model.py:181 #: src/rougail/object_model.py:182
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/object_model.py:185 #: src/rougail/object_model.py:186
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/object_model.py:188 src/rougail/object_model.py:478 #: src/rougail/object_model.py:189 src/rougail/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/object_model.py:205 #: src/rougail/object_model.py:206
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/object_model.py:228 #: src/rougail/object_model.py:229
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/object_model.py:231 #: src/rougail/object_model.py:232
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/object_model.py:242 #: src/rougail/object_model.py:243
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}\""
@ -297,7 +283,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/object_model.py:475 #: src/rougail/object_model.py:476
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"
@ -305,7 +291,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/object_model.py:495 #: src/rougail/object_model.py:496
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}\""
@ -313,7 +299,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/object_model.py:531 #: src/rougail/object_model.py:532
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"
@ -321,14 +307,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/object_model.py:534 #: src/rougail/object_model.py:535
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/object_model.py:550 #: src/rougail/object_model.py:551
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"
@ -336,7 +322,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/object_model.py:555 #: src/rougail/object_model.py:556
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"
@ -344,7 +330,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/object_model.py:560 #: src/rougail/object_model.py:561
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"
@ -352,7 +338,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/object_model.py:565 #: src/rougail/object_model.py:566
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"
@ -376,7 +362,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/object_model.py:629 #: src/rougail/object_model.py:628
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}\""
@ -384,7 +370,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/object_model.py:632 #: src/rougail/object_model.py:631
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"
@ -392,7 +378,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/object_model.py:638 #: src/rougail/object_model.py:637
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}\""
@ -400,7 +386,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/object_model.py:693 #: src/rougail/object_model.py:691
msgid "" msgid ""
"cannot find variable \"{0}\" for the information \"{1}\" when calculating " "cannot find variable \"{0}\" for the information \"{1}\" when calculating "
"\"{2}\"" "\"{2}\""
@ -408,18 +394,18 @@ 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/object_model.py:696 #: src/rougail/object_model.py:694
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/object_model.py:747 #: src/rougail/object_model.py:743
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/object_model.py:751 src/rougail/object_model.py:759 #: src/rougail/object_model.py:747 src/rougail/object_model.py:755
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"
@ -427,7 +413,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/object_model.py:782 #: src/rougail/object_model.py:777
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 ""

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-05-08 21:37+0200\n" "POT-Creation-Date: 2025-05-03 22:50+0200\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"
@ -87,10 +87,6 @@ msgstr ""
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.py:226
msgid "Structure format version by default, if not specified in structure file"
msgstr ""
#: src/rougail/config.py:234 #: src/rougail/config.py:234
msgid "File with functions" msgid "File with functions"
msgstr "" msgstr ""
@ -147,47 +143,39 @@ msgstr ""
msgid "The pattern is in Jinja format" msgid "The pattern is in Jinja format"
msgstr "" msgstr ""
#: src/rougail/config.py:378 #: src/rougail/config.py:458
msgid "Select for {0}"
msgstr ""
#: src/rougail/config.py:457
msgid "Override default parameters for option type"
msgstr ""
#: src/rougail/config.py:460
msgid "Default parameters for option type" msgid "Default parameters for option type"
msgstr "" msgstr ""
#: src/rougail/convert.py:280 #: src/rougail/convert.py:281
msgid "unknown type {0} for {1}" msgid "unknown type {0} for {1}"
msgstr "" msgstr ""
#: src/rougail/convert.py:411 #: src/rougail/convert.py:416
msgid "family \"{0}\" define multiple time" msgid "family \"{0}\" define multiple time"
msgstr "" msgstr ""
#: src/rougail/convert.py:667 #: src/rougail/convert.py:679
msgid "variable \"{0}\" define multiple time" msgid "variable \"{0}\" define multiple time"
msgstr "" msgstr ""
#: src/rougail/convert.py:767 #: src/rougail/convert.py:782
msgid "params must be a dict for {0}" msgid "params must be a dict for {0}"
msgstr "" msgstr ""
#: src/rougail/convert.py:788 #: src/rougail/convert.py:803
msgid "\"{0}\" has an invalid \"params\" for {1}: {2}" msgid "\"{0}\" has an invalid \"params\" for {1}: {2}"
msgstr "" msgstr ""
#: src/rougail/convert.py:802 #: src/rougail/convert.py:817
msgid "secret_manager must be a dict for {0}" msgid "secret_manager must be a dict for {0}"
msgstr "" msgstr ""
#: src/rougail/convert.py:1129 #: src/rougail/convert.py:1147
msgid "Cannot execute annotate multiple time" msgid "Cannot execute annotate multiple time"
msgstr "" msgstr ""
#: src/rougail/convert.py:1136 #: src/rougail/convert.py:1154
msgid "invalid \"structural\" definition ({0}), we cannot load any structural file!" msgid "invalid \"structural\" definition ({0}), we cannot load any structural file!"
msgstr "" msgstr ""
@ -196,67 +184,67 @@ msgstr ""
msgid "{0} in {1}" msgid "{0} in {1}"
msgstr "" msgstr ""
#: src/rougail/object_model.py:50 #: src/rougail/object_model.py:51
msgid "unknown boolean value \"{0}\"" msgid "unknown boolean value \"{0}\""
msgstr "" msgstr ""
#: src/rougail/object_model.py:181 #: src/rougail/object_model.py:182
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/object_model.py:185 #: src/rougail/object_model.py:186
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/object_model.py:188 src/rougail/object_model.py:478 #: src/rougail/object_model.py:189 src/rougail/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/object_model.py:205 #: src/rougail/object_model.py:206
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/object_model.py:228 #: src/rougail/object_model.py:229
msgid "cannot find variable \"{0}\" defined in \"{1}\" for \"{2}\"" msgid "cannot find variable \"{0}\" defined in \"{1}\" for \"{2}\""
msgstr "" msgstr ""
#: src/rougail/object_model.py:231 #: src/rougail/object_model.py:232
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/object_model.py:242 #: src/rougail/object_model.py:243
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/object_model.py:475 #: src/rougail/object_model.py:476
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/object_model.py:495 #: src/rougail/object_model.py:496
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/object_model.py:531 #: src/rougail/object_model.py:532
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/object_model.py:534 #: src/rougail/object_model.py:535
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/object_model.py:550 #: src/rougail/object_model.py:551
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/object_model.py:555 #: src/rougail/object_model.py:556
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/object_model.py:560 #: src/rougail/object_model.py:561
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/object_model.py:565 #: src/rougail/object_model.py:566
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 ""
@ -268,35 +256,35 @@ msgstr ""
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/object_model.py:629 #: src/rougail/object_model.py:628
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/object_model.py:632 #: src/rougail/object_model.py:631
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/object_model.py:638 #: src/rougail/object_model.py:637
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/object_model.py:693 #: src/rougail/object_model.py:691
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/object_model.py:696 #: src/rougail/object_model.py:694
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/object_model.py:747 #: src/rougail/object_model.py:743
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/object_model.py:751 src/rougail/object_model.py:759 #: src/rougail/object_model.py:747 src/rougail/object_model.py:755
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/object_model.py:782 #: src/rougail/object_model.py:777
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 ""

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project] [project]
name = "rougail" name = "rougail"
version = "1.2.0a23" version = "1.2.0a22"
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

@ -42,28 +42,15 @@ def tiramisu_display_name(
with_quote: bool = False, with_quote: bool = False,
) -> str: ) -> str:
"""Replace the Tiramisu display_name function to display path + description""" """Replace the Tiramisu display_name function to display path + description"""
config_bag = subconfig.config_bag doc = kls._get_information(subconfig, "doc", None)
context = config_bag.context comment = f" ({doc})" if doc and doc != kls.impl_getname() else ""
values = context.get_values()
context_subconfig = context.get_root(config_bag)
doc = values.get_information(subconfig, "doc", None)
comment = doc if doc and doc != kls.impl_getname() else ""
if "{{ identifier }}" in comment and subconfig.identifiers: if "{{ identifier }}" in comment and subconfig.identifiers:
comment = comment.replace("{{ identifier }}", str(subconfig.identifiers[-1])) comment = comment.replace("{{ identifier }}", str(subconfig.identifiers[-1]))
path_in_description = values.get_information(context_subconfig, 'path_in_description', True) path = kls.impl_getpath()
if path_in_description or not comment: if "{{ identifier }}" in path and subconfig.identifiers:
comment = f" ({comment})" if comment else "" path = path.replace(
if path_in_description is False: "{{ identifier }}", normalize_family(str(subconfig.identifiers[-1]))
path = kls.impl_getname() )
else:
path = kls.impl_getpath()
if "{{ identifier }}" in path and subconfig.identifiers:
path = path.replace(
"{{ identifier }}", normalize_family(str(subconfig.identifiers[-1]))
)
else:
path = comment
comment = ""
if with_quote: if with_quote:
return f'"{path}"{comment}' return f'"{path}"{comment}'
return f"{path}{comment}" return f"{path}{comment}"

View file

@ -1 +1 @@
__version__ = "1.2.0a23" __version__ = "1.2.0a22"

View file

@ -223,7 +223,7 @@ def _rougail_config(
add_extra_options: bool = True, add_extra_options: bool = True,
) -> "OptionDescription": ) -> "OptionDescription":
rougail_options = f"""default_dictionary_format_version: rougail_options = f"""default_dictionary_format_version:
description: {_('Structure format version by default, if not specified in structure file')} description: Dictionary format version by default, if not specified in dictionary file
alternative_name: v alternative_name: v
choices: choices:
- '1.0' - '1.0'
@ -370,13 +370,13 @@ secret_manager:
for process in processes: for process in processes:
if processes[process]: if processes[process]:
objects = processes[process] objects = processes[process]
process_name = normalize_family(process) rougail_process += """
tr_process_name = _(process_name)
rougail_process += f"""
{process_name}: {NAME}:
description: {_('Select for {0}').format(tr_process_name)} description: Select for {NAME}
""" """.format(
NAME=normalize_family(process),
)
if process != "structural": if process != "structural":
rougail_process += """ rougail_process += """
alternative_name: {NAME[0]} alternative_name: {NAME[0]}
@ -454,13 +454,8 @@ secret_manager:
PROP=prop, PROP=prop,
) )
rougail_process += f""" rougail_process += f"""
define_default_params: false # {_('Override default parameters for option type')}
default_params: default_params:
description: {_("Default parameters for option type")} description: {_("Default parameters for option type")}
disabled:
variable: _.define_default_params
when: false
""" """
for typ, params in get_convert_option_types(): for typ, params in get_convert_option_types():

View file

@ -259,6 +259,7 @@ class ParserVariable:
path: str, path: str,
obj: dict, obj: dict,
family_is_leadership: bool, family_is_leadership: bool,
version: str,
filename: str, filename: str,
) -> Literal["variable", "family"]: ) -> Literal["variable", "family"]:
"""Check object to determine if it's a variable or a family""" """Check object to determine if it's a variable or a family"""
@ -302,7 +303,7 @@ class ParserVariable:
else: else:
return "variable" return "variable"
else: else:
if self.version == "1.0": if version == "1.0":
msg = f'Invalid value for the variable "{path}": "{obj}"' msg = f'Invalid value for the variable "{path}": "{obj}"'
raise DictConsistencyError(msg, 102, [filename]) raise DictConsistencyError(msg, 102, [filename])
return "variable" return "variable"
@ -331,6 +332,7 @@ class ParserVariable:
name: str, name: str,
subpath: str, subpath: str,
obj: dict, obj: dict,
version: str,
comment: Optional[str], comment: Optional[str],
*, *,
first_variable: bool = False, first_variable: bool = False,
@ -345,13 +347,14 @@ class ParserVariable:
path = name path = name
else: else:
path = f"{subpath}.{name}" path = f"{subpath}.{name}"
if self.version == "0.1" and not isinstance(obj, dict) and obj is not None: if version == "0.1" and not isinstance(obj, dict) and obj is not None:
msg = f'the variable "{path}" has a wrong type "{type(obj)}"' msg = f'the variable "{path}" has a wrong type "{type(obj)}"'
raise DictConsistencyError(msg, 17, [filename]) raise DictConsistencyError(msg, 17, [filename])
typ = self.is_family_or_variable( typ = self.is_family_or_variable(
path, path,
obj, obj,
family_is_leadership, family_is_leadership,
version,
filename, filename,
) )
logging.info("family_or_variable: %s is a %s", path, typ) logging.info("family_or_variable: %s is a %s", path, typ)
@ -364,6 +367,7 @@ class ParserVariable:
name, name,
path, path,
obj, obj,
version,
comment=comment, comment=comment,
first_variable=first_variable, first_variable=first_variable,
family_is_leadership=family_is_leadership, family_is_leadership=family_is_leadership,
@ -377,6 +381,7 @@ class ParserVariable:
name: str, name: str,
path: str, path: str,
obj: Optional[Dict[str, Any]], obj: Optional[Dict[str, Any]],
version: str,
*, *,
comment: Optional[str] = None, comment: Optional[str] = None,
first_variable: bool = False, first_variable: bool = False,
@ -389,7 +394,7 @@ class ParserVariable:
obj = {} obj = {}
family_obj = {} family_obj = {}
subfamily_obj = {} subfamily_obj = {}
if self.version != "1.0": if version != "1.0":
exists = obj.pop("exists", None) exists = obj.pop("exists", None)
else: else:
exists = None exists = None
@ -401,7 +406,7 @@ class ParserVariable:
family_obj[key] = value family_obj[key] = value
else: else:
subfamily_obj[key] = value subfamily_obj[key] = value
if self.version != "1.0" and not family_obj and comment: if version != "1.0" and not family_obj and comment:
family_obj["description"] = comment family_obj["description"] = comment
if path in self.paths: if path in self.paths:
@ -418,6 +423,7 @@ class ParserVariable:
obj, obj,
filename, filename,
family_is_dynamic, family_is_dynamic,
version,
typ="family", typ="family",
) )
if self.load_unexist_redefine or exists in [None, True]: if self.load_unexist_redefine or exists in [None, True]:
@ -475,6 +481,7 @@ class ParserVariable:
filename, filename,
family_is_dynamic, family_is_dynamic,
parent_dynamic, parent_dynamic,
version,
) )
force_not_first = False force_not_first = False
if self.paths[path].type == "leadership": if self.paths[path].type == "leadership":
@ -488,6 +495,7 @@ class ParserVariable:
key, key,
path, path,
value, value,
version,
comment, comment,
first_variable=first_variable, first_variable=first_variable,
family_is_leadership=family_is_leadership, family_is_leadership=family_is_leadership,
@ -545,16 +553,17 @@ class ParserVariable:
filename: str, filename: str,
family_is_dynamic: bool, family_is_dynamic: bool,
parent_dynamic: str, parent_dynamic: str,
version: str,
) -> None: ) -> None:
"""Add a new family""" """Add a new family"""
family["path"] = path family["path"] = path
family["namespace"] = self.namespace family["namespace"] = self.namespace
family["version"] = self.version family["version"] = version
family["xmlfiles"] = [filename] family["xmlfiles"] = [filename]
obj_type = self.get_family_or_variable_type(family) obj_type = self.get_family_or_variable_type(family)
if obj_type == "dynamic": if obj_type == "dynamic":
family_obj = self.dynamic family_obj = self.dynamic
if self.version == "1.0": if version == "1.0":
if "variable" not in family: if "variable" not in family:
raise DictConsistencyError( raise DictConsistencyError(
f'dynamic family must have "variable" attribute for "{path}"', f'dynamic family must have "variable" attribute for "{path}"',
@ -583,7 +592,7 @@ class ParserVariable:
"allow_none": True, "allow_none": True,
} }
del family["variable"] del family["variable"]
if self.version != "1.0": if 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(warning) warn(warning)
if "variable" in family: if "variable" in family:
@ -598,6 +607,7 @@ class ParserVariable:
family, family,
filename, filename,
family_is_dynamic, family_is_dynamic,
version,
typ="family", typ="family",
) )
try: try:
@ -627,6 +637,7 @@ class ParserVariable:
name: str, name: str,
path: str, path: str,
obj: Optional[Dict[str, Any]], obj: Optional[Dict[str, Any]],
version: str,
*, *,
comment: Optional[str] = None, comment: Optional[str] = None,
first_variable: bool = False, first_variable: bool = False,
@ -635,7 +646,7 @@ class ParserVariable:
parent_dynamic: Optional[str] = None, parent_dynamic: Optional[str] = None,
) -> None: ) -> None:
"""Parse variable""" """Parse variable"""
if self.version == "1.0" or isinstance(obj, dict): if version == "1.0" or isinstance(obj, dict):
if obj is None: if obj is None:
obj = {} obj = {}
extra_attrs = set(obj) - self.variable_attrs extra_attrs = set(obj) - self.variable_attrs
@ -655,9 +666,10 @@ class ParserVariable:
obj, obj,
filename, filename,
family_is_dynamic, family_is_dynamic,
version,
) )
self.parse_params(path, obj, filename) self.parse_params(path, obj, filename)
self.parse_secret_manager(path, obj, filename, family_is_dynamic) self.parse_secret_manager(path, obj, filename, version, family_is_dynamic)
exists = obj.pop("exists", None) exists = obj.pop("exists", None)
if path in self.paths: if path in self.paths:
if not self.load_unexist_redefine: if not self.load_unexist_redefine:
@ -688,7 +700,7 @@ class ParserVariable:
raise DictConsistencyError(msg, 46, [filename]) raise DictConsistencyError(msg, 46, [filename])
obj["path"] = path obj["path"] = path
self.add_variable( self.add_variable(
name, obj, filename, family_is_dynamic, parent_dynamic name, obj, filename, family_is_dynamic, parent_dynamic, version
) )
if family_is_leadership: if family_is_leadership:
if first_variable: if first_variable:
@ -702,6 +714,7 @@ class ParserVariable:
obj: dict, obj: dict,
filename: str, filename: str,
family_is_dynamic: bool, family_is_dynamic: bool,
version: str,
*, *,
typ: str = "variable", typ: str = "variable",
): ):
@ -724,6 +737,7 @@ class ParserVariable:
value, value,
path, path,
family_is_dynamic, family_is_dynamic,
version,
[filename], [filename],
) )
except ValidationError as err: except ValidationError as err:
@ -748,6 +762,7 @@ class ParserVariable:
val, val,
path, path,
family_is_dynamic, family_is_dynamic,
version,
[filename], [filename],
inside_list=True, inside_list=True,
index=idx, index=idx,
@ -793,7 +808,7 @@ class ParserVariable:
) from err ) from err
obj["params"] = params obj["params"] = params
def parse_secret_manager(self, path, obj, filename, family_is_dynamic): def parse_secret_manager(self, path, obj, filename, version, family_is_dynamic):
"""Parse variable secret_manager""" """Parse variable secret_manager"""
if "secret_manager" not in obj: if "secret_manager" not in obj:
return return
@ -813,6 +828,7 @@ class ParserVariable:
secret_manager, secret_manager,
path, path,
family_is_dynamic, family_is_dynamic,
version,
[filename], [filename],
) )
@ -823,6 +839,7 @@ class ParserVariable:
filename: str, filename: str,
family_is_dynamic: bool, family_is_dynamic: bool,
parent_dynamic: Optional[str], parent_dynamic: Optional[str],
version: str,
) -> None: ) -> None:
if "{ suffix" in variable["path"]: if "{ suffix" in variable["path"]:
raise Exception() raise Exception()
@ -831,7 +848,7 @@ class ParserVariable:
filename = [filename] filename = [filename]
variable["namespace"] = self.namespace variable["namespace"] = self.namespace
variable["version"] = self.version variable["version"] = version
variable["xmlfiles"] = filename variable["xmlfiles"] = filename
variable_type = self.get_family_or_variable_type(variable) variable_type = self.get_family_or_variable_type(variable)
obj = { obj = {
@ -926,6 +943,7 @@ class ParserVariable:
value: dict, value: dict,
path: str, path: str,
family_is_dynamic: bool, family_is_dynamic: bool,
version: str,
xmlfiles: List[str], xmlfiles: List[str],
*, *,
inside_list: bool = False, inside_list: bool = False,
@ -938,7 +956,7 @@ class ParserVariable:
calculation_object["attribute_name"] = attribute calculation_object["attribute_name"] = attribute
calculation_object["path"] = path calculation_object["path"] = path
calculation_object["inside_list"] = inside_list calculation_object["inside_list"] = inside_list
calculation_object["version"] = self.version calculation_object["version"] = version
calculation_object["namespace"] = self.namespace calculation_object["namespace"] = self.namespace
calculation_object["xmlfiles"] = xmlfiles calculation_object["xmlfiles"] = xmlfiles
# #
@ -962,7 +980,7 @@ class ParserVariable:
"type": "any", "type": "any",
} }
else: else:
if self.version == "1.0" and val["type"] == "suffix": if version == "1.0" and val["type"] == "suffix":
val["type"] = "identifier" val["type"] = "identifier"
param_typ = val["type"] param_typ = val["type"]
val["key"] = key val["key"] = key
@ -1049,7 +1067,6 @@ class RougailConvert(ParserVariable):
) -> None: ) -> None:
if namespace_path is None: if namespace_path is None:
namespace_path = self.namespace namespace_path = self.namespace
self.version = ""
self.parse_family( self.parse_family(
"", "",
self.namespace, self.namespace,
@ -1057,6 +1074,7 @@ class RougailConvert(ParserVariable):
{ {
"description": namespace_description, "description": namespace_description,
}, },
"",
) )
def get_comment( def get_comment(
@ -1079,7 +1097,6 @@ class RougailConvert(ParserVariable):
version: str, version: str,
objects: dict, objects: dict,
) -> None: ) -> None:
self.version = version
for name, obj in objects.items(): for name, obj in objects.items():
comment = self.get_comment(name, objects) comment = self.get_comment(name, objects)
self.family_or_variable( self.family_or_variable(
@ -1087,6 +1104,7 @@ class RougailConvert(ParserVariable):
name, name,
path, path,
obj, obj,
version,
comment, comment,
) )

View file

@ -26,9 +26,10 @@ from pydantic import (
StrictStr, StrictStr,
ConfigDict, ConfigDict,
) )
from tiramisu import undefined
import tiramisu import tiramisu
from tiramisu.config import get_common_path from tiramisu.config import get_common_path
from .utils import get_jinja_variable_to_param, calc_multi_for_type_variable, undefined from .utils import get_jinja_variable_to_param, calc_multi_for_type_variable
from .i18n import _ from .i18n import _
from .error import DictConsistencyError, VariableCalculationDependencyError from .error import DictConsistencyError, VariableCalculationDependencyError
@ -269,6 +270,7 @@ PARAM_TYPES = {
class Calculation(BaseModel): class Calculation(BaseModel):
path: str path: str
description: Optional[StrictStr] = None
inside_list: bool inside_list: bool
version: str version: str
ori_path: Optional[str] = None ori_path: Optional[str] = None
@ -310,7 +312,6 @@ class JinjaCalculation(Calculation):
jinja: StrictStr jinja: StrictStr
params: Optional[List[Param]] = None params: Optional[List[Param]] = None
return_type: BASETYPE = None return_type: BASETYPE = None
description: Optional[StrictStr] = None
def _jinja_to_function( def _jinja_to_function(
self, self,
@ -569,7 +570,6 @@ class _VariableCalculation(Calculation):
class VariableCalculation(_VariableCalculation): class VariableCalculation(_VariableCalculation):
attribute_name: Literal["default", "choices", "dynamic"] attribute_name: Literal["default", "choices", "dynamic"]
optional: bool = False optional: bool = False
description: Optional[StrictStr] = None
def to_function( def to_function(
self, self,
@ -607,7 +607,6 @@ class VariablePropertyCalculation(_VariableCalculation):
attribute_name: Literal["frozen", "hidden", "disabled", "mandatory"] attribute_name: Literal["frozen", "hidden", "disabled", "mandatory"]
when: Any = undefined when: Any = undefined
when_not: Any = undefined when_not: Any = undefined
description: Optional[StrictStr] = None
def to_function( def to_function(
self, self,
@ -662,7 +661,6 @@ class InformationCalculation(Calculation):
attribute_name: Literal["default", "choice", "dynamic"] attribute_name: Literal["default", "choice", "dynamic"]
information: StrictStr information: StrictStr
variable: Optional[StrictStr] variable: Optional[StrictStr]
description: Optional[StrictStr] = None
def to_function( def to_function(
self, self,
@ -717,7 +715,6 @@ class _IdentifierCalculation(Calculation):
class IdentifierCalculation(_IdentifierCalculation): class IdentifierCalculation(_IdentifierCalculation):
attribute_name: Literal["default", "choice", "dynamic"] attribute_name: Literal["default", "choice", "dynamic"]
description: Optional[StrictStr] = None
def to_function( def to_function(
self, self,
@ -737,7 +734,6 @@ class IdentifierPropertyCalculation(_IdentifierCalculation):
attribute_name: Literal["frozen", "hidden", "disabled", "mandatory"] attribute_name: Literal["frozen", "hidden", "disabled", "mandatory"]
when: Any = undefined when: Any = undefined
when_not: Any = undefined when_not: Any = undefined
description: Optional[StrictStr] = None
def to_function( def to_function(
self, self,
@ -772,7 +768,6 @@ class IdentifierPropertyCalculation(_IdentifierCalculation):
class IndexCalculation(Calculation): class IndexCalculation(Calculation):
attribute_name: Literal["default", "choice", "dynamic"] attribute_name: Literal["default", "choice", "dynamic"]
description: Optional[StrictStr] = None
def to_function( def to_function(
self, self,
@ -789,7 +784,6 @@ class IndexCalculation(Calculation):
class NamespaceCalculation(Calculation): class NamespaceCalculation(Calculation):
attribute_name: Literal["default", "secret_manager"] attribute_name: Literal["default", "secret_manager"]
description: Optional[StrictStr] = None
def to_function( def to_function(
self, self,

View file

@ -78,11 +78,11 @@ class Annotator(Walk):
path = alternative_name path = alternative_name
else: else:
path = variable_path.rsplit(".", 1)[0] + "." + alternative_name path = variable_path.rsplit(".", 1)[0] + "." + alternative_name
self.objectspace.version = variable.version
self.objectspace.add_variable( self.objectspace.add_variable(
alternative_name, alternative_name,
{"type": "symlink", "path": path, "opt": variable}, {"type": "symlink", "path": path, "opt": variable},
variable.xmlfiles, variable.xmlfiles,
False, False,
False, False,
variable.version,
) )

View file

@ -22,8 +22,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from typing import List from typing import List
from re import findall from re import findall
from rougail.utils import normalize_family, undefined from rougail.utils import normalize_family
from tiramisu import Calculation from tiramisu import undefined, Calculation
from tiramisu.error import ( from tiramisu.error import (
PropertiesOptionError, PropertiesOptionError,
LeadershipError, LeadershipError,

View file

@ -199,10 +199,3 @@ def calc_multi_for_type_variable(local_variable: 'Variable', variable_in_calcula
elif count_identifiers > 1: elif count_identifiers > 1:
variable_in_calculation_multi = 'submulti' variable_in_calculation_multi = 'submulti'
return local_variable_multi, variable_in_calculation_multi return local_variable_multi, variable_in_calculation_multi
class Undefined:
pass
undefined = Undefined()

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')
try:
groups.namespace
except:
groups.addgroup('namespace')
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[], properties=frozenset({"advanced"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -1,9 +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_0 = OptionDescription(name="baseoption", doc="baseoption", children=[])

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')
try:
groups.namespace
except:
groups.addgroup('namespace')
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[], properties=frozenset({"advanced"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -1,9 +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_0 = OptionDescription(name="baseoption", doc="baseoption", children=[])

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')
try:
groups.namespace
except:
groups.addgroup('namespace')
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[], properties=frozenset({"advanced"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -1,9 +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_0 = OptionDescription(name="baseoption", doc="baseoption", children=[])

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,16 +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_2 = StrOption(name="var1", doc="a first variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/00_2default_calculated_variable_description/rougail/00-base.yml'], 'type': 'string'})
option_3 = StrOption(name="var2", doc="a second variable", default=Calculation(func['calc_value'], Params((ParamOption(option_2)))), properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/00_2default_calculated_variable_description/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,11 +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_1 = StrOption(name="var1", doc="a first variable", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['../rougail-tests/structures/00_2default_calculated_variable_description/rougail/00-base.yml'], 'type': 'string'})
option_2 = StrOption(name="var2", doc="a second variable", default=Calculation(func['calc_value'], Params((ParamOption(option_1)))), properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/00_2default_calculated_variable_description/rougail/00-base.yml'], 'type': 'string'})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])

View file

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

View file

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

View file

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

View file

@ -1,7 +0,0 @@
{
"rougail.var1": [
"val1",
"val2"
],
"rougail.var2": "a value"
}

View file

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

View file

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

View file

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

View file

@ -1,7 +0,0 @@
{
"rougail.var1": [
"val1",
"val2"
],
"rougail.var2": true
}

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_2 = StrOption(name="var1", doc="A suffix variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"standard"}), informations={'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_suffix_hidden_boolean/rougail/00-base.yml'], 'type': 'string'})
option_4 = BoolOption(name="var", doc="A dynamic variable", default=True, properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_suffix_hidden_boolean/rougail/00-base.yml'], 'type': 'boolean'})
optiondescription_3 = ConvertDynOptionDescription(name="dyn{{ identifier }}", doc="dyn{{ identifier }}", identifiers=Calculation(func['calc_value'], Params((ParamOption(option_2)))), children=[option_4], properties=frozenset({"standard"}), informations={'dynamic_variable': 'rougail.var1', 'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_suffix_hidden_boolean/rougail/00-base.yml']})
option_5 = BoolOption(name="var2", doc="A variable calculated", default=Calculation(func['calc_value'], Params((ParamDynOption(option_4, ["val1"])))), properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_suffix_hidden_boolean/rougail/00-base.yml'], 'type': 'boolean'})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, optiondescription_3, option_5], properties=frozenset({"standard"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -1,30 +0,0 @@
{
"rougail.var1": {
"owner": "default",
"value": [
"val1",
"val2"
]
},
"rougail.dynval1.var": {
"owner": "default",
"value": [
"a value",
"a second value"
]
},
"rougail.dynval2.var": {
"owner": "default",
"value": [
"a value",
"a second value"
]
},
"rougail.var2": {
"owner": "default",
"value": [
"a value",
"a second value"
]
}
}

View file

@ -1,18 +0,0 @@
{
"rougail.var1": [
"val1",
"val2"
],
"rougail.dynval1.var": [
"a value",
"a second value"
],
"rougail.dynval2.var": [
"a value",
"a second value"
],
"rougail.var2": [
"a value",
"a second value"
]
}

View file

@ -1,30 +0,0 @@
{
"rougail.var1": {
"owner": "default",
"value": [
"val1",
"val2"
]
},
"rougail.dynval1.var": {
"owner": "default",
"value": [
"a value",
"a second value"
]
},
"rougail.dynval2.var": {
"owner": "default",
"value": [
"a value",
"a second value"
]
},
"rougail.var2": {
"owner": "default",
"value": [
"a value",
"a second value"
]
}
}

View file

@ -1,10 +0,0 @@
{
"rougail.var1": [
"val1",
"val2"
],
"rougail.var2": [
"a value",
"a second value"
]
}

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_2 = StrOption(name="var1", doc="A suffix variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"standard"}), informations={'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_suffix_hidden_multi/rougail/00-base.yml'], 'type': 'string'})
option_4 = StrOption(name="var", doc="A dynamic variable", multi=True, default=["a value", "a second value"], default_multi="a value", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_suffix_hidden_multi/rougail/00-base.yml'], 'type': 'string'})
optiondescription_3 = ConvertDynOptionDescription(name="dyn{{ identifier }}", doc="dyn{{ identifier }}", identifiers=Calculation(func['calc_value'], Params((ParamOption(option_2)))), children=[option_4], properties=frozenset({"standard"}), informations={'dynamic_variable': 'rougail.var1', 'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_suffix_hidden_multi/rougail/00-base.yml']})
option_5 = StrOption(name="var2", doc="A variable calculated", multi=True, default=Calculation(func['calc_value'], Params((ParamDynOption(option_4, ["val1"])), kwargs={'__internal_multi': ParamValue(True)})), properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['../rougail-tests/structures/60_5family_dynamic_calc_suffix_hidden_multi/rougail/00-base.yml'], 'type': 'string'})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, optiondescription_3, option_5], properties=frozenset({"standard"}), informations={'ymlfiles': ['']})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -43,7 +43,7 @@ for test in errors_dirs.iterdir():
test_raise.add(test.name) test_raise.add(test.name)
excludes = set([ excludes = set([
# '80family_several', '80family_several',
]) ])
test_ok -= excludes test_ok -= excludes
test_raise -= excludes test_raise -= excludes
@ -149,10 +149,6 @@ def test_dictionary(test_dir):
rougailconfig['main_namespace'] = None rougailconfig['main_namespace'] = None
if (dico_dirs / test_dir / 'force_namespace').is_file(): if (dico_dirs / test_dir / 'force_namespace').is_file():
return return
if (dico_dirs / test_dir / 'default_dictionary_format_version').is_file():
rougailconfig['default_dictionary_format_version'] = "1.1"
else:
rougailconfig['default_dictionary_format_version'] = None
eolobj = load_rougail_object(str(dico_dirs / test_dir), rougailconfig) eolobj = load_rougail_object(str(dico_dirs / test_dir), rougailconfig)
if not eolobj: if not eolobj:
return return
@ -170,10 +166,6 @@ def test_dictionary_namespace(test_dir):
rougailconfig['main_namespace'] = 'Rougail' rougailconfig['main_namespace'] = 'Rougail'
if (dico_dirs / test_dir / 'force_no_namespace').is_file(): if (dico_dirs / test_dir / 'force_no_namespace').is_file():
return return
if (dico_dirs / test_dir / 'default_dictionary_format_version').is_file():
rougailconfig['default_dictionary_format_version'] = "1.1"
else:
rougailconfig['default_dictionary_format_version'] = None
eolobj = load_rougail_object(test_dir_, rougailconfig, namespace=True) eolobj = load_rougail_object(test_dir_, rougailconfig, namespace=True)
if not eolobj: if not eolobj:
return return

View file

@ -68,7 +68,6 @@ def test_personalize_annotate_twice():
def test_option_params(): def test_option_params():
rougailconfig = RougailConfig.copy() rougailconfig = RougailConfig.copy()
rougailconfig['dictionaries_dir'] = ['tests/default_option_params/structure'] rougailconfig['dictionaries_dir'] = ['tests/default_option_params/structure']
rougailconfig["define_default_params"] = True
rougailconfig["default_params.unix_filename.test_existence"] = True rougailconfig["default_params.unix_filename.test_existence"] = True
eolobj = Rougail(rougailconfig=rougailconfig) eolobj = Rougail(rougailconfig=rougailconfig)
with raises(ValueError): with raises(ValueError):

View file

@ -40,7 +40,7 @@ def test_validate_default_version():
RougailConfig["dictionaries_dir"] = ["tests/data/dict1"] RougailConfig["dictionaries_dir"] = ["tests/data/dict1"]
RougailConfig["default_dictionary_format_version"] = "1.1" RougailConfig["default_dictionary_format_version"] = "1.1"
rougail = Rougail() rougail = Rougail()
config = rougail.run() config = rougail.get_config()
filename = "tests/data/dict1/dict.yml" filename = "tests/data/dict1/dict.yml"
with open(filename, encoding="utf8") as file_fh: with open(filename, encoding="utf8") as file_fh:
@ -55,7 +55,7 @@ def test_validate_file_version_from_yml():
RougailConfig["dictionaries_dir"] = ["tests/data/dict2"] RougailConfig["dictionaries_dir"] = ["tests/data/dict2"]
RougailConfig["default_dictionary_format_version"] = "1.1" RougailConfig["default_dictionary_format_version"] = "1.1"
rougail = Rougail() rougail = Rougail()
config = rougail.run() config = rougail.get_config()
filename = "tests/data/dict2/dict.yml" filename = "tests/data/dict2/dict.yml"
with open(filename, encoding="utf8") as file_fh: with open(filename, encoding="utf8") as file_fh:
@ -71,7 +71,7 @@ def test_retrieve_version_from_config():
rougail = Rougail() rougail = Rougail()
# FIXME replace with rougail.annotator() # FIXME replace with rougail.annotator()
# rougail.converted.annotator() # rougail.converted.annotator()
rougail.run() rougail.get_config()
assert rougail.converted.paths._data["rougail.hello"].version == "1.0" assert rougail.converted.paths._data["rougail.hello"].version == "1.0"