本文整理汇总了Python中SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleXMLRPCDispatcher.__init__方法的具体用法?Python SimpleXMLRPCDispatcher.__init__怎么用?Python SimpleXMLRPCDispatcher.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleXMLRPCServer.SimpleXMLRPCDispatcher
的用法示例。
在下文中一共展示了SimpleXMLRPCDispatcher.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCDispatcher import __init__ [as 别名]
def __init__(self, no_introspection=False):
if sys.version_info[:2] < (2, 5):
SimpleXMLRPCDispatcher.__init__(self)
else:
SimpleXMLRPCDispatcher.__init__(self, False, 'utf-8')
if not no_introspection:
self.register_introspection_functions()
示例2: __init__
# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCDispatcher import __init__ [as 别名]
def __init__(self):
#: Python 2.5 requires some arguments like `allow_none`
#: and the encoding. Python 2.4 and 2.3 doesn't.
if sys.version_info[:2] < (2, 5):
SimpleXMLRPCDispatcher.__init__(self)
else:
SimpleXMLRPCDispatcher.__init__(self, True, 'utf-8')
示例3: __init__
# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCDispatcher import __init__ [as 别名]
def __init__(self, path):
path = to_unicode(path)
SimpleXMLRPCDispatcher.__init__(self, True, 'utf-8')
self.register_introspection_functions()
self.register_multicall_functions()
self.instance = self.instance_class(path)
self.path = path
示例4: __init__
# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCDispatcher import __init__ [as 别名]
def __init__(self, requestHandler, logRequests=True, allow_none=False,
encoding=None):
self.logRequests = logRequests
SimpleXMLRPCDispatcher.__init__(self, allow_none=allow_none,
encoding=encoding)
ConnectedTCPServer.__init__(self, requestHandler)
示例5: __init__
# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCDispatcher import __init__ [as 别名]
def __init__(self, allow_none=False, encoding=None):
try:
SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
except TypeError:
# see http://bugs.debian.org/470645
# python2.4 and before only took one argument
SimpleXMLRPCDispatcher.__init__(self)
示例6: __init__
# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCDispatcher import __init__ [as 别名]
def __init__(self, registerInstance, server_address, keyFile=DEFAULTKEYFILE,
certFile=DEFAULTCERTFILE, caFile = DEFAULTCAFILE, logRequests=True):
"""Secure Documenting XML-RPC server.
It it very similar to DocXMLRPCServer but it uses HTTPS for transporting XML data.
"""
SimpleXMLRPCServer.__init__(self, server_address, SecureXMLRPCRequestHandler, logRequests)
self.logRequests = logRequests
self.register_introspection_functions()
# init stuff, handle different versions:
try:
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)
SimpleXMLRPCDispatcher.__init__(self, False, None)
SocketServer.BaseServer.__init__(self, server_address, SecureXMLRPCRequestHandler)
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(caFile)
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()
示例7: __init__
# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCDispatcher import __init__ [as 别名]
def __init__(self,application, request, transforms=None):
tornado.web.RequestHandler.__init__(self,application, request, transforms)
SimpleXMLRPCDispatcher.__init__(self,True,None)
self.register_multicall_functions()
self.register_methods()
示例8: __init__
# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCDispatcher import __init__ [as 别名]
def __init__(self, clientHost, clientPort):
SimpleXMLRPCDispatcher.__init__(self)
ThreadingTCPServer.__init__(self,
(clientHost, clientPort),
SimpleXMLRPCRequestHandler)
self.logRequests = 1
self.client = AdminControlInterface()
self.register_introspection_functions()
self.register_instance(self.client)
示例9: __init__
# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCDispatcher import __init__ [as 别名]
def __init__(self, addr, requestHandler=RequestHandler):
self.logRequests = 0
if os.path.exists(addr):
os.unlink(addr)
dir = os.path.dirname(addr)
if not(os.path.exists(dir)):
os.makedirs(dir)
SimpleXMLRPCDispatcher.__init__(self)
UnixStreamServer.__init__(self, addr, requestHandler)
示例10: __init__
# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCDispatcher import __init__ [as 别名]
def __init__(self, requestHandler=IPXMLRPCRequestHandler,
logRequests=False, allow_none=False, encoding=None):
SimpleXMLRPCDispatcher.__init__(self, allow_none=allow_none,
encoding=encoding)
self.requestHandler = requestHandler
self.logRequests = logRequests
# TODO provide proper limit for this queue
self.queue = TaskQueue(sys.maxint)
示例11: __init__
# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCDispatcher import __init__ [as 别名]
def __init__(self):
try:
# older Pythons like 2.4.3 demand a single parameter
# newest Python versions handle 1, 2 or 3 parameters
# supplying defaults for the 2nd and 3rd
SimpleXMLRPCDispatcher.__init__(self)
except:
# some mid-age Python versions demand 3 parameters without
# offering default values for the 2nd and 3rd
SimpleXMLRPCDispatcher.__init__(self, False, None)
示例12: __init__
# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCDispatcher import __init__ [as 别名]
def __init__(self, allow_none=True, encoding=None):
if sys.version_info[:2] == (2, 4):
# doesn't support extra args in python 2.4
SimpleXMLRPCDispatcher.__init__(self)
else:
SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
self.allow_none = allow_none
self.encoding = encoding
self.register_multicall_functions()
示例13: __init__
# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCDispatcher import __init__ [as 别名]
def __init__(self, addr, requestHandler=DroidPresRequestHandler, logRequests=False, allow_none=False, encoding=None, bind_and_activate=True):
self.logRequests = logRequests
SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
ThreadingTCPServer.__init__(self, addr, requestHandler, bind_and_activate)
if fcntl is not None and hasattr(fcntl, 'FD_CLOEXEC'):
flags = fcntl.fcntl(self.fileno(), fcntl.F_GETFD)
flags |= fcntl.FD_CLOEXEC
fcntl.fcntl(self.fileno(), fcntl.F_SETFD, flags)
示例14: __init__
# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCDispatcher import __init__ [as 别名]
def __init__(self, addr, requestHandler,
logRequests, allow_none, encoding, bind_and_activate):
self.logRequests = logRequests
SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
ForkingTCPServer.__init__(self, addr, requestHandler, bind_and_activate)
if fcntl is not None and hasattr(fcntl, 'FD_COLEXEC'):
flags = fcntl.fcntl(self.fileno(), fcntl.F_GETFD)
flags |= fcntl.FD_COLEXEC
fcntl.fcntl(self.fileno(), fcntl.F_SETFD, flags)
示例15: __init__
# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCDispatcher [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCDispatcher import __init__ [as 别名]
def __init__(self, apis):
SimpleXMLRPCDispatcher.__init__(self, True, 'utf-8')
funcs = {}
for api in apis:
prefix = api.prefix
for attr_name in dir(api):
attr = getattr(api, attr_name)
if callable(attr):
funcs[prefix + attr_name] = attr
self.funcs = funcs
self.register_introspection_functions()