refactor: Remove unused function

This commit is contained in:
moanos [he/him] 2025-01-07 12:47:26 +01:00
parent 8b4f5713e3
commit d4af2d88b4

View File

@ -82,15 +82,6 @@ class GeoAPI:
else: else:
self.requests = requests self.requests = requests
def get_coordinates_from_query(self, location_string):
try:
result = \
self.requests.get(self.api_url, {"q": location_string, "format": "jsonv2"},
headers=self.headers).json()[0]
except IndexError:
return None
return result["lat"], result["lon"]
def _get_raw_response(self, location_string): def _get_raw_response(self, location_string):
result = self.requests.get(self.api_url, {"q": location_string, "format": "jsonv2"}, headers=self.headers) result = self.requests.get(self.api_url, {"q": location_string, "format": "jsonv2"}, headers=self.headers)
return result.content return result.content
@ -142,5 +133,4 @@ class LocationProxy:
if __name__ == "__main__": if __name__ == "__main__":
geo = GeoAPI(debug=False) geo = GeoAPI(debug=False)
print(geo.get_coordinates_from_query("12101"))
print(calculate_distance_between_coordinates(('48.4949904', '9.040330235970146'), ("48.648333", "9.451111"))) print(calculate_distance_between_coordinates(('48.4949904', '9.040330235970146'), ("48.648333", "9.451111")))