From: Andrew M. Kuchling Date: Sat, 23 Feb 2008 15:41:51 +0000 (+0000) Subject: #2072: correct documentation for .rpc_paths X-Git-Tag: v2.6a1~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b678f985113350e60e0121554939bbaacc1166e6;p=python #2072: correct documentation for .rpc_paths --- diff --git a/Doc/library/simplexmlrpcserver.rst b/Doc/library/simplexmlrpcserver.rst index 65eed37059..c788d55d57 100644 --- a/Doc/library/simplexmlrpcserver.rst +++ b/Doc/library/simplexmlrpcserver.rst @@ -120,7 +120,7 @@ alone XML-RPC servers. Registers the XML-RPC multicall function system.multicall. -.. attribute:: SimpleXMLRPCServer.rpc_paths +.. attribute:: SimpleXMLRPCRequestHandler.rpc_paths An attribute value that must be a tuple listing valid path portions of the URL for receiving XML-RPC requests. Requests posted to other paths will result in a @@ -136,9 +136,15 @@ SimpleXMLRPCServer Example Server code:: from SimpleXMLRPCServer import SimpleXMLRPCServer + from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler + + # Restrict to a particular path. + class RequestHandler(SimpleXMLRPCRequestHandler): + rpc_paths = ('/RPC2',) # Create server - server = SimpleXMLRPCServer(("localhost", 8000)) + server = SimpleXMLRPCServer(("localhost", 8000), + requestHandler=RequestHandler) server.register_introspection_functions() # Register pow() function; this will use the value of