(api, position, gym)
| 634 | |
| 635 | |
| 636 | def 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 | |
| 653 | def calc_distance(pos1, pos2): |
no test coverage detected