Skip to content

Commit

Permalink
Update inventory.py (#4928)
Browse files Browse the repository at this point in the history
FIX: #4926
  • Loading branch information
sohje authored and mjmadsen committed Aug 30, 2016
1 parent 85545e5 commit 9e81c6e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pokemongo_bot/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,14 @@ def refresh(self,inventory):
self.player_stats = self.retrieve_data(inventory)

def parse(self, item):
self.exp = item['experience']
self.level = item['level']
self.next_level_xp = item['next_level_xp']
self.pokemons_captured = item['pokemons_captured']
self.poke_stop_visits = item['poke_stop_visits']
if not item:
item = {}

self.exp = item.get('experience', 0)
self.level = item.get('level', 0)
self.next_level_xp = item.get('next_level_xp', 0)
self.pokemons_captured = item.get('pokemons_captured', 0)
self.poke_stop_visits = item.get('poke_stop_visits', 0)

def retrieve_data(self, inventory):
ret = {}
Expand Down

0 comments on commit 9e81c6e

Please sign in to comment.