Skip to content

Commit

Permalink
Dump cells to enable custom front-end functionalities (#1145)
Browse files Browse the repository at this point in the history
* Dump cells to enable custom front-end functionalities

Fixed merge issues for #1019

It now dumps the cell list as a json into data/cells-$username.json, so
that more front-ends can use this information (I'm working on a
Kivy-based one).

* Updated ignore file skip new cellfiles
  • Loading branch information
fredrik-hellmangroup authored Jul 27, 2016
1 parent 519f77a commit 9765828
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ src/
web/
data/last-location*.json
data/catch-ignore.yml
data/cells-*.json

#Multiple config
configs/*
Expand Down
5 changes: 5 additions & 0 deletions pokemongo_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ def update_web_location(self, cells=[], lat=None, lng=None, alt=None):
response_gym_details = self.api.call()
fort['gym_details'] = response_gym_details['responses']['GET_GYM_DETAILS']

user_data_cells = "data/cells-%s.json" % (self.config.username)
with open(user_data_cells, 'w') as outfile:
outfile.truncate()
json.dump(cells, outfile)

user_web_location = os.path.join('web', 'location-%s.json' % (self.config.username))
# alt is unused atm but makes using *location easier
try:
Expand Down

0 comments on commit 9765828

Please sign in to comment.