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
|
# Begin import game to handle Python 2 and Python 3
|
||||||
try:
|
try:
|
||||||
from urllib2 import urlopen, Request, HTTPError, URLError, HTTPErrorProcessor, build_opener
|
from urllib2 import urlopen, Request, HTTPError, URLError, \
|
||||||
|
HTTPErrorProcessor, build_opener
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from urllib.request import urlopen, Request, HTTPError, URLError, HTTPErrorProcessor, build_opener
|
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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from Queue import Queue
|
from Queue import Queue
|
||||||
|
@ -175,6 +167,15 @@ def distance(origin, destination):
|
||||||
return d
|
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):
|
class FileGetter(threading.Thread):
|
||||||
"""Thread class for retrieving a URL"""
|
"""Thread class for retrieving a URL"""
|
||||||
|
|
||||||
|
@ -448,7 +449,7 @@ def speedtest_auth(uid, pw):
|
||||||
|
|
||||||
authlist = []
|
authlist = []
|
||||||
|
|
||||||
noredir=build_opener(NoRedirection)
|
noredir = build_opener(NoRedirection)
|
||||||
|
|
||||||
postData = urlencode({'email': uid, 'password': pw, 'action': 'login'})
|
postData = urlencode({'email': uid, 'password': pw, 'action': 'login'})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue