MCPcopy Create free account
hub / github.com/RocketMap/RocketMap / gym_request

Function gym_request

pogom/search.py:636–650  ·  view source on GitHub ↗
(api, position, gym)

Source from the content-addressed store, hash-verified

634
635
636def gym_request(api, position, gym):
637 try:
638 log.debug('Getting details for gym @ %f/%f (%fkm away)', gym['latitude'], gym['longitude'], calc_distance(position, [gym['latitude'], gym['longitude']]))
639 x = api.get_gym_details(gym_id=gym['gym_id'],
640 player_latitude=f2i(position[0]),
641 player_longitude=f2i(position[1]),
642 gym_latitude=gym['latitude'],
643 gym_longitude=gym['longitude'])
644
645 # print pretty(x)
646 return x
647
648 except Exception as e:
649 log.warning('Exception while downloading gym details: %s', e)
650 return False
651
652
653def calc_distance(pos1, pos2):

Callers 1

search_worker_threadFunction · 0.85

Calls 1

calc_distanceFunction · 0.85

Tested by

no test coverage detected