/Doc/library/docxmlrpcserver.rst

http://unladen-swallow.googlecode.com/ · ReStructuredText · 101 lines · 61 code · 40 blank · 0 comment · 0 complexity · 73160c36a3b93cd430142637f8672132 MD5 · raw file

  1. :mod:`DocXMLRPCServer` --- Self-documenting XML-RPC server
  2. ==========================================================
  3. .. module:: DocXMLRPCServer
  4. :synopsis: Self-documenting XML-RPC server implementation.
  5. .. moduleauthor:: Brian Quinlan <brianq@activestate.com>
  6. .. sectionauthor:: Brian Quinlan <brianq@activestate.com>
  7. .. note::
  8. The :mod:`DocXMLRPCServer` module has been merged into :mod:`xmlrpc.server`
  9. in Python 3.0. The :term:`2to3` tool will automatically adapt imports when
  10. converting your sources to 3.0.
  11. .. versionadded:: 2.3
  12. The :mod:`DocXMLRPCServer` module extends the classes found in
  13. :mod:`SimpleXMLRPCServer` to serve HTML documentation in response to HTTP GET
  14. requests. Servers can either be free standing, using :class:`DocXMLRPCServer`,
  15. or embedded in a CGI environment, using :class:`DocCGIXMLRPCRequestHandler`.
  16. .. class:: DocXMLRPCServer(addr[, requestHandler[, logRequests[, allow_none[, encoding[, bind_and_activate]]]]])
  17. Create a new server instance. All parameters have the same meaning as for
  18. :class:`SimpleXMLRPCServer.SimpleXMLRPCServer`; *requestHandler* defaults to
  19. :class:`DocXMLRPCRequestHandler`.
  20. .. class:: DocCGIXMLRPCRequestHandler()
  21. Create a new instance to handle XML-RPC requests in a CGI environment.
  22. .. class:: DocXMLRPCRequestHandler()
  23. Create a new request handler instance. This request handler supports XML-RPC
  24. POST requests, documentation GET requests, and modifies logging so that the
  25. *logRequests* parameter to the :class:`DocXMLRPCServer` constructor parameter is
  26. honored.
  27. .. _doc-xmlrpc-servers:
  28. DocXMLRPCServer Objects
  29. -----------------------
  30. The :class:`DocXMLRPCServer` class is derived from
  31. :class:`SimpleXMLRPCServer.SimpleXMLRPCServer` and provides a means of creating
  32. self-documenting, stand alone XML-RPC servers. HTTP POST requests are handled as
  33. XML-RPC method calls. HTTP GET requests are handled by generating pydoc-style
  34. HTML documentation. This allows a server to provide its own web-based
  35. documentation.
  36. .. method:: DocXMLRPCServer.set_server_title(server_title)
  37. Set the title used in the generated HTML documentation. This title will be used
  38. inside the HTML "title" element.
  39. .. method:: DocXMLRPCServer.set_server_name(server_name)
  40. Set the name used in the generated HTML documentation. This name will appear at
  41. the top of the generated documentation inside a "h1" element.
  42. .. method:: DocXMLRPCServer.set_server_documentation(server_documentation)
  43. Set the description used in the generated HTML documentation. This description
  44. will appear as a paragraph, below the server name, in the documentation.
  45. DocCGIXMLRPCRequestHandler
  46. --------------------------
  47. The :class:`DocCGIXMLRPCRequestHandler` class is derived from
  48. :class:`SimpleXMLRPCServer.CGIXMLRPCRequestHandler` and provides a means of
  49. creating self-documenting, XML-RPC CGI scripts. HTTP POST requests are handled
  50. as XML-RPC method calls. HTTP GET requests are handled by generating pydoc-style
  51. HTML documentation. This allows a server to provide its own web-based
  52. documentation.
  53. .. method:: DocCGIXMLRPCRequestHandler.set_server_title(server_title)
  54. Set the title used in the generated HTML documentation. This title will be used
  55. inside the HTML "title" element.
  56. .. method:: DocCGIXMLRPCRequestHandler.set_server_name(server_name)
  57. Set the name used in the generated HTML documentation. This name will appear at
  58. the top of the generated documentation inside a "h1" element.
  59. .. method:: DocCGIXMLRPCRequestHandler.set_server_documentation(server_documentation)
  60. Set the description used in the generated HTML documentation. This description
  61. will appear as a paragraph, below the server name, in the documentation.