当前位置: 首页>>代码示例>>Python>>正文


Python HTTPSConnection.__init__方法代码示例

本文整理汇总了Python中eventlet.green.httplib.HTTPSConnection.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python HTTPSConnection.__init__方法的具体用法?Python HTTPSConnection.__init__怎么用?Python HTTPSConnection.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eventlet.green.httplib.HTTPSConnection的用法示例。


在下文中一共展示了HTTPSConnection.__init__方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from eventlet.green.httplib import HTTPSConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPSConnection import __init__ [as 别名]
 def __init__(self, host, port=None, key_file=None, cert_file=None,
              cacert=None, timeout=None, insecure=False,
              ssl_compression=True):
     # List of exceptions reported by Python3 instead of
     # SSLConfigurationError
     if six.PY3:
         excp_lst = (TypeError, IOError, ssl.SSLError)
         # https.py:250:36: F821 undefined name 'FileNotFoundError'
     else:
         # NOTE(jamespage)
         # Accomodate changes in behaviour for pep-0467, introduced
         # in python 2.7.9.
         # https://github.com/python/peps/blob/master/pep-0476.txt
         excp_lst = (TypeError, IOError, ssl.SSLError)
     try:
         HTTPSConnection.__init__(self, host, port,
                                  key_file=key_file,
                                  cert_file=cert_file)
         self.key_file = key_file
         self.cert_file = cert_file
         self.timeout = timeout
         self.insecure = insecure
         # NOTE(flaper87): `is_verified` is needed for
         # requests' urllib3. If insecure is True then
         # the request is not `verified`, hence `not insecure`
         self.is_verified = not insecure
         self.ssl_compression = ssl_compression
         self.cacert = None if cacert is None else str(cacert)
         self.set_context()
         # ssl exceptions are reported in various form in Python 3
         # so to be compatible, we report the same kind as under
         # Python2
     except excp_lst as e:
         raise exc.SSLConfigurationError(str(e))
开发者ID:openstack,项目名称:daisycloud-core,代码行数:36,代码来源:https.py

示例2: __init__

# 需要导入模块: from eventlet.green.httplib import HTTPSConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPSConnection import __init__ [as 别名]
 def __init__(
     self,
     host,
     port=None,
     key_file=None,
     cert_file=None,
     cacert=None,
     timeout=None,
     insecure=False,
     ssl_compression=True,
 ):
     # List of exceptions reported by Python3 instead of
     # SSLConfigurationError
     if six.PY3:
         excp_lst = (TypeError, FileNotFoundError, ssl.SSLError)
     else:
         excp_lst = ()
     try:
         HTTPSConnection.__init__(self, host, port, key_file=key_file, cert_file=cert_file)
         self.key_file = key_file
         self.cert_file = cert_file
         self.timeout = timeout
         self.insecure = insecure
         self.ssl_compression = ssl_compression
         self.cacert = cacert
         self.setcontext()
         # ssl exceptions are reported in various form in Python 3
         # so to be compatible, we report the same kind as under
         # Python2
     except excp_lst as e:
         raise exc.SSLConfigurationError(str(e))
开发者ID:joahsun,项目名称:python-glanceclient,代码行数:33,代码来源:http.py

示例3: __init__

# 需要导入模块: from eventlet.green.httplib import HTTPSConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPSConnection import __init__ [as 别名]
 def __init__(
     self,
     host,
     port=None,
     key_file=None,
     cert_file=None,
     cacert=None,
     timeout=None,
     insecure=False,
     ssl_compression=True,
 ):
     # List of exceptions reported by Python3 instead of
     # SSLConfigurationError
     if six.PY3:
         excp_lst = (TypeError, FileNotFoundError, ssl.SSLError)
     else:
         excp_lst = ()
     try:
         HTTPSConnection.__init__(self, host, port, key_file=key_file, cert_file=cert_file)
         self.key_file = key_file
         self.cert_file = cert_file
         self.timeout = timeout
         self.insecure = insecure
         # NOTE(flaper87): `is_verified` is needed for
         # requests' urllib3. If insecure is True then
         # the request is not `verified`, hence `not insecure`
         self.is_verified = not insecure
         self.ssl_compression = ssl_compression
         self.cacert = None if cacert is None else str(cacert)
         self.set_context()
         # ssl exceptions are reported in various form in Python 3
         # so to be compatible, we report the same kind as under
         # Python2
     except excp_lst as e:
         raise exc.SSLConfigurationError(str(e))
开发者ID:punituee,项目名称:python-glanceclient,代码行数:37,代码来源:https.py

示例4: __init__

# 需要导入模块: from eventlet.green.httplib import HTTPSConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPSConnection import __init__ [as 别名]
 def __init__(self, host, port=None, key_file=None, cert_file=None,
              cacert=None, timeout=None, insecure=False,
              ssl_compression=True):
     HTTPSConnection.__init__(self, host, port,
                              key_file=key_file,
                              cert_file=cert_file)
     self.key_file = key_file
     self.cert_file = cert_file
     self.timeout = timeout
     self.insecure = insecure
     self.ssl_compression = ssl_compression
     self.cacert = cacert
     self.setcontext()
开发者ID:ttripp,项目名称:horizon,代码行数:15,代码来源:graffiti.py


注:本文中的eventlet.green.httplib.HTTPSConnection.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。