Bugfix: show recommendations only if available
This commit is contained in:
parent
d4f28b55d8
commit
f26a721704
@ -106,9 +106,13 @@ class Entry(object):
|
|||||||
if type(attr) != str:
|
if type(attr) != str:
|
||||||
return "Expected parameter '" + name + "' to be of type string."
|
return "Expected parameter '" + name + "' to be of type string."
|
||||||
if attr not in choices:
|
if attr not in choices:
|
||||||
# noinspection PyTypeChecker
|
match = difflib.get_close_matches(attr, choices, 1)
|
||||||
return "Value '" + attr + "' not allowed for parameter '" + name + "'. Did you mean '" +\
|
if len(match) > 0:
|
||||||
difflib.get_close_matches(attr, choices, 1)[0] + "'?"
|
# noinspection PyTypeChecker
|
||||||
|
return "Value '" + attr + "' not allowed for parameter '" + name + "'. Did you mean '" +\
|
||||||
|
match[0] + "'?"
|
||||||
|
else:
|
||||||
|
return "Value '" + attr + "' not allowed for parameter '" + name + "'."
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def check_file(self, name) -> Union[None, str]:
|
def check_file(self, name) -> Union[None, str]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user