[Zope3-checkins] CVS: Zope3/src/zope/app/publication - xmlrpc.py:1.3

Stephan Richter srichter@cbu.edu
Tue, 14 Jan 2003 15:26:08 -0500


Update of /cvs-repository/Zope3/src/zope/app/publication
In directory cvs.zope.org:/tmp/cvs-serv27559/src/zope/app/publication

Modified Files:
	xmlrpc.py 
Log Message:
Fixed Error Messages handling for XML-RPC.

Also, noone fixed XML-rPC, when the new view stuff landed. I made it 
similar to VFS, but I need to go back and revisit it, since we do not 
need all this power, for example we do not need named views, since there
will always be just one!


=== Zope3/src/zope/app/publication/xmlrpc.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/publication/xmlrpc.py:1.2	Wed Dec 25 09:13:08 2002
+++ Zope3/src/zope/app/publication/xmlrpc.py	Tue Jan 14 15:26:05 2003
@@ -15,9 +15,9 @@
 
 $Id$
 """
-
 from zope.proxy.introspection import removeAllProxies
 from zope.app.publication.http import ZopeHTTPPublication
+from zope.component import queryView
 
 class XMLRPCPublication(ZopeHTTPPublication):
     """XML-RPC publication handling.
@@ -28,12 +28,15 @@
     def traverseName(self, request, ob, name):
 
         naked_ob = removeAllProxies(ob)
+        view = queryView(ob, 'methods', request, self)
+
         if hasattr(ob, name):
             return getattr(ob, name)
+        if view is not self and hasattr(view, name):
+            return getattr(view, name)
         else:
             return super(XMLRPCPublication, self).traverseName(request,
                                                                ob, name)
-
 
 # For now, have a factory that returns a singleton
 class XMLRPCPublicationFactory: