diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2011-08-09 08:43:21 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2011-08-09 08:43:21 -0400 |
commit | 79d8c1bb8853adc469169d9dc4d55aff71738618 (patch) | |
tree | 7c81dd7a30054ca60422e7b49254703b75c4aaef /python2 | |
parent | 9fe26d75472d2a1c7bcd3ebfb40788f5e7940c76 (diff) | |
download | httplib2-79d8c1bb8853adc469169d9dc4d55aff71738618.tar.gz |
Reformatted ProxyInfo for readability
Diffstat (limited to 'python2')
-rw-r--r-- | python2/httplib2/__init__.py | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/python2/httplib2/__init__.py b/python2/httplib2/__init__.py index 02f3800..68fe365 100644 --- a/python2/httplib2/__init__.py +++ b/python2/httplib2/__init__.py @@ -730,21 +730,28 @@ class KeyCerts(Credentials): class ProxyInfo(object): - """Collect information required to use a proxy.""" - def __init__(self, proxy_type, proxy_host, proxy_port, proxy_rdns=None, proxy_user=None, proxy_pass=None): - """The parameter proxy_type must be set to one of socks.PROXY_TYPE_XXX - constants. For example: - -p = ProxyInfo(proxy_type=socks.PROXY_TYPE_HTTP, proxy_host='localhost', proxy_port=8000) - """ - self.proxy_type, self.proxy_host, self.proxy_port, self.proxy_rdns, self.proxy_user, self.proxy_pass = proxy_type, proxy_host, proxy_port, proxy_rdns, proxy_user, proxy_pass - - def astuple(self): - return (self.proxy_type, self.proxy_host, self.proxy_port, self.proxy_rdns, - self.proxy_user, self.proxy_pass) - - def isgood(self): - return (self.proxy_host != None) and (self.proxy_port != None) + """Collect information required to use a proxy.""" + def __init__(self, proxy_type, proxy_host, proxy_port, + proxy_rdns=None, proxy_user=None, proxy_pass=None): + """The parameter proxy_type must be set to one of socks.PROXY_TYPE_XXX + constants. For example: + + p = ProxyInfo(proxy_type=socks.PROXY_TYPE_HTTP, + proxy_host='localhost', proxy_port=8000) + """ + self.proxy_type = proxy_type + self.proxy_host = proxy_host + self.proxy_port = proxy_port + self.proxy_rdns = proxy_rdns + self.proxy_user = proxy_user + self.proxy_pass = proxy_pass + + def astuple(self): + return (self.proxy_type, self.proxy_host, self.proxy_port, + self.proxy_rdns, self.proxy_user, self.proxy_pass) + + def isgood(self): + return (self.proxy_host != None) and (self.proxy_port != None) class HTTPConnectionWithTimeout(httplib.HTTPConnection): |