pokeminer
pokeminer copied to clipboard
Getting name with new update
Any idea how can I obtain names with the newest update ?
This is the code that obtain names:
def get_pokemon_name(pokemon_id):
if not hasattr(get_pokemon_name, 'names'):
file_path = os.path.join(os.getcwd()+'/pokemon.json')
with open(file_path, 'r') as f:
get_pokemon_name.names = json.loads(f.read())
return get_pokemon_name.names[int(pokemon_id)]
with open(pokenamelanguage, 'r') as f:
mydict = eval(f.read())
inv_map = dict(zip(mydict.values(), mydict.keys()))
pokename = inv_map.keys()[inv_map.values().index(str(Pokemon_ID))]
print pokename
#Here you can filter what to show:
goodlist = [131,134,135,136,137,139,141,142,143,147,148,149,150,151]
print int(Pokemon_ID)
if int(Pokemon_ID) in goodlist:
print 'IN GOODLIST'
I attached the complete file if someone wants it notifyme.zip
check the web.py for all ocurences of POKEMON_NAMES and you will understand how it can be done
If you don't feel like changing code you could just grab the locales folder from a previous release (it was removed in 0.5) and place it in your pokeminer directory. Names should work fine with the notify script then.