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


Python ServerProxy.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import __init__ [as 别名]
 def __init__(self, config, notebook):
     self.name = 'DokuWiki'
     self.notebook = notebook
     
     # Configuration
     self.url, username, pwd = config.get(self.name, self.notebook).split(';')
     ServerProxy.__init__(self, self.url + '/lib/exe/xmlrpc.php?' + urlencode({'u':username, 'p':pwd}))
开发者ID:antiface,项目名称:notefinder,代码行数:9,代码来源:dokuwiki.py

示例2: __init__

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import __init__ [as 别名]
 def __init__(self, host, client_name, version="1_0_0_0"):
     self.version = version
     self.client_name = client_name
     if self.version == "1_0_0_0":
         try:
             ServerProxy.__init__(self, host, allow_none=True)
         except Error, v:
             print "CONNECTION ERROR", v
开发者ID:rbulha,项目名称:pyroboticstudio,代码行数:10,代码来源:RSClientServer.py

示例3: __init__

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import __init__ [as 别名]
 def __init__(self, child_command, debug=False):
     """
     if debug is True, all communication will be
     logged to sys.stderr
     """
     self.transport = EnsembleTransport(
         self.connect(child_command, debug))
     ServerProxy.__init__(self, "http://ensemble/", # just to avoid error
                          transport=self.transport)
开发者ID:elmore,项目名称:sixthdev,代码行数:11,代码来源:ensemble.py

示例4: __init__

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import __init__ [as 别名]
 def __init__ (self, username=False, password=False, prog_name=False, verbose=False):
     if not (username and password and prog_name):
         raise SipgateAPIException('To use the class sipgate.api you must provide, username, password and a program name.')
     address = SIPGATE_API_URL % {'username':username, 'password':password}
     ### The super() call would be more modern but it doesn't work with the current Python version yet.
     #super(api, self).__init__(address, verbose=debug)
     ServerProxy.__init__(self, address,verbose=verbose)
     ### It is considered good practice to Identify the client talking to the server:
     self.ClientIdentify({ "ClientName" : NAME % prog_name, "ClientVersion" : VERSION, "ClientVendor" : VENDOR })
开发者ID:pklaus,项目名称:python-sipgate-xmlrpc,代码行数:11,代码来源:sipgate.py

示例5: __init__

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import __init__ [as 别名]
	def __init__(self, uri, encoding=None, verbose=0, allow_none=0,
			use_datetime=0, cookiejar=None):

		if cookiejar is None:
			cookiejar = CookieJar()

		transport = RequestTransport(use_datetime=use_datetime, uri=uri,
				cookiejar=cookiejar)
		ServerProxy.__init__(self, uri=uri, transport=transport,
				encoding=encoding, verbose=verbose, allow_none=allow_none,
				use_datetime=use_datetime)
开发者ID:Xarthisius,项目名称:pybugz,代码行数:13,代码来源:bugzilla.py

示例6: __init__

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import __init__ [as 别名]
	def __init__(self, _servaddr, TLS = False, certificatePath = '', S = None):
		_addr = _servaddr.split(':')
		enable_proxy(str(_addr[0]), S)
		if TLS :
			servaddr = 'https://' + _servaddr
		else :
			servaddr = 'http://' + _servaddr
		ServerProxy.__init__(self, servaddr)

		self.Ready = False
		addr = (str(_addr[0]), int(_addr[1]))
		self.socketInit(addr, TLS, certificatePath)
		if writeSocketReady(self.socket, TIMEOUT) :
			self.Ready = True
开发者ID:F1ash,项目名称:LightMight,代码行数:16,代码来源:SSLOverloadClass.py

示例7: __init__

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import __init__ [as 别名]
  def __init__(self, context):
    preference_tool = getToolByName(context, 'portal_preferences')

    address = preference_tool.getPreferredOoodocServerAddress()
    port = preference_tool.getPreferredOoodocServerPortNumber()
    if address in ('', None) or port in ('', None) :
      raise ConversionError('OOoDocument: cannot proceed with conversion:'
            ' conversion server host and port is not defined in preferences')

    uri = 'http://%s:%d' % (address, port)
    timeout = preference_tool.getPreferredOoodocServerTimeout() \
                    or OOO_SERVER_PROXY_TIMEOUT
    transport = TimeoutTransport(timeout=timeout, scheme='http')

    ServerProxy.__init__(self, uri, allow_none=True, transport=transport)
开发者ID:Verde1705,项目名称:erp5,代码行数:17,代码来源:OOoDocument.py

