Fix altered public method of TomTomGeocoder

In #456 the public method geocode_meta return value was changed
(to a tuple).
This commit is contained in:
Javier Goizueta 2019-03-13 12:47:37 +01:00
parent 1ae8eaafd0
commit 1cbbe29e22

View File

@ -73,16 +73,20 @@ class TomTomGeocoder(Traceable):
@qps_retry(qps=5, provider='tomtom')
def geocode(self, searchtext, city=None, state_province=None,
country=None):
geocoder_response, http_response = self.geocode_meta(searchtext, city, state_province, country)
geocoder_response, http_response = self._geocode_meta(searchtext, city, state_province, country)
error_message = geocoder_response[1].get('error', None)
if error_message:
raise ServiceException(error_message, http_response)
else:
return geocoder_response[0]
@qps_retry(qps=5, provider='tomtom')
def geocode_meta(self, searchtext, city=None, state_province=None,
country=None):
return self._geocode_meta(searchtext, city, state_province, country)[0]
@qps_retry(qps=5, provider='tomtom')
def _geocode_meta(self, searchtext, city=None, state_province=None,
country=None):
if searchtext:
searchtext = searchtext.decode('utf-8')
if city: