projects
/
zzz-dywypi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fe8989a
)
Pokedex plugin now labels fuzzy-matched foreign names.
author
Eevee
<git@veekun.com>
Thu, 4 Feb 2010 00:30:11 +0000
(16:30 -0800)
committer
Eevee
<git@veekun.com>
Thu, 4 Feb 2010 00:30:11 +0000
(16:30 -0800)
plugins/Pokedex/plugin.py
patch
|
blob
|
history
diff --git
a/plugins/Pokedex/plugin.py
b/plugins/Pokedex/plugin.py
index
8fdf0da
..
14574d0
100644
(file)
--- a/
plugins/Pokedex/plugin.py
+++ b/
plugins/Pokedex/plugin.py
@@
-89,11
+89,19
@@
class Pokedex(callbacks.Plugin):
result_strings = []
for result in results:
result_strings = []
for result in results:
- result_string = result.name
+ result_string = result.object.name
+
+ # Prepend, e.g., pokemon: if necessary
if use_prefixes:
# Table classes know their singular names
prefix = result.object.__singlename__
result_string = prefix + ':' + result_string
if use_prefixes:
# Table classes know their singular names
prefix = result.object.__singlename__
result_string = prefix + ':' + result_string
+
+ # Identify foreign language names
+ if result.language:
+ result_string += u""" ({0}: {1})""".format(
+ result.iso3166, result.name)
+
result_strings.append(result_string)
self._reply(irc, u"{0}: {1}?".format(reply, '; '.join(result_strings)))
result_strings.append(result_string)
self._reply(irc, u"{0}: {1}?".format(reply, '; '.join(result_strings)))