difference between option/optiondescription in PropertiesOptionError message

This commit is contained in:
Emmanuel Garette 2015-04-19 09:25:49 +02:00
parent 2b019027be
commit 6fc921fc19
5 changed files with 27 additions and 21 deletions

View file

@ -1,5 +1,7 @@
Sun Apr 19 09:14:21 2015 +0200 Emmanuel Garette <egarette@cadoles.com>
* 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 <egarette@cadoles.com>
* refactor validation, build a fake context (with new Values and

View file

@ -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)

View file

@ -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):

View file

@ -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 <egarette@cadoles.com>\n"
"Language-Team: Tiramisu's team <egarette@cadoles.com>\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}"

View file

@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""