rename to simplehttp so we don't affect http

This commit is contained in:
Jay Lee
2017-01-25 09:02:11 -05:00
parent 08bc1898cc
commit ae578c64a0

View File

@ -422,9 +422,9 @@ def doGAMCheckForUpdates(forceCheck=False):
return return
check_url = GAM_LATEST_RELEASE # latest full release check_url = GAM_LATEST_RELEASE # latest full release
headers = {u'Accept': u'application/vnd.github.v3.text+json'} headers = {u'Accept': u'application/vnd.github.v3.text+json'}
http = httplib2.Http(disable_ssl_certificate_validation=GC_Values[GC_NO_VERIFY_SSL]) simplehttp = httplib2.Http(disable_ssl_certificate_validation=GC_Values[GC_NO_VERIFY_SSL])
try: try:
(_, c) = http.request(check_url, u'GET', headers=headers) (_, c) = simplehttp.request(check_url, u'GET', headers=headers)
try: try:
release_data = json.loads(c) release_data = json.loads(c)
except ValueError: except ValueError:
@ -3098,9 +3098,9 @@ def doPhoto(users):
filename = filename.replace(u'#username#', user[:user.find(u'@')]) filename = filename.replace(u'#username#', user[:user.find(u'@')])
print u"Updating photo for %s with %s (%s/%s)" % (user, filename, i, count) print u"Updating photo for %s with %s (%s/%s)" % (user, filename, i, count)
if re.match(u'^(ht|f)tps?://.*$', filename): if re.match(u'^(ht|f)tps?://.*$', filename):
http = httplib2.Http(disable_ssl_certificate_validation=GC_Values[GC_NO_VERIFY_SSL]) simplehttp = httplib2.Http(disable_ssl_certificate_validation=GC_Values[GC_NO_VERIFY_SSL])
try: try:
(_, f) = http.request(filename, u'GET') (_, f) = simplehttp.request(filename, u'GET')
image_data = str(f) image_data = str(f)
except (httplib2.HttpLib2Error, httplib2.ServerNotFoundError, httplib2.CertificateValidationUnsupported) as e: except (httplib2.HttpLib2Error, httplib2.ServerNotFoundError, httplib2.CertificateValidationUnsupported) as e:
print e print e
@ -6291,8 +6291,8 @@ and accept the Terms of Service (ToS). As soon as you've accepted the ToS popup,
sys.exit(2) sys.exit(2)
break break
apis_url = u'https://raw.githubusercontent.com/jay0lee/GAM/master/src/project-apis.txt' apis_url = u'https://raw.githubusercontent.com/jay0lee/GAM/master/src/project-apis.txt'
http = httplib2.Http(disable_ssl_certificate_validation=GC_Values[GC_NO_VERIFY_SSL]) simplehttp = httplib2.Http(disable_ssl_certificate_validation=GC_Values[GC_NO_VERIFY_SSL])
_, c = http.request(apis_url, u'GET') _, c = simplehttp.request(apis_url, u'GET')
apis = c.splitlines() apis = c.splitlines()
serveman = googleapiclient.discovery.build(u'servicemanagement', u'v1', http=http, cache_discovery=False) serveman = googleapiclient.discovery.build(u'servicemanagement', u'v1', http=http, cache_discovery=False)
for api in apis: for api in apis: