From 4cba819e0af662a4ac4ae896e6fb4199549f7b28 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sat, 4 Jan 2025 17:39:11 +0100 Subject: [PATCH] feat: return index in error message --- locale/fr/LC_MESSAGES/tiramisu.po | 70 ++++++++++++--------- locale/tiramisu.pot | 62 ++++++++++-------- tiramisu/autolib.py | 2 +- tiramisu/error.py | 24 ++++--- tiramisu/locale/fr/LC_MESSAGES/tiramisu.mo | Bin 25294 -> 25369 bytes tiramisu/option/option.py | 33 +++++----- 6 files changed, 104 insertions(+), 87 deletions(-) diff --git a/locale/fr/LC_MESSAGES/tiramisu.po b/locale/fr/LC_MESSAGES/tiramisu.po index 23373f9..18c79ad 100644 --- a/locale/fr/LC_MESSAGES/tiramisu.po +++ b/locale/fr/LC_MESSAGES/tiramisu.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Tiramisu\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-25 08:23+0100\n" +"POT-Creation-Date: 2024-12-15 11:03+0100\n" "PO-Revision-Date: \n" "Last-Translator: Emmanuel Garette \n" "Language-Team: Tiramisu's team \n" @@ -34,23 +34,23 @@ msgstr "Ne peut avoir de warnings durant une validation" msgid "Commands:" msgstr "Commandes :" -#: tiramisu/api.py:111 tiramisu/api.py:1840 +#: tiramisu/api.py:111 tiramisu/api.py:1843 msgid "please specify a valid sub function ({0}.{1})" msgstr "veuillez spécifier une sous fonction valide ({0}.{1})" -#: tiramisu/api.py:194 +#: tiramisu/api.py:196 msgid "please do not specify index ({0}.{1})" msgstr "veuillez ne pas spécifier d'index ({0}.{1})" -#: tiramisu/api.py:199 tiramisu/api.py:844 +#: tiramisu/api.py:201 tiramisu/api.py:847 msgid "please specify index with a follower option ({0}.{1})" msgstr "veuillez spécifier un index avec une option suiveuse ({0}.{1})" -#: tiramisu/api.py:220 +#: tiramisu/api.py:222 msgid "please specify a valid sub function ({0}.{1}): {2}" msgstr "veuillez spécifier une sous fonction valide ({0}.{1}): {2}" -#: tiramisu/api.py:431 +#: tiramisu/api.py:434 msgid "" "the option {0} is not a dynamic option, cannot get identifiers with " "only_self parameter to True" @@ -58,15 +58,15 @@ msgstr "" "l'option {0} n'est pas une option dynamique, ne peut retrouver l'identifiant " "avec le paramètre only_self à True" -#: tiramisu/api.py:517 +#: tiramisu/api.py:520 msgid "cannot get option from a follower symlink without index" msgstr "ne peut avoir d'option pour une symlink suiveuse sans index" -#: tiramisu/api.py:592 +#: tiramisu/api.py:595 msgid "cannot add this property: \"{0}\"" msgstr "ne peut pas ajouter cette propriété : \"{0}\"" -#: tiramisu/api.py:619 +#: tiramisu/api.py:622 msgid "" "cannot remove option's property \"{0}\", use permissive instead in option " "\"{1}\"" @@ -74,11 +74,11 @@ msgstr "" "ne supprimer la propriété \"{0}\" de l'option, utiliser plutôt permissive " "dans l'option \"{1}\"" -#: tiramisu/api.py:623 +#: tiramisu/api.py:626 msgid "cannot find \"{0}\" in option \"{1}\"" msgstr "ne peut trouver \"{0}\" dans l'option \"{1}\"" -#: tiramisu/api.py:628 +#: tiramisu/api.py:631 msgid "" "cannot remove option's property \"{0}\", use permissive instead in option " "\"{1}\" at index \"{2}\"" @@ -86,39 +86,39 @@ msgstr "" "ne peut supprimer la propriété \"{0}\" de l'option, utilisez plutôt " "permissive dans l'option \"{1}\" a l'index \"{2}\"" -#: tiramisu/api.py:632 +#: tiramisu/api.py:635 msgid "cannot find \"{0}\" in option \"{1}\" at index \"{2}\"" msgstr "ne peut trouver \"{0}\" dans l'option \"{1}\" à l'index \"{2}\"" -#: tiramisu/api.py:676 +#: tiramisu/api.py:679 msgid "cannot find \"{0}\"" msgstr "ne peut trouver \"{0}\"" -#: tiramisu/api.py:808 +#: tiramisu/api.py:811 msgid "cannot reduce length of the leader {}" msgstr "il est impossible de réduire la longueur du leader \"{}\"" -#: tiramisu/api.py:861 +#: tiramisu/api.py:864 msgid "only multi value has defaultmulti" msgstr "seule les valeurs multiple a l'attribut defaultmulti" -#: tiramisu/api.py:1020 +#: tiramisu/api.py:1023 msgid "please specify a valid sub function ({0}.{1}) for {2}" msgstr "veuillez spécifier une sous fonction valide ({0}.{1}) pour {2}" -#: tiramisu/api.py:1407 +#: tiramisu/api.py:1410 msgid "properties must be a frozenset" msgstr "une propriété doit être de type frozenset" -#: tiramisu/api.py:1411 tiramisu/api.py:1438 +#: tiramisu/api.py:1414 tiramisu/api.py:1441 msgid "unknown when {} (must be in append or remove)" msgstr "value {} inconsistent (doit être append ou remove)" -#: tiramisu/api.py:1424 tiramisu/api.py:1448 tiramisu/config.py:1681 +#: tiramisu/api.py:1427 tiramisu/api.py:1451 tiramisu/config.py:1681 msgid "unknown type {}" msgstr "type inconnu {}" -#: tiramisu/api.py:1812 +#: tiramisu/api.py:1815 msgid "do not use unrestraint, nowarnings or forcepermissive together" msgstr "" "il ne faut pas utiliser unrestraint, nowarnings ou forcepermissive ensemble" @@ -205,14 +205,14 @@ msgstr "" "l'option {0} n'est pas une dynoptiondescription ou n'est pas dans une " "dynoptiondescription" -#: tiramisu/autolib.py:682 +#: tiramisu/autolib.py:685 msgid "" "cannot calculate arguments for \"{0}\", cannot find dynamic variable \"{1}\"" msgstr "" "impossible de calculer les arguments de \"{0}\", la variable dynamic \"{1}\" " "ne peut être trouvée" -#: tiramisu/autolib.py:861 +#: tiramisu/autolib.py:864 msgid "" "the \"{}\" function with positional arguments \"{}\" and keyword arguments " "\"{}\" must not return a list (\"{}\") for the follower option {}" @@ -221,7 +221,7 @@ msgstr "" "nommés \"{}\" ne doit pas retourner une liste (\"{}\") pour l'option " "suiveuse {}" -#: tiramisu/autolib.py:876 +#: tiramisu/autolib.py:879 msgid "" "the \"{}\" function must not return a list (\"{}\") for the follower option " "{}" @@ -229,7 +229,7 @@ msgstr "" "la fonction \"{}\" ne doit pas retourner une liste (\"{}\") pour l'option " "suiveuse {}" -#: tiramisu/autolib.py:917 +#: tiramisu/autolib.py:920 msgid "" "unexpected error \"{0}\" in function \"{1}\" with arguments \"{3}\" and " "\"{4}\" for option {2}" @@ -237,7 +237,7 @@ msgstr "" "erreur inattendue \"{0}\" dans la fonction \"{1}\" avec les arguments " "\"{3}\" et \"{4}\" pour l'option {2}" -#: tiramisu/autolib.py:928 +#: tiramisu/autolib.py:931 msgid "unexpected error \"{0}\" in function \"{1}\" for option {2}" msgstr "erreur inattendue \"{0}\" dans la fonction \"{1}\" pour l'option {2}" @@ -603,9 +603,17 @@ msgstr "" msgid "must starts with \"/\"" msgstr "doit débuter par \"/\"" -#: tiramisu/option/filenameoption.py:78 -msgid "cannot find {0} \"{1}\"" -msgstr "ne peut pas trouver {0} \"{1}\"" +#: tiramisu/option/filenameoption.py:77 +msgid "directory" +msgstr "répertoire" + +#: tiramisu/option/filenameoption.py:77 +msgid "file" +msgstr "fichier" + +#: tiramisu/option/filenameoption.py:79 +msgid "cannot find this {0}" +msgstr "ce {0} est introuvable" #: tiramisu/option/intoption.py:52 msgid "value should be equal or greater than \"{0}\"" @@ -961,6 +969,9 @@ msgstr "" msgid "information's item not found \"{}\"" msgstr "l'information de l'objet ne sont pas trouvé \"{}\"" +#~ msgid "cannot find {0} \"{1}\"" +#~ msgstr "ne peut pas trouver {0} \"{1}\"" + #~ msgid "" #~ "IP \"{ip[\"value\"]}\" ({ip[\"name\"]}) with this netmask is in fact a " #~ "broacast address" @@ -1140,9 +1151,6 @@ msgstr "l'information de l'objet ne sont pas trouvé \"{}\"" #~ msgid "email address" #~ msgstr "adresse mail" -#~ msgid "file name" -#~ msgstr "nom de fichier" - #~ msgid "float" #~ msgstr "nombre flottant" diff --git a/locale/tiramisu.pot b/locale/tiramisu.pot index 59a64ca..c0311fe 100644 --- a/locale/tiramisu.pot +++ b/locale/tiramisu.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2024-11-25 08:29+0100\n" +"POT-Creation-Date: 2024-12-15 11:06+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -35,79 +35,79 @@ msgstr "" msgid "Commands:" msgstr "" -#: tiramisu/api.py:111 tiramisu/api.py:1840 +#: tiramisu/api.py:111 tiramisu/api.py:1843 msgid "please specify a valid sub function ({0}.{1})" msgstr "" -#: tiramisu/api.py:194 +#: tiramisu/api.py:196 msgid "please do not specify index ({0}.{1})" msgstr "" -#: tiramisu/api.py:199 tiramisu/api.py:844 +#: tiramisu/api.py:201 tiramisu/api.py:847 msgid "please specify index with a follower option ({0}.{1})" msgstr "" -#: tiramisu/api.py:220 +#: tiramisu/api.py:222 msgid "please specify a valid sub function ({0}.{1}): {2}" msgstr "" -#: tiramisu/api.py:431 +#: tiramisu/api.py:434 msgid "the option {0} is not a dynamic option, cannot get identifiers with only_self parameter to True" msgstr "" -#: tiramisu/api.py:517 +#: tiramisu/api.py:520 msgid "cannot get option from a follower symlink without index" msgstr "" -#: tiramisu/api.py:592 +#: tiramisu/api.py:595 msgid "cannot add this property: \"{0}\"" msgstr "" -#: tiramisu/api.py:619 +#: tiramisu/api.py:622 msgid "cannot remove option's property \"{0}\", use permissive instead in option \"{1}\"" msgstr "" -#: tiramisu/api.py:623 +#: tiramisu/api.py:626 msgid "cannot find \"{0}\" in option \"{1}\"" msgstr "" -#: tiramisu/api.py:628 +#: tiramisu/api.py:631 msgid "cannot remove option's property \"{0}\", use permissive instead in option \"{1}\" at index \"{2}\"" msgstr "" -#: tiramisu/api.py:632 +#: tiramisu/api.py:635 msgid "cannot find \"{0}\" in option \"{1}\" at index \"{2}\"" msgstr "" -#: tiramisu/api.py:676 +#: tiramisu/api.py:679 msgid "cannot find \"{0}\"" msgstr "" -#: tiramisu/api.py:808 +#: tiramisu/api.py:811 msgid "cannot reduce length of the leader {}" msgstr "" -#: tiramisu/api.py:861 +#: tiramisu/api.py:864 msgid "only multi value has defaultmulti" msgstr "" -#: tiramisu/api.py:1020 +#: tiramisu/api.py:1023 msgid "please specify a valid sub function ({0}.{1}) for {2}" msgstr "" -#: tiramisu/api.py:1407 +#: tiramisu/api.py:1410 msgid "properties must be a frozenset" msgstr "" -#: tiramisu/api.py:1411 tiramisu/api.py:1438 +#: tiramisu/api.py:1414 tiramisu/api.py:1441 msgid "unknown when {} (must be in append or remove)" msgstr "" -#: tiramisu/api.py:1424 tiramisu/api.py:1448 tiramisu/config.py:1681 +#: tiramisu/api.py:1427 tiramisu/api.py:1451 tiramisu/config.py:1681 msgid "unknown type {}" msgstr "" -#: tiramisu/api.py:1812 +#: tiramisu/api.py:1815 msgid "do not use unrestraint, nowarnings or forcepermissive together" msgstr "" @@ -187,23 +187,23 @@ msgstr "" msgid "option {0} is not a dynoptiondescription or in a dynoptiondescription" msgstr "" -#: tiramisu/autolib.py:682 +#: tiramisu/autolib.py:685 msgid "cannot calculate arguments for \"{0}\", cannot find dynamic variable \"{1}\"" msgstr "" -#: tiramisu/autolib.py:861 +#: tiramisu/autolib.py:864 msgid "the \"{}\" function with positional arguments \"{}\" and keyword arguments \"{}\" must not return a list (\"{}\") for the follower option {}" msgstr "" -#: tiramisu/autolib.py:876 +#: tiramisu/autolib.py:879 msgid "the \"{}\" function must not return a list (\"{}\") for the follower option {}" msgstr "" -#: tiramisu/autolib.py:917 +#: tiramisu/autolib.py:920 msgid "unexpected error \"{0}\" in function \"{1}\" with arguments \"{3}\" and \"{4}\" for option {2}" msgstr "" -#: tiramisu/autolib.py:928 +#: tiramisu/autolib.py:931 msgid "unexpected error \"{0}\" in function \"{1}\" for option {2}" msgstr "" @@ -520,8 +520,16 @@ msgstr "" msgid "must starts with \"/\"" msgstr "" -#: tiramisu/option/filenameoption.py:78 -msgid "cannot find {0} \"{1}\"" +#: tiramisu/option/filenameoption.py:77 +msgid "directory" +msgstr "" + +#: tiramisu/option/filenameoption.py:77 +msgid "file" +msgstr "" + +#: tiramisu/option/filenameoption.py:79 +msgid "cannot find this {0}" msgstr "" #: tiramisu/option/intoption.py:52 diff --git a/tiramisu/autolib.py b/tiramisu/autolib.py index a7541fb..baae827 100644 --- a/tiramisu/autolib.py +++ b/tiramisu/autolib.py @@ -909,7 +909,7 @@ def calculate( except (ValueError, ValueWarning) as err: if allow_value_error: if force_value_warning: - raise ValueWarning(str(err)) + raise ValueWarning(msg=str(err)) raise err from err error = err except ConfigError as err: diff --git a/tiramisu/error.py b/tiramisu/error.py index 0796199..ac29ee9 100644 --- a/tiramisu/error.py +++ b/tiramisu/error.py @@ -181,7 +181,7 @@ class _CommonError: try: msg = self.prefix except AttributeError: - self.prefix = self.tmpl.format(self.val, _(self.display_type), self.name) + self.prefix = self.tmpl.format(self.val, _(self.display_type), self.name, self.index) msg = self.prefix if self.err_msg: if msg: @@ -196,13 +196,16 @@ class _CommonError: class ValueWarning(_CommonError, UserWarning): tmpl = None - def __init__(self, *args, **kwargs): + def __init__(self, **kwargs): if ValueWarning.tmpl is None: - ValueWarning.tmpl = _('attention, "{0}" could be an invalid {1} for "{2}"') - if len(args) == 1 and not kwargs: - self.msg = args[0] + if kwargs.get('index') is None: + ValueWarning.tmpl = _('attention, "{0}" could be an invalid {1} for "{2}"') + else: + ValueWarning.tmpl = _('attention, "{0}" could be an invalid {1} for "{2}" at index "{3}"') + if list(kwargs) == ['msg']: + self.msg = kwargs['msg'] else: - super().__init__(*args, **kwargs) + super().__init__(**kwargs) self.msg = None def __str__(self): @@ -214,10 +217,13 @@ class ValueWarning(_CommonError, UserWarning): class ValueOptionError(_CommonError, ValueError): tmpl = None - def __init__(self, *args, **kwargs): + def __init__(self, **kwargs): if ValueOptionError.tmpl is None: - ValueOptionError.tmpl = _('"{0}" is an invalid {1} for "{2}"') - super().__init__(*args, **kwargs) + if kwargs.get('index') is None: + ValueOptionError.tmpl = _('"{0}" is an invalid {1} for "{2}"') + else: + ValueOptionError.tmpl = _('"{0}" is an invalid {1} for "{2}" at index "{3}"') + super().__init__(**kwargs) class ValueErrorWarning(ValueWarning): diff --git a/tiramisu/locale/fr/LC_MESSAGES/tiramisu.mo b/t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!Wl5{}-~%HuE884?T$*c{>(kA8HdXV?CK< zYr+9|1O4&la=Nb%e8vqS zo)6$mhF}tEX0yCjczxMTWejh8j9QA@UIUAq-8}=D1k1-3JcMd6nfd!JR%0bz!wg)+ zuvvcFiP|&Q(1m?C3d2`AzY~e5P3Uf<@-&s}$cDD%tDNK4iosmpMosZos1ePi)!A5v zbMS!ItC+!c06zw+F&nvMZJ35ZrOrQe7UKx6i;+$4woO#-Cj$$o5YYd+PBw9e_`KvmP6M+ zB)f^0MI${;?kzfEn&SSV{lRQ|{uOiu>&SW1N>tj3PC=tCCCSo z@*`49-X}xIyF|Z)DnaCXM91z$l0j5EsM~iNupcGM}h$f-QiAk?rIZ zalgvTPsu`}@)|iuI(0$Ga`3$Fx~D$)p87EApOCF&AK6b-R+7ia&&YJ5vWHwC6~s^L ze~8Lua-38W{RXTii-}4X=^#r;0Z}~BnVUk1MAW6iZoFpof$S=r)_YMBR#w+PKzLv9_k#RZ(8$s@}Y*X3N^m WuKz##X2w;&z4e(5?ZH_?qW%ZwdHmJ@ diff --git a/tiramisu/option/option.py b/tiramisu/option/option.py index 39dc11a..ae46ffc 100644 --- a/tiramisu/option/option.py +++ b/tiramisu/option/option.py @@ -127,11 +127,6 @@ class Option(BaseOption): def test_multi_value(value): if isinstance(value, Calculation): return - # option_bag = OptionBag(self, - # None, - # undefined, - # properties=None, - # ) try: self.validate(value) self.validate_with_option( @@ -329,12 +324,12 @@ class Option(BaseOption): except ValueWarning as warn: warnings.warn_explicit( ValueWarning( - subconfig, - val, - _(self.get_type()), - self, - str(warn), - _index, + subconfig=subconfig, + val=val, + display_type=_(self.get_type()), + opt=self, + err_msg=str(warn), + index=_index, ), ValueWarning, self.__class__.__name__, @@ -370,12 +365,12 @@ class Option(BaseOption): if is_warnings_only: warnings.warn_explicit( ValueWarning( - subconfig, - _value, - _(self.get_type()), - self, - str(err), - _index, + subconfig=subconfig, + val=_value, + display_type=_(self.get_type()), + opt=self, + err_msg=str(err), + index=_index, ), ValueWarning, self.__class__.__name__, @@ -442,11 +437,11 @@ class Option(BaseOption): or "demoting_error_warning" not in subconfig.config_bag.properties ): raise ValueOptionError( - subconfig, val, _(self.get_type()), self, str(err), err_index + subconfig=subconfig, val=val, display_type=_(self.get_type()), opt=self, err_msg=str(err), index=err_index ) from err warnings.warn_explicit( ValueErrorWarning( - subconfig, val, _(self.get_type()), self, str(err), err_index + subconfig=subconfig, val=val, display_type=_(self.get_type()), opt=self, err_msg=str(err), index=err_index ), ValueErrorWarning, self.__class__.__name__,