difference between option/optiondescription in PropertiesOptionError message

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

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