summaryrefslogtreecommitdiff
path: root/python2
diff options
context:
space:
mode:
authorJoe Gregorio <jcgregorio@google.com>2011-02-14 22:08:51 -0500
committerJoe Gregorio <jcgregorio@google.com>2011-02-14 22:08:51 -0500
commit7c9736950ff36769bbb25ae399dfa5dd14ad813f (patch)
tree971382fabb78005c1d74f0a8010488fe00d66466 /python2
parenta4daf7a77c6f7da5b2f08ea07b20fb2717366819 (diff)
downloadhttplib2-7c9736950ff36769bbb25ae399dfa5dd14ad813f.tar.gz
Fixes issue 110.
Diffstat (limited to 'python2')
-rw-r--r--python2/httplib2/__init__.py32
1 files changed, 26 insertions, 6 deletions
diff --git a/python2/httplib2/__init__.py b/python2/httplib2/__init__.py
index 9b7e0af..b2063af 100644
--- a/python2/httplib2/__init__.py
+++ b/python2/httplib2/__init__.py
@@ -716,7 +716,14 @@ p = ProxyInfo(proxy_type=socks.PROXY_TYPE_HTTP, proxy_host='localhost', proxy_po
class HTTPConnectionWithTimeout(httplib.HTTPConnection):
- """HTTPConnection subclass that supports timeouts"""
+ """
+ HTTPConnection subclass that supports timeouts
+
+ All timeouts are in seconds. If None is passed for timeout then
+ Python's default timeout for sockets will be used. See for example
+ the docs of socket.setdefaulttimeout():
+ http://docs.python.org/library/socket.html#socket.setdefaulttimeout
+ """
def __init__(self, host, port=None, strict=None, timeout=None, proxy_info=None):
httplib.HTTPConnection.__init__(self, host, port, strict)
@@ -760,8 +767,14 @@ class HTTPConnectionWithTimeout(httplib.HTTPConnection):
raise socket.error, msg
class HTTPSConnectionWithTimeout(httplib.HTTPSConnection):
- "This class allows communication via SSL."
+ """
+ This class allows communication via SSL.
+ All timeouts are in seconds. If None is passed for timeout then
+ Python's default timeout for sockets will be used. See for example
+ the docs of socket.setdefaulttimeout():
+ http://docs.python.org/library/socket.html#socket.setdefaulttimeout
+ """
def __init__(self, host, port=None, key_file=None, cert_file=None,
strict=None, timeout=None, proxy_info=None):
httplib.HTTPSConnection.__init__(self, host, port=port, key_file=key_file,
@@ -816,11 +829,18 @@ class Http(object):
and more.
"""
def __init__(self, cache=None, timeout=None, proxy_info=None):
- """The value of proxy_info is a ProxyInfo instance.
+ """
+ The value of proxy_info is a ProxyInfo instance.
-If 'cache' is a string then it is used as a directory name
-for a disk cache. Otherwise it must be an object that supports
-the same interface as FileCache."""
+ If 'cache' is a string then it is used as a directory name for
+ a disk cache. Otherwise it must be an object that supports the
+ same interface as FileCache.
+
+ All timeouts are in seconds. If None is passed for timeout
+ then Python's default timeout for sockets will be used. See
+ for example the docs of socket.setdefaulttimeout():
+ http://docs.python.org/library/socket.html#socket.setdefaulttimeout
+ """
self.proxy_info = proxy_info
# Map domain name to an httplib connection
self.connections = {}