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


Python HttpTransport.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from suds.transport.http import HttpTransport [as 别名]
# 或者: from suds.transport.http.HttpTransport import __init__ [as 别名]
 def __init__(self, slug=None, session=None, related_objects=None, timeout=None):
     self.related_objects = related_objects or ()
     self.slug = slug
     self.timeout = timeout
     # super won't work because not using new style class
     HttpTransport.__init__(self)
     self._session = session or security_requests.SecuritySession()
开发者ID:matllubos,项目名称:django-security,代码行数:9,代码来源:security_suds.py

示例2: __init__

# 需要导入模块: from suds.transport.http import HttpTransport [as 别名]
# 或者: from suds.transport.http.HttpTransport import __init__ [as 别名]
    def __init__(self, **kwargs):
        """
        @param kwargs: Keyword arguments.
            - B{proxy} - An http proxy to be specified on requests.
                 The proxy is defined as {protocol:proxy,}
                    - type: I{dict}
                    - default: {}
            - B{timeout} - Set the url open timeout (seconds).
                    - type: I{float}
                    - default: 90
            - B{username} - The username used for http authentication.
                    - type: I{str}
                    - default: None
            - B{password} - The password used for http authentication.
                    - type: I{str}
                    - default: None
            - B{unverified_context} - Use an unverified context for the
                 connection, i.e. disabling HTTPS certificate validation.
                    - type: I{bool}
                    - default: False
        """
        HttpTransport.__init__(self, **kwargs)
        self.pm = urllib.request.HTTPPasswordMgrWithDefaultRealm()

        if self.options.unverified_context:
            import ssl

            self.HTTPSHandler = urllib.request.HTTPSHandler(context=ssl._create_unverified_context())
        else:
            self.HTTPSHandler = urllib.request.HTTPSHandler()
开发者ID:ticosax,项目名称:suds-ng,代码行数:32,代码来源:https.py

示例3: __init__

# 需要导入模块: from suds.transport.http import HttpTransport [as 别名]
# 或者: from suds.transport.http.HttpTransport import __init__ [as 别名]
 def __init__(self, key, cert, *args, **kwargs):
     """
     @param key: full path for the client's private key file
     @param cert: full path for the client's PEM certificate file
     """
     HttpTransport.__init__(self, *args, **kwargs)
     self.key = key
     self.cert = cert
开发者ID:AlainRoy,项目名称:htcondor,代码行数:10,代码来源:https.py

示例4: __init__

# 需要导入模块: from suds.transport.http import HttpTransport [as 别名]
# 或者: from suds.transport.http.HttpTransport import __init__ [as 别名]
 def __init__(self, key, cert, *args, **kwargs):
     """
     @param key: full path for the client's private key file
     @param cert: full path for the client's PEM certificate file
     """
     HttpTransport.__init__(self, *args, **kwargs)
     self.key = key
     self.cert = cert
     self.urlopener = u2.build_opener(self._get_auth_handler())
开发者ID:ssorj,项目名称:boneyard,代码行数:11,代码来源:https.py

示例5: __init__

# 需要导入模块: from suds.transport.http import HttpTransport [as 别名]
# 或者: from suds.transport.http.HttpTransport import __init__ [as 别名]
 def __init__(self, **kwargs):
     """
     @param kwargs: Keyword arguments.
         - B{proxy} - An http proxy to be specified on requests.
              The proxy is defined as {protocol:proxy,}
                 - type: I{dict}
                 - default: {}
         - B{timeout} - Set the url open timeout (seconds).
                 - type: I{float}
                 - default: 90
         - B{username} - The username used for http authentication.
                 - type: I{str}
                 - default: None
         - B{password} - The password used for http authentication.
                 - type: I{str}
                 - default: None
     """
     HttpTransport.__init__(self, **kwargs)
     self.pm = u2.HTTPPasswordMgrWithDefaultRealm()
开发者ID:JasonSupena,项目名称:suds,代码行数:21,代码来源:https.py

示例6: __init__

# 需要导入模块: from suds.transport.http import HttpTransport [as 别名]
# 或者: from suds.transport.http.HttpTransport import __init__ [as 别名]
    def __init__(self, **kwargs):
        """
        Provides a throttled HTTP transport for respecting rate limits
        on rate-restricted SOAP APIs using :mod:`suds`.

        This class is a :class:`suds.transport.Transport` subclass
        based on the default ``HttpAuthenticated`` transport.

        :param minimum_spacing: Minimum number of seconds between requests.
                                Default 0.
        :type minimum_spacing: int

        .. todo::
            Use redis or so to coordinate between threads to allow a
            maximum requests per hour/day limit.

        """
        self._minumum_spacing = kwargs.pop('minimum_spacing', 0)
        self._last_called = int(time.time())
        HttpTransport.__init__(self, **kwargs)
开发者ID:chintal,项目名称:tendril,代码行数:22,代码来源:www.py

示例7: __init__

# 需要导入模块: from suds.transport.http import HttpTransport [as 别名]
# 或者: from suds.transport.http.HttpTransport import __init__ [as 别名]
 def __init__(self, **kwargs):
     """
     @param kwargs: Keyword arguments.
         - B{proxy} - An http proxy to be specified on requests.
              The proxy is defined as {protocol:proxy,}
                 - type: I{dict}
                 - default: {}
         - B{cache} - The http I{transport} cache.  May be set (None) for no caching.
                 - type: L{Cache}
                 - default: L{NoCache}
         - B{username} - The username used for http authentication.
                 - type: I{str}
                 - default: None
         - B{password} - The password used for http authentication.
                 - type: I{str}
                 - default: None
     """
     HttpTransport.__init__(self, **kwargs)
     self.pm = u2.HTTPPasswordMgrWithDefaultRealm()
     self.handler = u2.HTTPBasicAuthHandler(self.pm)
     self.urlopener = u2.build_opener(self.handler)
开发者ID:tic-ull,项目名称:defensatfc-proto,代码行数:23,代码来源:https.py

示例8: __init__

# 需要导入模块: from suds.transport.http import HttpTransport [as 别名]
# 或者: from suds.transport.http.HttpTransport import __init__ [as 别名]
 def __init__(self, context, *args, **kwargs):
     HttpTransport.__init__(self, *args, **kwargs)
     self.context = context
开发者ID:jkinred,项目名称:psphere,代码行数:5,代码来源:client.py

示例9: __init__

# 需要导入模块: from suds.transport.http import HttpTransport [as 别名]
# 或者: from suds.transport.http.HttpTransport import __init__ [as 别名]
 def __init__(self, key, cert, *args, **kwargs):
     HttpTransport.__init__(self, *args, **kwargs)
     self.key = key
     self.cert = cert
开发者ID:nlattessi,项目名称:integracion-canopsis-wiki-mantis,代码行数:6,代码来源:soap.py

示例10: __init__

# 需要导入模块: from suds.transport.http import HttpTransport [as 别名]
# 或者: from suds.transport.http.HttpTransport import __init__ [as 别名]
 def __init__(self, cert, key, options=Options()):
     HttpTransport.__init__(self)
     self.handler = HTTPSClientAuthHandler(cert, key)
     self.urlopener = build_opener(self.handler)
开发者ID:imperius,项目名称:openwastetracelib,代码行数:6,代码来源:https_cert.py

示例11: __init__

# 需要导入模块: from suds.transport.http import HttpTransport [as 别名]
# 或者: from suds.transport.http.HttpTransport import __init__ [as 别名]
	def __init__(self, key, cert, **kwargs):
		HttpTransport.__init__(self, **kwargs)
		self.urlopener = urllib2.build_opener(HTTPSClientAuthHandler(key, cert))
开发者ID:VladimirVoronov,项目名称:odoo8,代码行数:5,代码来源:sslsuds.py

示例12: __init__

# 需要导入模块: from suds.transport.http import HttpTransport [as 别名]
# 或者: from suds.transport.http.HttpTransport import __init__ [as 别名]
 def __init__(self, cert, key):
     HttpTransport.__init__(self)
     self.handler = HTTPSClientAuthHandler(cert, key)
     self.urlopener = urllib2.build_opener(self.handler)
开发者ID:fabregas,项目名称:old_projects,代码行数:6,代码来源:sdkDeploy.py

示例13: __init__

# 需要导入模块: from suds.transport.http import HttpTransport [as 别名]
# 或者: from suds.transport.http.HttpTransport import __init__ [as 别名]
 def __init__(self):
     HttpTransport.__init__(self)
     self._handler = HTTPHandler()
开发者ID:yupasik,项目名称:AT,代码行数:5,代码来源:modulator.py

示例14: __init__

# 需要导入模块: from suds.transport.http import HttpTransport [as 别名]
# 或者: from suds.transport.http.HttpTransport import __init__ [as 别名]
 def __init__(self, cert, key, capath, *args, **kwargs):
     '''initialise'''
     HttpTransport.__init__(self, *args, **kwargs)
     self.urlopener = urllib2.build_opener(HTTPSClientAuthHandler(cert,
                                                                  key,
                                                                  capath))
开发者ID:ic-hep,项目名称:GridPPDIRAC,代码行数:8,代码来源:HTTPSClientUtils.py

示例15: __init__

# 需要导入模块: from suds.transport.http import HttpTransport [as 别名]
# 或者: from suds.transport.http.HttpTransport import __init__ [as 别名]
 def __init__(self, **kwargs):
     HttpTransport.__init__(self, **kwargs)
     self.urlopener = u2.build_opener(HTTPSClientAuthHandler(self.options.keyfile, self.options.certfile))
开发者ID:analytehealth,项目名称:suds,代码行数:5,代码来源:https.py


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