1
0
Fork 0
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.

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:
Eevee 2009-08-22 01:13:34 -07:00
parent 4e51867e95
commit 2bc41e2c62
2 changed files with 46 additions and 24 deletions

View file

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