From 6fc921fc1986e30e883edc311fe696da4876319b Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sun, 19 Apr 2015 09:25:49 +0200 Subject: [PATCH] difference between option/optiondescription in PropertiesOptionError message --- ChangeLog | 2 ++ tiramisu/option/baseoption.py | 4 ++-- tiramisu/setting.py | 11 ++++++++--- translations/fr/tiramisu.po | 17 ++++++++--------- translations/tiramisu.pot | 14 +++++++------- 5 files changed, 27 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 95bf8fd..6b4a4a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ Sun Apr 19 09:14:21 2015 +0200 Emmanuel Garette * valid Option is an unicode or a string if needed + * difference between option/optiondescription in PropertiesOptionError + message Sat Apr 18 22:42:53 2015 +0200 Emmanuel Garette * refactor validation, build a fake context (with new Values and diff --git a/tiramisu/option/baseoption.py b/tiramisu/option/baseoption.py index 500b348..ef57b71 100644 --- a/tiramisu/option/baseoption.py +++ b/tiramisu/option/baseoption.py @@ -909,7 +909,7 @@ class SymLinkOption(OnlyOption): self.commit() def __getattr__(self, name, context=undefined): - if name in ('_opt', '_opt_type', '_readonly', 'impl_getpath', '_name', + if name in ('_opt', '_readonly', 'impl_getpath', '_name', '_state_opt', '_impl_setopt'): return object.__getattr__(self, name) else: @@ -963,7 +963,7 @@ class DynSymLinkOption(object): self._opt = opt def __getattr__(self, name, context=undefined): - if name in ('_opt', '_opt_type', '_readonly', 'impl_getpath', '_name', '_state_opt'): + if name in ('_opt', '_readonly', 'impl_getpath', '_name', '_state_opt'): return object.__getattr__(self, name) else: return getattr(self._impl_getopt(), name) diff --git a/tiramisu/setting.py b/tiramisu/setting.py index 399b22f..dfe48a4 100644 --- a/tiramisu/setting.py +++ b/tiramisu/setting.py @@ -483,9 +483,14 @@ class Settings(object): opt_or_descr.impl_getname()), props) else: - raise PropertiesOptionError(_("trying to access to an option " - "named: {0} with properties {1}" - "").format(opt_or_descr.impl_getname(), + if opt_or_descr.impl_is_optiondescription(): + opt_type = 'optiondescription' + else: + opt_type = 'option' + raise PropertiesOptionError(_("trying to access to an {0} " + "named: {1} with properties {2}" + "").format(opt_type, + opt_or_descr._name, str(props)), props) def setpermissive(self, permissive, opt=None, path=None): diff --git a/translations/fr/tiramisu.po b/translations/fr/tiramisu.po index 71a1b69..1230f74 100644 --- a/translations/fr/tiramisu.po +++ b/translations/fr/tiramisu.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Tiramisu\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-04-18 23:52+CEST\n" +"POT-Creation-Date: 2015-04-19 09:23+CEST\n" "PO-Revision-Date: \n" "Last-Translator: Emmanuel Garette \n" "Language-Team: Tiramisu's team \n" @@ -195,7 +195,6 @@ msgid "'{0}' ({1}) object attribute '{2}' is read-only" msgstr "l'attribut {2} de l'objet '{0}' ({1}) est en lecture seule" #: tiramisu/option/baseoption.py:392 -#, fuzzy msgid "invalid unicode or string" msgstr "invalide unicode ou string" @@ -661,19 +660,19 @@ msgid "cannot change the value for option {0} this option is frozen" msgstr "" "ne peut modifier la valeur de l'option {0} cette option n'est pas modifiable" -#: tiramisu/setting.py:486 -msgid "trying to access to an option named: {0} with properties {1}" -msgstr "tentative d'accès à une option nommée : {0} avec les propriétés {1}" +#: tiramisu/setting.py:490 +msgid "trying to access to an {0} named: {1} with properties {2}" +msgstr "tentative d'accès à une {0} nommée : {1} avec les propriétés {2}" -#: tiramisu/setting.py:504 +#: tiramisu/setting.py:509 msgid "permissive must be a tuple" msgstr "permissive doit être un tuple" -#: tiramisu/setting.py:511 tiramisu/value.py:442 +#: tiramisu/setting.py:516 tiramisu/value.py:442 msgid "invalid generic owner {0}" msgstr "invalide owner générique {0}" -#: tiramisu/setting.py:599 +#: tiramisu/setting.py:604 msgid "" "malformed requirements imbrication detected for option: '{0}' with " "requirement on: '{1}'" @@ -681,7 +680,7 @@ msgstr "" "imbrication de requirements mal formés detectée pour l'option : '{0}' avec " "requirement sur : '{1}'" -#: tiramisu/setting.py:610 +#: tiramisu/setting.py:615 msgid "option '{0}' has requirement's property error: {1} {2}" msgstr "l'option '{0}' a une erreur de propriété pour le requirement : {1} {2}" diff --git a/translations/tiramisu.pot b/translations/tiramisu.pot index 8ca877e..ae7b3e9 100644 --- a/translations/tiramisu.pot +++ b/translations/tiramisu.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2015-04-18 23:52+CEST\n" +"POT-Creation-Date: 2015-04-19 09:23+CEST\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -601,23 +601,23 @@ msgstr "" msgid "cannot change the value for option {0} this option is frozen" msgstr "" -#: tiramisu/setting.py:486 -msgid "trying to access to an option named: {0} with properties {1}" +#: tiramisu/setting.py:490 +msgid "trying to access to an {0} named: {1} with properties {2}" msgstr "" -#: tiramisu/setting.py:504 +#: tiramisu/setting.py:509 msgid "permissive must be a tuple" msgstr "" -#: tiramisu/setting.py:511 tiramisu/value.py:442 +#: tiramisu/setting.py:516 tiramisu/value.py:442 msgid "invalid generic owner {0}" msgstr "" -#: tiramisu/setting.py:599 +#: tiramisu/setting.py:604 msgid "malformed requirements imbrication detected for option: '{0}' with requirement on: '{1}'" msgstr "" -#: tiramisu/setting.py:610 +#: tiramisu/setting.py:615 msgid "option '{0}' has requirement's property error: {1} {2}" msgstr ""