示例8: __init__

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import __init__ [as 别名]
    def __init__(self, *args, **kw):
        """All unknown arguments are passed to xmlrpc.ServerProxy.__init__

        Specific to SklikProxy:
            loglevel - debug log level, 0 - no logging, 2 - full logging [0]
            exceptions - if True raise exceptions when status != 200 [False]
        """

        self.__session = None
        self.__debug = kw.pop('loglevel', 0)
        self.__exceptions = kw.pop('exceptions', False)

        kw.setdefault('allow_none', True)

        ServerProxy.__init__(self, *args, **kw)
开发者ID:shamrin,项目名称:thin-sklik-client,代码行数:17,代码来源:sklik.py

示例9: __init__

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import __init__ [as 别名]
	def __init__(self, *args, **kwargs):
		
		self.stopped = False
		
		from Plugins.Extensions.SeriesPlugin.plugin import REQUEST_PARAMETER
		uri = config.plugins.seriesplugin.serienserver_url.value + REQUEST_PARAMETER
		
		import ssl
		if hasattr(ssl, '_create_unverified_context'):
			ssl._create_default_https_context = ssl._create_unverified_context
		ServerProxy.__init__(self, uri, verbose=False, *args, **kwargs)
		
		timeout = config.plugins.seriesplugin.socket_timeout.value
		socket.setdefaulttimeout( float(timeout) )
		
		self.skip = {}
开发者ID:betonme,项目名称:e2openplugin-SeriesPlugin,代码行数:18,代码来源:TimeoutServerProxy.py

示例10: __init__

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import __init__ [as 别名]
    def __init__(self, uri=None, ca_certs=None, keyfile=None, certfile=None,
                 cert_reqs=ssl.CERT_REQUIRED, ssl_version=ssl.PROTOCOL_TLSv1,
                 transport=None, encoding=None, verbose=0, allow_none=0, use_datetime=0,
                 timeout=socket._GLOBAL_DEFAULT_TIMEOUT, strict=None):

        if not transport:
            _transport=SSLClientTransport(ca_certs, keyfile, certfile, cert_reqs,
                                         ssl_version, timeout, strict)
        else:
            _transport=transport(ca_certs, keyfile, certfile, cert_reqs,
                                         ssl_version, timeout, strict)


        ServerProxy.__init__(self, uri, _transport, encoding, verbose,
                        allow_none, use_datetime)

        self.logger = logging.getLogger(self.__class__.__name__)
开发者ID:Cophy08,项目名称:spring-python,代码行数:19,代码来源:xmlrpc.py

示例11: __init__

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import __init__ [as 别名]
    def __init__(self, logger, url, ssl_config):
        keywords = {}
        if url.startswith('https'):
            # Choose the right SSL Transport (depend on xmlrpclib version)
            import xmlrpclib
            if hasattr(xmlrpclib, 'GzipDecodedResponse'):
                # XML-RPC backport enabled: use our SSL transport, compatible
                # with the new XML-RPC library API
                from ufwi_rpcd.common.ssl.transport import SSL_Transport
            else:
                from M2Crypto.m2xmlrpclib import SSL_Transport

            # Use M2Crypto transport
            context = ssl_config.createContext(logger)
            keywords['transport'] = SSL_Transport(context)

        else:
            logger.critical("WARNING: Unsafe cleartext connection (HTTP)")

        ServerProxy.__init__(self, url, **keywords)
开发者ID:maximerobin,项目名称:Ufwi,代码行数:22,代码来源:serverproxy.py

示例12: __init__

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import __init__ [as 别名]
 def __init__(self, host=None):
     if not host:
         host = config.raspi2
         
     ServerProxy.__init__(self, 'http://{}:{}'.format(host, PORT))
开发者ID:sakurahilljp,项目名称:pyraspi,代码行数:7,代码来源:appservice.py

示例13: __init__

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import __init__ [as 别名]
 def __init__ (self, address, username=None, password=None, language='en', verbose=False):
     self.__address = address
     #super(domrobot, self).__init__(address, transport=InwxTransport(), encoding = "UTF-8", verbose=verbose)
     ServerProxy.__init__(self, address, transport=InwxTransport(), encoding = "UTF-8", verbose=verbose)
     self.account.login({'lang': language, 'user': username, 'pass': password})
开发者ID:chrissicool,项目名称:inwx-dyndns,代码行数:7,代码来源:inwx.py

示例14: __init__

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import __init__ [as 别名]
	def __init__(self, uri, *args, **kw):
		ServerProxy.__init__(self, uri = uri, *args, **kw)
		self.__uri = uri
开发者ID:tubav,项目名称:teagle,代码行数:5,代码来源:Shadow.py

示例15: __init__

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import __init__ [as 别名]
 def __init__ (self, address, verbose=False):
     self.__address = address
     ServerProxy.__init__(self, address, transport=InwxTransport(), encoding = "UTF-8", verbose=verbose)
开发者ID:inwx,项目名称:python2.6-client,代码行数:5,代码来源:inwx.py


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