From 4e0907973a10940143945059ee16038bf91cafb3 Mon Sep 17 00:00:00 2001 From: surfaace Date: Wed, 27 Jul 2016 09:34:39 +0200 Subject: [PATCH 1/2] 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). --- pokemongo_bot/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pokemongo_bot/__init__.py b/pokemongo_bot/__init__.py index b1ed2c5339..44ee97b5f7 100644 --- a/pokemongo_bot/__init__.py +++ b/pokemongo_bot/__init__.py @@ -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: From f5e397acce425847dec8611a23e06ef6b58d4677 Mon Sep 17 00:00:00 2001 From: surfaace Date: Wed, 27 Jul 2016 09:40:15 +0200 Subject: [PATCH 2/2] Updated ignore file skip new cellfiles --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a9fa95a50f..e7becdad43 100644 --- a/.gitignore +++ b/.gitignore @@ -101,6 +101,7 @@ src/ web/ data/last-location*.json data/catch-ignore.yml +data/cells-*.json #Multiple config configs/*