[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication - Traversers.py:1.3 ZopePublication.py:1.3
Stephan Richter
srichter@cbu.edu
Sun, 16 Jun 2002 14:40:53 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication
In directory cvs.zope.org:/tmp/cvs-serv26330/App/ZopePublication
Modified Files:
Traversers.py ZopePublication.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/Traversers.py 1.2 => 1.3 ===
from Zope.Publisher.Exceptions import Unauthorized, NotFound, DebugError
from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
+from Zope.Publisher.XMLRPC.IXMLRPCPublisher import IXMLRPCPublisher
from Zope.ComponentArchitecture \
import getView, getDefaultViewName
from Zope.ComponentArchitecture.Exceptions import ComponentLookupError
@@ -20,7 +21,7 @@
class SimpleComponentTraverser:
"""Browser traverser for simple components that can only traverse to views
"""
- __implements__ = IBrowserPublisher
+ __implements__ = IBrowserPublisher, IXMLRPCPublisher
def __init__(self, target, request):
self.target = target
@@ -34,6 +35,7 @@
def publishTraverse(self, request, name):
ob = self.target
+ from Zope.ComponentArchitecture.GlobalViewService import viewService
try:
return getView(ob, name, request)
except ComponentLookupError:
=== Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py 1.2 => 1.3 ===
-class ZopePublication(PublicationTraverse, DefaultPublication):
+class ZopePublication(object, PublicationTraverse, DefaultPublication):
"""Base Zope publication specification."""
version_cookie = 'Zope-Version'