[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication/XMLRPC - Publication.py:1.3

Stephan Richter srichter@cbu.edu
Sun, 16 Jun 2002 14:40:54 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication/XMLRPC
In directory cvs.zope.org:/tmp/cvs-serv26330/App/ZopePublication/XMLRPC

Modified Files:
	Publication.py 
Log Message:
Okay, someone refactored the entire publisher again!!! This person also 
only cared about updating the browser stuff and not XMLRPC and VFS.
Furthermore, Browser-specific stuff reoccirred in generic directories where
they do not belong. I also found much unused code, like the entire 
AttributePublisher, which seems deprecated! I did not fix the latter two 
problems, since it already took me 9 hours to get the basic XMLRPC running
in the new design. (If you can tell, I am a little aggrevated about this,
since we had it clean before and I wasted a lot of time on it last night!)

So, I would therefore propose a MAJOR Publisher/Publication code cleanup 
where we throw out the unused stuff and put code to the place where it 
belongs. 

I have not even checked the VFS implementation yet to see how bad the 
damage is there...

But afterall, at least XMLRPC works again, and I think I will be able to 
fix VFS too.


=== Zope3/lib/python/Zope/App/ZopePublication/XMLRPC/Publication.py 1.2 => 1.3 ===
 """
 
+from Zope.Proxy.ProxyIntrospection import removeAllProxies
 from Zope.App.ZopePublication.HTTP.Publication import ZopeHTTPPublication
 
 class XMLRPCPublication(ZopeHTTPPublication):
@@ -23,7 +24,16 @@
 
        There is nothing special here right now.
     """
-        
+
+    def traverseName(self, request, ob, name):
+
+        naked_ob = removeAllProxies(ob)
+        if hasattr(ob, name):
+            return getattr(ob, name)
+        else:
+            return super(XMLRPCPublication, self).traverseName(request,
+                                                               ob, name)
+
 
 # For now, have a factory that returns a singleton
 class XMLRPCPublicationFactory: