Google geocoding class cleanup
@@ -29,7 +29,6 @@ class Google(Base):
> geocode
> places
> reverse
- > batch
> timezone
> elevation
:param key: Your Google developers free key.
@@ -47,18 +46,19 @@ class Google(Base):
self.client_secret = kwargs.get('client_secret', google_client_secret)
self.params = {
'address': location,
- 'key': None if self.client and self.client_secret else kwargs.get('key', google_key),
- 'client': self.client,
'bounds': kwargs.get('bounds', ''),
'language': kwargs.get('language', ''),
'region': kwargs.get('region', ''),
'components': kwargs.get('components', ''),
}
if self.client and self.client_secret:
- self._encode_params(**kwargs)
+ self.params['client'] = self.client
+ self._encode_params()
+ elif kwargs.get('key', google_key):
+ self.params['key'] = kwargs.get('key', google_key)
self._initialize(**kwargs)
- def _encode_params(self, **kwargs):
+ def _encode_params(self):
# turn non-empty params into sorted list in order to maintain signature validity.
# Requests will honor the order.
self.params = sorted([(k, v) for (k, v) in self.params.items() if v])
