fix pep8 complaints
This commit is contained in:
parent
2329280da4
commit
15a922c901
|
@ -44,19 +44,11 @@ except ImportError:
|
|||
|
||||
# Begin import game to handle Python 2 and Python 3
|
||||
try:
|
||||
from urllib2 import urlopen, Request, HTTPError, URLError, HTTPErrorProcessor, build_opener
|
||||
from urllib2 import urlopen, Request, HTTPError, URLError, \
|
||||
HTTPErrorProcessor, build_opener
|
||||
except ImportError:
|
||||
from urllib.request import urlopen, Request, HTTPError, URLError, HTTPErrorProcessor, build_opener
|
||||
|
||||
|
||||
class NoRedirection(HTTPErrorProcessor):
|
||||
|
||||
def http_response(self, request, response):
|
||||
return response
|
||||
|
||||
https_response = http_response
|
||||
|
||||
|
||||
from urllib.request import urlopen, Request, HTTPError, URLError, \
|
||||
HTTPErrorProcessor, build_opener
|
||||
|
||||
try:
|
||||
from Queue import Queue
|
||||
|
@ -175,6 +167,15 @@ def distance(origin, destination):
|
|||
return d
|
||||
|
||||
|
||||
class NoRedirection(HTTPErrorProcessor):
|
||||
"""httplib class to ignore redirections"""
|
||||
|
||||
def http_response(self, request, response):
|
||||
return response
|
||||
|
||||
https_response = http_response
|
||||
|
||||
|
||||
class FileGetter(threading.Thread):
|
||||
"""Thread class for retrieving a URL"""
|
||||
|
||||
|
|
Loading…
Reference in New Issue