Made the multimatch error messages with the multimatch_string supplied more useful, addressing the first part of #933.
This commit is contained in:
parent
3c1245b1a6
commit
08f34ae61b
1 changed files with 9 additions and 11 deletions
|
|
@ -1549,10 +1549,8 @@ def at_search_result(matches, caller, query="", quiet=False, **kwargs):
|
||||||
error = kwargs.get("nofound_string") or _("Could not find '%s'." % query)
|
error = kwargs.get("nofound_string") or _("Could not find '%s'." % query)
|
||||||
matches = None
|
matches = None
|
||||||
elif len(matches) > 1:
|
elif len(matches) > 1:
|
||||||
error = kwargs.get("multimatch_string", None)
|
error = kwargs.get("multimatch_string",
|
||||||
if not error:
|
_("More than one match for '%s' (please narrow target):" % query))
|
||||||
error = _("More than one match for '%s'" \
|
|
||||||
" (please narrow target):" % query)
|
|
||||||
for num, result in enumerate(matches):
|
for num, result in enumerate(matches):
|
||||||
error += "\n %i%s%s%s" % (
|
error += "\n %i%s%s%s" % (
|
||||||
num + 1, _MULTIMATCH_SEPARATOR,
|
num + 1, _MULTIMATCH_SEPARATOR,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue