Skip to content

Commit

Permalink
Merge 8915306 into db8f80e
Browse files Browse the repository at this point in the history
  • Loading branch information
larsklitzke committed Oct 9, 2018
2 parents db8f80e + 8915306 commit c58e3ea
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
language: python
sudo: false
python:
- "2.7"
- "3.2"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
Expand Down
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ Install

Supported Python versions:

* Python 2.7
* Python >= 3.2
* Python >= 3.4
* PyPy and PyPy3

**Install:**
Expand Down
7 changes: 5 additions & 2 deletions overpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Overpass(object):
default_retry_timeout = 1.0
default_url = "http://overpass-api.de/api/interpreter"

def __init__(self, read_chunk_size=None, url=None, xml_parser=XML_PARSER_SAX, max_retry_count=None, retry_timeout=None):
def __init__(self, read_chunk_size=None, url=None, xml_parser=XML_PARSER_SAX, max_retry_count=None, retry_timeout=None, context=None):
"""
:param read_chunk_size: Max size of each chunk read from the server response
:type read_chunk_size: Integer
Expand All @@ -73,6 +73,7 @@ def __init__(self, read_chunk_size=None, url=None, xml_parser=XML_PARSER_SAX, ma
:type max_retry_count: Integer
:param retry_timeout: Time to wait between tries (Default: default_retry_timeout)
:type retry_timeout: float
:param context: SSL content of the query. Can be used for connections to servers with unverified certificates.
"""
self.url = self.default_url
if url is not None:
Expand All @@ -92,6 +93,8 @@ def __init__(self, read_chunk_size=None, url=None, xml_parser=XML_PARSER_SAX, ma
retry_timeout = self.default_retry_timeout
self.retry_timeout = retry_timeout

self.context = context

self.xml_parser = xml_parser

def _handle_remark_msg(self, msg):
Expand Down Expand Up @@ -129,7 +132,7 @@ def query(self, query):
time.sleep(self.retry_timeout)
retry_num += 1
try:
f = urlopen(self.url, query)
f = urlopen(self.url, query, context=self.context)
except HTTPError as e:
f = e

Expand Down
4 changes: 0 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27,py32,py33,py34,py35,py36,pypy,pypy3
envlist = py34,py35,py36,pypy,pypy3

[testenv]
deps = pytest
Expand Down

0 comments on commit c58e3ea

Please sign in to comment.