blob: 958ea9585424077f83720fadfdf4a85068969cb3 [file] [log] [blame]
Georg Brandl8ec7f652007-08-15 14:28:01 +00001
2:mod:`DocXMLRPCServer` --- Self-documenting XML-RPC server
3==========================================================
4
5.. module:: DocXMLRPCServer
6 :synopsis: Self-documenting XML-RPC server implementation.
7.. moduleauthor:: Brian Quinlan <brianq@activestate.com>
8.. sectionauthor:: Brian Quinlan <brianq@activestate.com>
9
10
11.. versionadded:: 2.3
12
13The :mod:`DocXMLRPCServer` module extends the classes found in
14:mod:`SimpleXMLRPCServer` to serve HTML documentation in response to HTTP GET
15requests. Servers can either be free standing, using :class:`DocXMLRPCServer`,
16or embedded in a CGI environment, using :class:`DocCGIXMLRPCRequestHandler`.
17
18
19.. class:: DocXMLRPCServer(addr[, requestHandler[, logRequests[, allow_none[, encoding[, bind_and_activate]]]]])
20
21 Create a new server instance. All parameters have the same meaning as for
22 :class:`SimpleXMLRPCServer.SimpleXMLRPCServer`; *requestHandler* defaults to
23 :class:`DocXMLRPCRequestHandler`.
24
25
26.. class:: DocCGIXMLRPCRequestHandler()
27
28 Create a new instance to handle XML-RPC requests in a CGI environment.
29
30
31.. class:: DocXMLRPCRequestHandler()
32
33 Create a new request handler instance. This request handler supports XML-RPC
34 POST requests, documentation GET requests, and modifies logging so that the
35 *logRequests* parameter to the :class:`DocXMLRPCServer` constructor parameter is
36 honored.
37
38
39.. _doc-xmlrpc-servers:
40
41DocXMLRPCServer Objects
42-----------------------
43
44The :class:`DocXMLRPCServer` class is derived from
45:class:`SimpleXMLRPCServer.SimpleXMLRPCServer` and provides a means of creating
46self-documenting, stand alone XML-RPC servers. HTTP POST requests are handled as
47XML-RPC method calls. HTTP GET requests are handled by generating pydoc-style
48HTML documentation. This allows a server to provide its own web-based
49documentation.
50
51
52.. method:: DocXMLRPCServer.set_server_title(server_title)
53
54 Set the title used in the generated HTML documentation. This title will be used
55 inside the HTML "title" element.
56
57
58.. method:: DocXMLRPCServer.set_server_name(server_name)
59
60 Set the name used in the generated HTML documentation. This name will appear at
61 the top of the generated documentation inside a "h1" element.
62
63
64.. method:: DocXMLRPCServer.set_server_documentation(server_documentation)
65
66 Set the description used in the generated HTML documentation. This description
67 will appear as a paragraph, below the server name, in the documentation.
68
69
70DocCGIXMLRPCRequestHandler
71--------------------------
72
73The :class:`DocCGIXMLRPCRequestHandler` class is derived from
74:class:`SimpleXMLRPCServer.CGIXMLRPCRequestHandler` and provides a means of
75creating self-documenting, XML-RPC CGI scripts. HTTP POST requests are handled
76as XML-RPC method calls. HTTP GET requests are handled by generating pydoc-style
77HTML documentation. This allows a server to provide its own web-based
78documentation.
79
80
81.. method:: DocCGIXMLRPCRequestHandler.set_server_title(server_title)
82
83 Set the title used in the generated HTML documentation. This title will be used
84 inside the HTML "title" element.
85
86
87.. method:: DocCGIXMLRPCRequestHandler.set_server_name(server_name)
88
89 Set the name used in the generated HTML documentation. This name will appear at
90 the top of the generated documentation inside a "h1" element.
91
92
93.. method:: DocCGIXMLRPCRequestHandler.set_server_documentation(server_documentation)
94
95 Set the description used in the generated HTML documentation. This description
96 will appear as a paragraph, below the server name, in the documentation.
97