(self)
| 142 | return jsonify(d) |
| 143 | |
| 144 | def next_loc(self): |
| 145 | args = get_args() |
| 146 | if args.fixed_location: |
| 147 | return 'Location changes are turned off', 403 |
| 148 | # part of query string |
| 149 | if request.args: |
| 150 | lat = request.args.get('lat', type=float) |
| 151 | lon = request.args.get('lon', type=float) |
| 152 | # from post requests |
| 153 | if request.form: |
| 154 | lat = request.form.get('lat', type=float) |
| 155 | lon = request.form.get('lon', type=float) |
| 156 | |
| 157 | if not (lat and lon): |
| 158 | log.warning('Invalid next location: %s,%s', lat, lon) |
| 159 | return 'bad parameters', 400 |
| 160 | else: |
| 161 | self.location_queue.put((lat, lon, 0)) |
| 162 | self.set_current_location((lat, lon, 0)) |
| 163 | log.info('Changing next location: %s,%s', lat, lon) |
| 164 | return self.loc() |
| 165 | |
| 166 | def list_pokemon(self): |
| 167 | # todo: check if client is android/iOS/Desktop for geolink, currently |
nothing calls this directly
no test coverage detected