Skip to content

Commit

Permalink
Docs and misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Dec 26, 2013
1 parent 30bfad0 commit 84774c5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ Logging
geopy will log geocoding URLs with a logger name `geopy` at level `DEBUG`,
and for some geocoders, these URLs will include authentication information.
If this is a concern, one can disable this logging by specifying a logging
level of `NOTSET` for logger name `geopy`.
level of `NOTSET` or a level greater than `DEBUG` for logger name `geopy`.
geopy does no logging above DEBUG.


Indices and search
Expand Down
15 changes: 15 additions & 0 deletions geopy/geocoders/arcgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,19 @@ def _authenticated_call_geocoder(self, url, timeout=None):
return self._base_call_geocoder(request, timeout=timeout)

def geocode(self, query, exactly_one=True, timeout=None):
"""
Geocode a location query.
:param string query: The address or query you wish to geocode.
:param bool exactly_one: Return one result or a list of results, if
available.
:param int timeout: Time, in seconds, to wait for the geocoding service
to respond before raising a :class:`geopy.exc.GeocoderTimedOut`
exception. Set this only if you wish to override, on this call only,
the value set during the geocoder's initialization.
"""
# TODO: dict as query for parameterized query
# TODO: SRID
params = {'text': query, 'f': 'json'}
Expand Down Expand Up @@ -129,6 +142,8 @@ def geocode(self, query, exactly_one=True, timeout=None):
def reverse(self, query, exactly_one=True, timeout=None, # pylint: disable=R0913,W0221
distance=None, wkid=DEFAULT_WKID):
"""
Given a point, find an address.
:param query: The coordinates for which you wish to obtain the
closest human-readable addresses.
:type query: :class:`geopy.point.Point`, list or tuple of (latitude,
Expand Down
4 changes: 1 addition & 3 deletions geopy/geocoders/placefinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ def __init__(self, consumer_key, consumer_secret, # pylint: disable=R0913
"""
if oauth2 is None:
raise ImportError('oauth2 is needed for YahooPlaceFinder')
if Request is None:
raise NotImplementedError("YahooPlaceFinder is not compatible with Py3k")
super(YahooPlaceFinder, self).__init__(scheme=scheme, timeout=timeout, proxies=proxies)
self.consumer_key = consumer_key
self.consumer_secret = consumer_secret
Expand Down Expand Up @@ -177,7 +175,7 @@ def geocode(self, query, min_quality=0, raw=False, reverse=False, # pylint: disa

if not raw:
results = [
(YahooPlaceFinder.humanize(place), point)
(self.humanize(place), point)
for (place, point) in results
]

Expand Down
5 changes: 2 additions & 3 deletions geopy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import logging
from geopy.compat import py3k

try:
if not py3k: # pragma: no cover
NUMBER_TYPES = (int, long, float)
except NameError: # pragma: no cover
else: # pragma: no cover
NUMBER_TYPES = (int, float) # long -> int in Py3k
try:
from decimal import Decimal
Expand All @@ -25,7 +25,6 @@ def emit(self, record):
pass

logger = logging.getLogger('geopy') # pylint: disable=C0103
logger.addHandler(NullHandler())


def pairwise(seq):
Expand Down

0 comments on commit 84774c5

Please sign in to comment.