Removed forme_name from lookup; added indexed_name to results.
[zzz-pokedex.git] / pokedex / __init__.py
index ccffaf2..499d8d2 100644 (file)
@@ -15,7 +15,7 @@ def main():
 
     # XXX there must be a better way to get Unicode argv
     # XXX this doesn't work on Windows durp
-    enc = sys.stdin.encoding
+    enc = sys.stdin.encoding or 'utf8'
     args = [_.decode(enc) for _ in args]
 
     # Find the command as a function in this file
@@ -54,11 +54,11 @@ def command_load(*args):
 def command_setup(*args):
     session = connect()
     pokedex.db.load.load(session, verbose=False, drop_tables=True)
-    pokedex.lookup.open_index(session=session, recreate=True)
+    pokedex.lookup.PokedexLookup(session=session, recreate=True)
 
 
 def command_lookup(name):
-    results = pokedex.lookup.lookup(name)
+    results = pokedex.lookup.PokedexLookup().lookup(name)
     if not results:
         print "No matches."
     elif results[0].exact: