X-Git-Url: http://git.veekun.com/zzz-dywypi.git/blobdiff_plain/52be3b3b2bd6a9d83570de43b6c5c4ee859bd974..b6f792df18514e68da6d73196cfe5e571ebe6abb:/plugins/Pokedex/plugin.py?ds=sidebyside diff --git a/plugins/Pokedex/plugin.py b/plugins/Pokedex/plugin.py index 77de7d9..84e9cf9 100644 --- a/plugins/Pokedex/plugin.py +++ b/plugins/Pokedex/plugin.py @@ -29,6 +29,7 @@ ### +import supybot.conf as conf import supybot.utils as utils from supybot.commands import * import supybot.plugins as plugins @@ -46,6 +47,10 @@ class Pokedex(callbacks.Plugin): 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): """ @@ -53,7 +58,8 @@ class Pokedex(callbacks.Plugin): Looks up 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: