cinap_lenrekadd hg and python4bb9e2215 years agoHistory
105 lines · 3.4 KB · TeX
RawDownload
\section{\module{DocXMLRPCServer} ---         Self-documenting XML-RPC server} \declaremodule{standard}{DocXMLRPCServer}\modulesynopsis{Self-documenting XML-RPC server implementation.}\moduleauthor{Brian Quinlan}{brianq@activestate.com}\sectionauthor{Brian Quinlan}{brianq@activestate.com} \versionadded{2.3} The \module{DocXMLRPCServer} module extends the classes found in\module{SimpleXMLRPCServer} to serve HTML documentation in response toHTTP GET requests. Servers can either be free standing, using\class{DocXMLRPCServer}, or embedded in a CGI environment, using\class{DocCGIXMLRPCRequestHandler}. \begin{classdesc}{DocXMLRPCServer}{addr\optional{,                                    requestHandler\optional{, logRequests}}} Create a new server instance. All parameters have the same meaning asfor \class{SimpleXMLRPCServer.SimpleXMLRPCServer};\var{requestHandler} defaults to \class{DocXMLRPCRequestHandler}. \end{classdesc} \begin{classdesc}{DocCGIXMLRPCRequestHandler}{} Create a new instance to handle XML-RPC requests in a CGI environment. \end{classdesc} \begin{classdesc}{DocXMLRPCRequestHandler}{} Create a new request handler instance. This request handler supportsXML-RPC POST requests, documentation GET requests, and modifieslogging so that the \var{logRequests} parameter to the\class{DocXMLRPCServer} constructor parameter is honored. \end{classdesc} \subsection{DocXMLRPCServer Objects \label{doc-xmlrpc-servers}} The \class{DocXMLRPCServer} class is derived from\class{SimpleXMLRPCServer.SimpleXMLRPCServer} and provides a means ofcreating self-documenting, stand alone XML-RPC servers. HTTP POSTrequests are handled as XML-RPC method calls. HTTP GET requests arehandled by generating pydoc-style HTML documentation. This allows aserver to provide its own web-based documentation. \begin{methoddesc}{set_server_title}{server_title} Set the title used in the generated HTML documentation. This titlewill be used inside the HTML "title" element. \end{methoddesc} \begin{methoddesc}{set_server_name}{server_name} Set the name used in the generated HTML documentation. This name willappear at the top of the generated documentation inside a "h1"element. \end{methoddesc}  \begin{methoddesc}{set_server_documentation}{server_documentation} Set the description used in the generated HTML documentation. Thisdescription will appear as a paragraph, below the server name, in thedocumentation. \end{methoddesc} \subsection{DocCGIXMLRPCRequestHandler} The \class{DocCGIXMLRPCRequestHandler} class is derived from\class{SimpleXMLRPCServer.CGIXMLRPCRequestHandler} and provides a meansof creating self-documenting, XML-RPC CGI scripts. HTTP POST requestsare handled as XML-RPC method calls. HTTP GET requests are handled bygenerating pydoc-style HTML documentation. This allows a server toprovide its own web-based documentation. \begin{methoddesc}{set_server_title}{server_title} Set the title used in the generated HTML documentation. This titlewill be used inside the HTML "title" element. \end{methoddesc} \begin{methoddesc}{set_server_name}{server_name} Set the name used in the generated HTML documentation. This name willappear at the top of the generated documentation inside a "h1"element. \end{methoddesc}  \begin{methoddesc}{set_server_documentation}{server_documentation} Set the description used in the generated HTML documentation. Thisdescription will appear as a paragraph, below the server name, in thedocumentation. \end{methoddesc}