Uses **kwargs for geocodeAddress
This commit is contained in:
parent
1a21dda52a
commit
4a55223ec7
@ -1,4 +1,3 @@
|
|||||||
import inspect
|
|
||||||
import json
|
import json
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
@ -70,25 +69,10 @@ class Geocoder:
|
|||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def geocodeAddress(self,
|
def geocodeAddress(self, **kwargs):
|
||||||
searchtext=None,
|
|
||||||
city=None,
|
|
||||||
country=None,
|
|
||||||
county=None,
|
|
||||||
district=None,
|
|
||||||
housenumber=None,
|
|
||||||
postalcode=None,
|
|
||||||
state=None,
|
|
||||||
street=None):
|
|
||||||
frame = inspect.currentframe()
|
|
||||||
keys, _, _, values = inspect.getargvalues(frame)
|
|
||||||
|
|
||||||
iterableKeys = iter(keys)
|
|
||||||
next(iterableKeys)
|
|
||||||
|
|
||||||
params = {}
|
params = {}
|
||||||
for key in iterableKeys:
|
for key, value in kwargs.iteritems():
|
||||||
if values[key]: params[key] = values[key]
|
if value: params[key] = value
|
||||||
|
|
||||||
if not params: raise NoGeocodingParams()
|
if not params: raise NoGeocodingParams()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user