slimkrazy / python-google-places

Simple wrapper around the new 'experimental' Google Places API
MIT License
474 stars 167 forks source link

Add option to add timeout property to `urlopen` call #56

Open commadelimited opened 9 years ago

commadelimited commented 9 years ago

When making calls to Google via urlopen: https://github.com/slimkrazy/python-google-places/blob/master/googleplaces/__init__.py#L68

there's no timeout specified. This means that the call will default to no timeout, or infinite. It would be great to be able to specific a timeout option on a method by method basis, or even a default timeout when instantiating the lib for the first time. Perhaps something like this:

google_places = googleplaces.GooglePlaces(
    settings.GOOGLE_PLACES_API_KEY,
    timeout=2
)
commadelimited commented 8 years ago

Bump

slimkrazy commented 8 years ago

PR #57 has a module constant. You want to update that with your suggestion? Use the constant timeout as default, allowing for the dev to override when they instantiate the top-level object?