Split PokedexLookup(recreate=True) into its own method. #216
[zzz-pokedex.git] / pokedex / __init__.py
index df3958b..dde6b5f 100644 (file)
@@ -93,8 +93,10 @@ def get_lookup(options, session=None, recreate=False):
         print "Opened lookup index {index_dir} (from {got_from})" \
             .format(index_dir=index_dir, got_from=got_from)
 
-    lookup = pokedex.lookup.PokedexLookup(index_dir, session=session,
-                                                     recreate=recreate)
+    lookup = pokedex.lookup.PokedexLookup(index_dir, session=session)
+
+    if recreate:
+        lookup.rebuild_index()
 
     return lookup