[Patches] [ python-Patches-536883 ] SimpleXMLRPCServer auto-docing subclass

SourceForge.net noreply@sourceforge.net
Mon, 31 Mar 2003 01:22:30 -0800


Patches item #536883, was opened at 2002-03-29 11:52
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=536883&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Brian Quinlan (bquinlan)
Assigned to: Martin v. Löwis (loewis)
Summary: SimpleXMLRPCServer auto-docing subclass

Initial Comment:
This SimpleXMLRPCServer subclass automatically serves 
HTML documentation, generated using pydoc, in response 
to an HTTP GET request (XML-RPC always uses POST).

Here are some examples:
http://www.sweetapp.com/cgi-bin/xmlrpc-test/rpc1.py
http://www.sweetapp.com/cgi-bin/xmlrpc-test/rpc2.py


----------------------------------------------------------------------

>Comment By: Brian Quinlan (bquinlan)
Date: 2003-03-31 01:22

Message:
Logged In: YES 
user_id=108973

Write test function: ok
Write documentation: ok

>If the module is named, say, DocXMLRPCServer, there is 
>no need to have the Doc prefix on the class names.

Hmmm. If you look at the core BaseHTTPRequestHandler 
derived classes,  each one is prefixed to match the module 
that it is found in. The only two modules that I can think of 
with identical class names are cStringIO and StringIO, which 
theoretically provide identical semantics.


----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-03-31 01:07

Message:
Logged In: YES 
user_id=21627

I see. The code is fine, but it needs to come with a test 
function, to operate the module as a program. I suggest that 
the test server provides the get_source_code() operation just 
as your demo client does; the docstring of the class may 
provide an xmlrpclib fragment that retrieves the source code 
(AFAICT, the source code is not directly accessible through 
an URL, is it?)

I also recommend that you reconsider renaming the classes: 
If the module is named, say, DocXMLRPCServer, there is no 
need to have the Doc prefix on the class names. Instead, 
they can be named just "XMLRPCServer" etc.


----------------------------------------------------------------------

Comment By: Brian Quinlan (bquinlan)
Date: 2003-03-30 22:56

Message:
Logged In: YES 
user_id=108973

>I'm not sure how to place this. Is this an extension to
>pydoc? 

No. This module provides subclasses for 
SimpleXMLRPCServer and CGIXMLRPCServer. These 
subclasses serve pydoc-style documentation when you point 
your browser at them - see the examples in the patch 
summary.

> Should it go into Tools, or into Lib, or into some
> existing module?

The attached file should go into Lib.

> If this goes into Lib somewhere, it lacks documentation.

Fair enough. Conditional on me writing documentation, is this 
contribution acceptable as is?


----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-03-30 06:59

Message:
Logged In: YES 
user_id=21627

I'm not sure how to place this. Is this an extension to
pydoc? Should it go into Tools, or into Lib, or into some
existing module?

If this goes into Lib somewhere, it lacks documentation.

----------------------------------------------------------------------

Comment By: Brian Quinlan (bquinlan)
Date: 2003-02-10 12:25

Message:
Logged In: YES 
user_id=108973

Patch 473586 has been accepted so this patch can be 
accepted.

----------------------------------------------------------------------

Comment By: Brian Quinlan (bquinlan)
Date: 2002-04-04 11:26

Message:
Logged In: YES 
user_id=108973

Sorry, I was sloppy about the description:

This patch is dependant on patch 473586:
[473586] SimpleXMLRPCServer - fixes and CGI

So please don't check this in until that patch is accepted.

----------------------------------------------------------------------

Comment By: Brian Quinlan (bquinlan)
Date: 2002-04-04 09:55

Message:
Logged In: YES 
user_id=108973

Sorry, I was sloppy about the description:

This patch is dependant on patch 473586:
[473586] SimpleXMLRPCServer - fixes and CGI

So please don't check this in until that patch is accepted.

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-04-04 09:31

Message:
Logged In: YES 
user_id=6380

Looks cute to me. Fredrik, any problem if I just check this
in?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=536883&group_id=5470