translation

This commit is contained in:
Emmanuel Garette 2013-07-17 23:02:50 +02:00
parent 15ac8c2872
commit bc054d75af
2 changed files with 20 additions and 11 deletions

View File

@ -248,7 +248,7 @@ class SubConfig(BaseInformation):
_subpath=self.cfgimpl_get_path()) _subpath=self.cfgimpl_get_path())
def find_first(self, bytype=None, byname=None, byvalue=None, def find_first(self, bytype=None, byname=None, byvalue=None,
type_='option'): type_='option', display_error=True):
""" """
finds an option recursively in the config finds an option recursively in the config
@ -260,10 +260,11 @@ class SubConfig(BaseInformation):
return self.cfgimpl_get_context()._find(bytype, byname, byvalue, return self.cfgimpl_get_context()._find(bytype, byname, byvalue,
first=True, first=True,
type_=type_, type_=type_,
_subpath=self.cfgimpl_get_path()) _subpath=self.cfgimpl_get_path(),
display_error=display_error)
def _find(self, bytype, byname, byvalue, first, type_='option', def _find(self, bytype, byname, byvalue, first, type_='option',
_subpath=None, check_properties=True): _subpath=None, check_properties=True, display_error=True):
""" """
convenience method for finding an option that lives only in the subtree convenience method for finding an option that lives only in the subtree
@ -346,9 +347,10 @@ class SubConfig(BaseInformation):
else: else:
find_results.append(retval) find_results.append(retval)
if find_results == []: if find_results == []:
#FIXME too slow if display_error:
#raise AttributeError(_("no option found in config with these criteria")) raise AttributeError(_("no option found in config with these criteria"))
raise AttributeError("no option found in config with these criteria") else:
raise AttributeError()
else: else:
return find_results return find_results
@ -568,7 +570,8 @@ class MetaConfig(CommonConfig):
except PropertiesOptionError: except PropertiesOptionError:
pass pass
def find_first_contexts(self, byname=None, bypath=None, byvalue=None, type_='context'): def find_first_contexts(self, byname=None, bypath=None, byvalue=None,
type_='context', display_error=True):
ret = [] ret = []
try: try:
if bypath is None and byname is not None and \ if bypath is None and byname is not None and \
@ -592,12 +595,14 @@ class MetaConfig(CommonConfig):
else: else:
ret.append(child.find_first(byname=byname, ret.append(child.find_first(byname=byname,
byvalue=byvalue, byvalue=byvalue,
type_=type_)) type_=type_,
display_error=False))
else: else:
ret.extend(child.find_first_contexts(byname=byname, ret.extend(child.find_first_contexts(byname=byname,
bypath=bypath, bypath=bypath,
byvalue=byvalue, byvalue=byvalue,
type_=type_)) type_=type_,
display_error=False))
except AttributeError: except AttributeError:
pass pass
return ret return ret

View File

@ -26,8 +26,8 @@ msgid ""
"unable to carry out a calculation, option value with multi types must have " "unable to carry out a calculation, option value with multi types must have "
"same length for: {0}" "same length for: {0}"
msgstr "" msgstr ""
"impossible d'effectuer le calcul, valeur d'un option avec le type multi " "impossible d'effectuer le calcul, valeur d'un option avec le type multi doit "
"doit avoir la même longueur pour : {0}" "avoir la même longueur pour : {0}"
#: tiramisu/config.py:45 #: tiramisu/config.py:45
msgid "descr must be an optiondescription, not {0}" msgid "descr must be an optiondescription, not {0}"
@ -397,3 +397,7 @@ msgstr "ne peut étendre une option multi {0} pour une maître ou une esclave"
#: tiramisu/value.py:381 #: tiramisu/value.py:381
msgid "cannot pop a value on a multi option {0} which is a slave" msgid "cannot pop a value on a multi option {0} which is a slave"
msgstr "ne peut supprimer une valeur dans l'option multi {0} qui est esclave" msgstr "ne peut supprimer une valeur dans l'option multi {0} qui est esclave"
#: tiramisu/config.py:351
msgid "no option found in config with these criteria"
msgstr "aucune option trouvée dans la config avec ces critères"