Skip to content

Commit

Permalink
Disable shelve for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
solderzzc committed Aug 26, 2016
1 parent 4916879 commit 3622c03
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
22 changes: 12 additions & 10 deletions pokemongo_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,18 @@ def __init__(self, config):

self.capture_locked = False # lock catching while moving to VIP pokemon

client_id_file_path = os.path.join(_base_dir, 'data', 'mqtt_client_id')
saved_info = shelve.open(client_id_file_path)
if saved_info.has_key('client_id'):
self.config.client_id = saved_info['client_id']
else:
client_uuid = uuid.uuid4()
self.config.client_id = str(client_uuid)
saved_info['client_id'] = self.config.client_id
saved_info.close()

#client_id_file_path = os.path.join(_base_dir, 'data', 'mqtt_client_id')
#saved_info = shelve.open(client_id_file_path)
#if saved_info.has_key('client_id'):
# self.config.client_id = saved_info['client_id']
#else:
# client_uuid = uuid.uuid4()
# self.config.client_id = str(client_uuid)
# saved_info['client_id'] = self.config.client_id
#saved_info.close()
# There's issue report, just disable this part.
client_uuid = uuid.uuid4()
self.config.client_id = str(client_uuid)
def start(self):
self._setup_event_system()
self._setup_logging()
Expand Down
20 changes: 11 additions & 9 deletions pokemongo_bot/health_record/bot_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ class BotEvent(object):
def __init__(self, config):
self.config = config
self.logger = logging.getLogger(__name__)
client_id_file_path = os.path.join(_base_dir, 'data', 'client_id')
saved_info = shelve.open(client_id_file_path)
if saved_info.has_key('client_id'):
self.client_id = saved_info['client_id']
else:
client_uuid = uuid.uuid4()
self.client_id = str(client_uuid)
saved_info['client_id'] = self.client_id
saved_info.close()
#client_id_file_path = os.path.join(_base_dir, 'data', 'client_id')
#saved_info = shelve.open(client_id_file_path)
#if saved_info.has_key('client_id'):
# self.client_id = saved_info['client_id']
#else:
# client_uuid = uuid.uuid4()
# self.client_id = str(client_uuid)
# saved_info['client_id'] = self.client_id
#saved_info.close()
client_uuid = uuid.uuid4()
self.client_id = str(client_uuid)
# UniversalAnalytics can be reviewed here:
# https://github.com/analytics-pros/universal-analytics-python
if self.config.health_record:
Expand Down

0 comments on commit 3622c03

Please sign in to comment.