示例#1
0
 def __init__(self,
              debuglevel=0,
              context=None,
              source_address=None,
              timeout=10):
     AbstractHTTPHandler.__init__(self, debuglevel)
     self._context = context
     self.source_address = source_address
     self.timeout = timeout
示例#2
0
    def __init__(self, ssl_context, debuglevel=0):
        """
        @param ssl_context:SSL context
        @type ssl_context: OpenSSL.SSL.Context
        @param debuglevel: debug level for HTTPSHandler
        @type debuglevel: int
        """
        AbstractHTTPHandler.__init__(self, debuglevel)

        if ssl_context is not None:
            if not isinstance(ssl_context, SSL.Context):
                raise TypeError('Expecting OpenSSL.SSL.Context type for "'
                                'ssl_context" keyword; got %r instead' %
                                ssl_context)
            self.ssl_context = ssl_context
        else:
            self.ssl_context = SSL.Context(SSL.SSLv23_METHOD)
示例#3
0
文件: conftest.py 项目: snaury/copper
 def __init__(self, default_path):
     AbstractHTTPHandler.__init__(self)
     self.default_path = default_path
 def __init__(self, **kwargs):
     AbstractHTTPHandler.__init__(self)
     self._connection_args = kwargs
示例#5
0
 def __init__(self, **kwargs):
     """Constructor. Any keyword args are passed to the httplib handler."""
     AbstractHTTPHandler.__init__(self)
     self._connection_args = kwargs
示例#6
0
 def __init__(self, **kwargs):
     """Constructor. Any keyword args are passed to the httplib handler."""
     AbstractHTTPHandler.__init__(self)
     self._connection_args = kwargs