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


Python DocXMLRPCServer.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from DocXMLRPCServer import DocXMLRPCServer [as 别名]
# 或者: from DocXMLRPCServer.DocXMLRPCServer import __init__ [as 别名]
    def __init__(self, addr):
        DocXMLRPCServer.__init__(self, addr, logRequests=True)
        self.register_introspection_functions()
        self.allow_none = True
        self.set_server_title('ZDStack')
        self.set_server_name('ZDStack XML-RPC API')
        self.set_server_documentation("""\
This is the documentation for the ZDStack XML-RPC API.  For more information, visit
http://zdstack.googlecode.com.""")
开发者ID:camgunz,项目名称:zdstack,代码行数:11,代码来源:XMLRPCServer.py

示例2: __init__

# 需要导入模块: from DocXMLRPCServer import DocXMLRPCServer [as 别名]
# 或者: from DocXMLRPCServer.DocXMLRPCServer import __init__ [as 别名]
	def __init__(self, registerInstance, server_address, keyFile=DEFAULTKEYFILE, certFile=DEFAULTCERTFILE, logRequests=True):
		"""Secure Documenting XML-RPC server.
		It it very similar to DocXMLRPCServer but it uses HTTPS for transporting XML data.
		"""
		DocXMLRPCServer.__init__(self, server_address, SecureDocXMLRpcRequestHandler, logRequests,True)
		self.logRequests = logRequests

		# stuff for doc server
		try: self.set_server_title(registerInstance.title)
		except AttributeError: self.set_server_title('N4D Documentation page')
		try: self.set_server_name(registerInstance.name)
		except AttributeError: self.set_server_name('N4D')
		#for plugin in registerInstace
		if registerInstance.__doc__: self.set_server_documentation(registerInstance.__doc__)
		else: self.set_server_documentation('default documentation')
		
		
		#self.register_introspection_functions()
		
		# init stuff, handle different versions:
		try:
			SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self,allow_none=True)
		except TypeError:
			# An exception is raised in Python 2.5 as the prototype of the __init__
			# method has changed and now has 3 arguments (self, allow_none, encoding)
			SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self, allow_none=True, encoding=None)
		SocketServer.BaseServer.__init__(self, server_address, SecureDocXMLRpcRequestHandler)
		self.register_instance(registerInstance) # for some reason, have to register instance down here!

		# SSL socket stuff
		ctx = SSL.Context(SSL.SSLv23_METHOD)
		ctx.use_privatekey_file(keyFile)
		ctx.use_certificate_file(certFile)
		self.socket = SSL.Connection(ctx, socket.socket(self.address_family, self.socket_type))
		
		old = fcntl.fcntl(self.socket.fileno(), fcntl.F_GETFD)	
		fcntl.fcntl(self.socket.fileno(), fcntl.F_SETFD, old | fcntl.FD_CLOEXEC)	
		
		self.server_bind()
		self.server_activate()

		# requests count and condition, to allow for keyboard quit via CTL-C
		self.requests = 0
		self.rCondition = Condition()
开发者ID:raurodse,项目名称:N4D,代码行数:46,代码来源:server.py

示例3: __init__

# 需要导入模块: from DocXMLRPCServer import DocXMLRPCServer [as 别名]
# 或者: from DocXMLRPCServer.DocXMLRPCServer import __init__ [as 别名]
 def __init__(self, users_auth, addr, timeout=0.5, *args, **kargs):
     # we use an inner class so that we can call out to the
     # authenticate method
     class VerifyingRequestHandler(DocXMLRPCRequestHandler):
         def parse_request(myself):
             # first, call the original implementation which returns
             # True if all OK so far
             if DocXMLRPCRequestHandler.parse_request(myself):
                 # next we authenticate
                 if self.authenticate(myself.headers):
                     return True
                 else:
                     # if authentication fails, tell the client
                     myself.send_error(401, 'Authentication failed')
             return False
     self._users_auth = users_auth
     self._finished = False
     self.timeout = timeout
     DocXMLRPCServer.__init__(self, addr, *args, requestHandler=VerifyingRequestHandler, **kargs)
开发者ID:mabl,项目名称:nanowrite_wrapper,代码行数:21,代码来源:nanowrite_server.py

示例4: __init__

# 需要导入模块: from DocXMLRPCServer import DocXMLRPCServer [as 别名]
# 或者: from DocXMLRPCServer.DocXMLRPCServer import __init__ [as 别名]
    def __init__(self, registerInstance, server_address, keyFile=DEFAULTKEYFILE, certFile=DEFAULTCERTFILE, logRequests=True):
        """Secure Documenting XML-RPC server.
        It it very similar to DocXMLRPCServer but it uses HTTPS for transporting XML data.
        """
        DocXMLRPCServer.__init__(self, server_address, SecureDocXMLRpcRequestHandler, logRequests)
        self.logRequests = logRequests

        # stuff for doc server
        try: self.set_server_title(registerInstance.title)
        except AttributeError: self.set_server_title('default title')
        try: self.set_server_name(registerInstance.name)
        except AttributeError: self.set_server_name('default name')
        if registerInstance.__doc__: self.set_server_documentation(registerInstance.__doc__)
        else: self.set_server_documentation('default documentation')
        self.register_introspection_functions()

        # init stuff, handle different versions:
        try:
            SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self)
        except TypeError:
            # An exception is raised in Python 2.5 as the prototype of the __init__
            # method has changed and now has 3 arguments (self, allow_none, encoding)
            SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self, False, None)
        SocketServer.BaseServer.__init__(self, server_address, SecureDocXMLRpcRequestHandler)
        self.register_instance(registerInstance) # for some reason, have to register instance down here!

        # SSL socket stuff
        ctx = SSL.Context(SSL.SSLv23_METHOD)
        ctx.use_privatekey_file(keyFile)
        ctx.use_certificate_file(certFile)
        # verify
        ctx.load_verify_locations('cert/rpc-ca.crt')
        ctx.set_verify(SSL.VERIFY_PEER|SSL.VERIFY_FAIL_IF_NO_PEER_CERT, self._verify)
        self.socket = SSL.Connection(ctx, socket.socket(self.address_family, self.socket_type))
        self.server_bind()
        self.server_activate()

        # requests count and condition, to allow for keyboard quit via CTL-C
        self.requests = 0
        self.rCondition = Condition()
开发者ID:hizel,项目名称:twistsnmp,代码行数:42,代码来源:mainsrv.py

示例5: __init__

# 需要导入模块: from DocXMLRPCServer import DocXMLRPCServer [as 别名]
# 或者: from DocXMLRPCServer.DocXMLRPCServer import __init__ [as 别名]
	def __init__(self, registerInstance, server_address, logRequests=True):
		"""Secure Documenting XML-RPC server.
		It it very similar to DocXMLRPCServer but it uses HTTPS for transporting XML data.
		"""
		DocXMLRPCServer.__init__(self, server_address, RPCHandler, logRequests)
		self.logRequests = logRequests

		# stuff for doc server
		try: self.set_server_title(registerInstance.title)
		except AttributeError: self.set_server_title('default title')
		try: self.set_server_name(registerInstance.name)
		except AttributeError: self.set_server_name('default name')
		if registerInstance.__doc__: self.set_server_documentation(registerInstance.__doc__)
		else: self.set_server_documentation('default documentation')
		self.register_introspection_functions()

		# init stuff, handle different versions:
		try:
			SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self)
		except TypeError:
			# An exception is raised in Python 2.5 as the prototype of the __init__
			# method has changed and now has 3 arguments (self, allow_none, encoding)
			SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self, False, None)
		SocketServer.BaseServer.__init__(self, server_address, RPCHandler)
		self.register_instance(registerInstance) # for some reason, have to register instance down here!

		# SSL socket stuff
		ctx = SSL.Context(SSL.SSLv23_METHOD)
		keyfile = os.path.join(Config.djangoroot, Config.get("xmlrpc-server", "keyfile"))
		certfile = os.path.join(Config.djangoroot, Config.get("xmlrpc-server", "certfile"))
		ctx.use_privatekey_file(keyfile)
		ctx.use_certificate_file(certfile)
		self.socket = SSL.Connection(ctx, socket.socket(self.address_family, self.socket_type))
		self.server_bind()
		self.server_activate()

		# requests count and condition, to allow for keyboard quit via CTL-C
		self.requests = 0
		self.rCondition = Condition()
开发者ID:SnowmanRM,项目名称:Snowman,代码行数:41,代码来源:xmlrpcserver.py

示例6: __init__

# 需要导入模块: from DocXMLRPCServer import DocXMLRPCServer [as 别名]
# 或者: from DocXMLRPCServer.DocXMLRPCServer import __init__ [as 别名]
 def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler, logRequests=1):
     self.allow_reuse_address = True
     DocXMLRPCServer.__init__(self, addr, requestHandler=requestHandler, logRequests=logRequests)
开发者ID:aabhasgarg,项目名称:accessgrid,代码行数:5,代码来源:AGXMLRPCServer.py

示例7: __init__

# 需要导入模块: from DocXMLRPCServer import DocXMLRPCServer [as 别名]
# 或者: from DocXMLRPCServer.DocXMLRPCServer import __init__ [as 别名]
 def __init__(self, addr, handler):
     signal(SIGPIPE, SIG_IGN)
     DocXMLRPCServer.__init__(self, addr, handler)
     self.serving_posts = Array('i', 70)
     self.set_server_title('Premium HTTP Server')
开发者ID:kitbs,项目名称:open-tran,代码行数:7,代码来源:PremiumHTTPServer.py

示例8: __init__

# 需要导入模块: from DocXMLRPCServer import DocXMLRPCServer [as 别名]
# 或者: from DocXMLRPCServer.DocXMLRPCServer import __init__ [as 别名]
 def __init__(self):
     DocXMLRPCServer.__init__(self, ('0.0.0.0', 54000), logRequests=False)
     self.set_server_name("RSSI Proximity")
     self.register_function(self.getProximity)
开发者ID:guoyi03,项目名称:Bluedar,代码行数:6,代码来源:BlueDarD.py


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