This plugin provides simple Pokédex lookups.
-You must install the pokedex module, run 'pokedex setup', and provide the paths
-to the resulting SQLite and Whoosh files.
+You must install the pokedex module, run 'pokedex setup', and provide the path
+to the resulting database.
+
+The plugin will create a full-text lookup index when it's first loaded, in a
+directory called 'pokedex-index' inside the data directory. This may take a
+few moments.
pokedex can be found here: http://git.veekun.com/?p=pokedex.git;a=summary
###
+import supybot.conf as conf
import supybot.utils as utils
from supybot.commands import *
import supybot.plugins as plugins
self.__parent = super(Pokedex, self)
self.__parent.__init__(irc)
self.db = pokedex.db.connect(self.registryValue('databaseURL'))
+ self.indices = pokedex.lookup.open_index(
+ directory=conf.supybot.directories.data.dirize('pokedex-index'),
+ session=self.db,
+ )
def pokedex(self, irc, msg, args, thing):
"""<thing...>
Looks up <thing> in the veekun Pokédex."""
# Similar logic to the site, here.
- results = pokedex.lookup.lookup(thing, session=self.db)
+ results = pokedex.lookup.lookup(thing, session=self.db,
+ indices=self.indices)
# Nothing found
if len(results) == 0: