mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Added support for lookup by other language name. #15
English fuzzy matches are preferred, followed by Roomaji and then everything else. The return tuple from lookup() now has a `name` parameter for the actual name that was matched.
This commit is contained in:
parent
4e51867e95
commit
2bc41e2c62
2 changed files with 46 additions and 24 deletions
pokedex
|
@ -66,8 +66,12 @@ def command_lookup(name):
|
|||
else:
|
||||
print "Fuzzy-matched:"
|
||||
|
||||
for object, language, exact in results:
|
||||
print object.__tablename__, object.name, language
|
||||
for result in results:
|
||||
print "%s: %s" % (result.object.__tablename__, result.object.name),
|
||||
if result.language:
|
||||
print "(%s in %s)" % (result.name, result.language)
|
||||
else:
|
||||
print
|
||||
|
||||
|
||||
def command_help():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue