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


Python SimpleXMLRPCServer.register_introspection_functions方法代码示例

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


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

示例1: main

# 需要导入模块: import SimpleXMLRPCServer [as 别名]
# 或者: from SimpleXMLRPCServer import register_introspection_functions [as 别名]
def main():
    print ("init")
    server = SimpleXMLRPCServer(('0.0.0.0', int(SLAVE_DAEMON_PORT)))
    server.register_introspection_functions()
    server.register_instance(Node())
    print ("starting server")
    server.serve_forever()
开发者ID:Infosys,项目名称:High-Availability-Hadoop,代码行数:9,代码来源:slave_daemon.py

示例2: main

# 需要导入模块: import SimpleXMLRPCServer [as 别名]
# 或者: from SimpleXMLRPCServer import register_introspection_functions [as 别名]
def main():
  try:
    opts, args = getopt.getopt(sys.argv[1:], "hs:p:", ["help"])

    serv = "localhost"
    port = 8088

    for opt, val in opts:
      if opt in ("-h", "--help"):
        usage()
        sys.exit(0)
      elif opt == "-s":
        serv = val
      elif opt == "-p":
        port = int(val)

    server = SimpleXMLRPCServer((serv, port), RequestHandler, True, True)
    server.register_introspection_functions()
    server.serve_forever()

  except getopt.GetoptError as err:
    print str(err)
    usage()
    sys.exit(1)
  except ValueError:
    usage()
    sys.exit(1)
  except KeyboardInterrupt:
    sys.exit(0)
开发者ID:sayradley,项目名称:XMLRPCServer,代码行数:31,代码来源:server.py

示例3: run

# 需要导入模块: import SimpleXMLRPCServer [as 别名]
# 或者: from SimpleXMLRPCServer import register_introspection_functions [as 别名]
    def run(self):
        class RequestHandler(SimpleXMLRPCRequestHandler):
            rpc_paths = ('/RPC2',)
    	#create a server
    	server = SimpleXMLRPCServer(("localhost",8045),requestHandler = RequestHandler)

        server.register_introspection_functions()
        def transmit_orbited(channel, message):
           """
              @param channel: The stomp channel to send to
              @param message: The message that needs to be transmitted
           """
           self.orbited.send_data(channel, message)
           return ""

        server.register_function(transmit_orbited, 'transmit')
        server.serve_forever()
开发者ID:liuhuiwisdom,项目名称:WRed,代码行数:19,代码来源:relay.py

示例4: run

# 需要导入模块: import SimpleXMLRPCServer [as 别名]
# 或者: from SimpleXMLRPCServer import register_introspection_functions [as 别名]
 def run(self):
     se = SimpleXMLRPCServer((shared.config.get('bitmessagesettings', 'apiinterface'), shared.config.getint(
         'bitmessagesettings', 'apiport')), MySimpleXMLRPCRequestHandler, True, True)
     se.register_introspection_functions()
     se.serve_forever()
开发者ID:kawalgrover,项目名称:PyBitmessage,代码行数:7,代码来源:bitmessagemain.py

示例5: runServer

# 需要导入模块: import SimpleXMLRPCServer [as 别名]
# 或者: from SimpleXMLRPCServer import register_introspection_functions [as 别名]
def runServer(port):
    server = SimpleXMLRPCServer(("", port))
    server.register_instance(Functions())
    server.register_introspection_functions()
    server.register_multicall_functions()
    server.serve_forever()
开发者ID:grep0,项目名称:ExecServer,代码行数:8,代码来源:ExecServer.py

示例6: dict

# 需要导入模块: import SimpleXMLRPCServer [as 别名]
# 或者: from SimpleXMLRPCServer import register_introspection_functions [as 别名]
        '''Handle XML-RPC 'getStatus' requests, returning current Spectracom status.
        '''
        # XML-RPC needs a simple dictionary, so reinterpret
        # collector.getLatestStatus() as a plain dict
        return dict(collector.getLatestStatus())

    # Create our XML-RPC server
    try:
        serverXMLRPC = SimpleXMLRPCServer(('0.0.0.0', getDaemonXmlRpcPort()),
                                          SimpleXMLRPCRequestHandler,
                                          logRequests = False)
    except socket.error as e:
        _logger.error('Exiting on error creating XML-RPC server: %s' % (e))
        sys.exit(1)

    serverXMLRPC.register_introspection_functions()
    serverXMLRPC.register_function(getStatus)

    # Initiate regular registration with procmap
    procmapRegister()

    # Method to handle failure of our StatusCollector
    def onStatusCollectorFailure():
        '''Callback which handles StatusCollector failure
        '''
        _logger.error('StatusCollector has died. Exiting program.')
        # Stop the XML-RPC server to exit serve_forever
        global stopping
        stopping = True
        serverXMLRPC.server_close()
开发者ID:NCAR,项目名称:HCR_instrument,代码行数:32,代码来源:SpectracomDaemon.py

示例7: hello_world

# 需要导入模块: import SimpleXMLRPCServer [as 别名]
# 或者: from SimpleXMLRPCServer import register_introspection_functions [as 别名]
            return retstr
        else:
            return 'Invalid Method [%s]'%method

# functions available as web services
class XMLRPC_register:
    def hello_world(self, t1, t2, validuser):
        if validuser:
            return t1+'-'+t2
        else:
            return "please register ur machine"

if __name__ == '__main__':
    try:
        se = SimpleXMLRPCServer(("localhost",8088), MySimpleXMLRPCRequestHandler, True, True)
        se.register_introspection_functions()
        se.serve_forever()
    except KeyboardInterrupt:
        print "Bye"
    
#--------------------- new file starts here-----------
### client.py 
import os
import base64
import xmlrpclib
import urllib2
import cookielib

class CookieAuthXMLRPCTransport(xmlrpclib.Transport):
    """ xmlrpclib.Transport that sends basic HTTP Authentication"""
开发者ID:bhramoss,项目名称:code,代码行数:32,代码来源:recipe-501148.py


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