mirror of
https://github.com/python/cpython.git
synced 2025-11-20 02:50:14 +00:00
#2072: correct documentation for .rpc_paths
This commit is contained in:
parent
080b094d20
commit
b678f98511
1 changed files with 8 additions and 2 deletions
|
|
@ -120,7 +120,7 @@ alone XML-RPC servers.
|
||||||
Registers the XML-RPC multicall function system.multicall.
|
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
|
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
|
for receiving XML-RPC requests. Requests posted to other paths will result in a
|
||||||
|
|
@ -136,9 +136,15 @@ SimpleXMLRPCServer Example
|
||||||
Server code::
|
Server code::
|
||||||
|
|
||||||
from SimpleXMLRPCServer import SimpleXMLRPCServer
|
from SimpleXMLRPCServer import SimpleXMLRPCServer
|
||||||
|
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler
|
||||||
|
|
||||||
|
# Restrict to a particular path.
|
||||||
|
class RequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
|
rpc_paths = ('/RPC2',)
|
||||||
|
|
||||||
# Create server
|
# Create server
|
||||||
server = SimpleXMLRPCServer(("localhost", 8000))
|
server = SimpleXMLRPCServer(("localhost", 8000),
|
||||||
|
requestHandler=RequestHandler)
|
||||||
server.register_introspection_functions()
|
server.register_introspection_functions()
|
||||||
|
|
||||||
# Register pow() function; this will use the value of
|
# Register pow() function; this will use the value of
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue