Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed check if file exists. Fixes #778 #798

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions pokemongo_bot/stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,18 @@ def _work_at_position(self, lat, lng, alt, pokemon_only=False):
if 'map_cells' in response_dict['responses'][
'GET_MAP_OBJECTS']:
user_web_location = 'web/location-%s.json' % (self.config.username)
if os.path.isfile(user_web_location):
with open(user_web_location, 'w') as outfile:
json.dump(
{'lat': lat,
'lng': lng,
'cells': response_dict[
'responses']['GET_MAP_OBJECTS']['map_cells']},
outfile)
with open(user_web_location, 'w') as outfile:
json.dump(
{'lat': lat,
'lng': lng,
'cells': response_dict[
'responses']['GET_MAP_OBJECTS']['map_cells']},
outfile)

user_data_lastlocation = 'data/last-location-%s.json' % (self.config.username)
if os.path.isfile(user_data_lastlocation):
with open(user_data_lastlocation, 'w') as outfile:
outfile.truncate()
json.dump({'lat': lat, 'lng': lng}, outfile)
with open(user_data_lastlocation, 'w') as outfile:
outfile.truncate()
json.dump({'lat': lat, 'lng': lng}, outfile)

if response_dict and 'responses' in response_dict:
if 'GET_MAP_OBJECTS' in response_dict['responses']:
Expand Down