From e702b93762cdadb4f8339b41682f54fb4d7d6248 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 5 Jun 2020 09:54:55 +0800 Subject: [PATCH] bugfix --- appPublic/dictObject.py | 5 ++++- appPublic/http_client.py | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/appPublic/dictObject.py b/appPublic/dictObject.py index 657fbeb..ba6f806 100755 --- a/appPublic/dictObject.py +++ b/appPublic/dictObject.py @@ -39,9 +39,12 @@ class DictObject: def __setitem__(self,name,value): self.kwargs[name] = value - def __delattr__(self,name): + def __delitem__(self,name): self.kwargs.pop(name) + def get(self,name,dv=None): + return self.kwargs.get(name,dv) + def copy(self): return self.kwargs.copy() diff --git a/appPublic/http_client.py b/appPublic/http_client.py index 2d14532..0ff5fbc 100644 --- a/appPublic/http_client.py +++ b/appPublic/http_client.py @@ -20,9 +20,10 @@ class HTTPError(Exception): hostsessions = {} -class HttpClient: +class Http_Client: def __init__(self): self.s = requests.Session() + self.s.verify = False def url2domain(self,url): parts = url.split('/')[:3] @@ -64,7 +65,7 @@ class HttpClient: print('Error', url, method, params, resp.status_code, type(resp.status_code)) - raise HTTPError(resp.status_code) + raise HTTPError(resp.status_code,url) return resp def webcall(self,url,method="GET",