[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication - PublicationTraverse.py:1.1.2.17

Gary Poster garyposter@earthlink.net
Fri, 17 May 2002 13:16:16 -0400


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

Modified Files:
      Tag: Zope-3x-branch
	PublicationTraverse.py 
Log Message:
1) Fixed some of my own (wrapping) errors in CA and Traversal
2) added IBindingAware interface for services that need to know when they are bound and unbound to a local service manager
3) in subscribables, made event_types into event_type (YAGNI)
4) in subscribables, added ability to unsubscribe per subscription, not just whole-hog
5) in subscribables, added ability to query subscribable for subscriptions of a given subscriber
6) made ISubscribable extremely verbose, to hopefully describe exactly what's going on (see it for more smaller changes)
7) added ISubscriptionAware interface for objects that need to know when they have been subscribed and unsubscribed
8) built out local event service; once there are some views and once I have some more robust tests this *prototype* should by ready to fly.  Note that it is currently a standard service that can be added to any service manager, and thus the design does attempt to address many of the nested service manager issues.
9) as part of this, created the first indirect subscriber (all placeful
subscriptions will usually need to use indirect subscribers in order to retain their context when events are fired): PathSubscriber
10) removed an endless loop between local service managers and  ZopeSecurityPolicy in which both needed the other to function: ZopeSecurityPolicy now explicitly asks for adapters from the global service manager
11) unintentionally retained some of the "default=ComponentLookupError"-type argument signatures from my sandbox, but only within Container and Folder; I won't worry about undoing it though (unless I am otherwise requested) since it seems these interfaces are due for a dict-like overhaul anyway.

Also, if anyone needs a local event service setup for other tests (like the ObjectHub, for instance) see the LocalEventService/tests/EventSetup.py

more tests on the way for the local event service, and for the changes to the subscribable interface



=== Zope3/lib/python/Zope/App/ZopePublication/PublicationTraverse.py 1.1.2.16 => 1.1.2.17 ===
      import ApplicationController
 from Zope.Proxy.ProxyIntrospection import removeAllProxies
+from Zope.ComponentArchitecture.Exceptions import ComponentLookupError
 
 class DuplicateNamespaces(Exception):
     """More than one namespace was specified in a request"""
@@ -133,16 +134,11 @@
 
         if name != 'Services':
             raise NotFound(ob, name, request)
-            
         
-        method_name = "getServiceManager"
-        method = getattr(ob, method_name, self)
-        if method is self: 
+        try:
+            return ob.getServiceManager()
+        except AttributeError, ComponentLookupError:
             raise NotFound(ob, name, request)
-        # Check access
-        self._wrap(method, ob, name, name)
-
-        return method()
 
     def __etcApplicationController(self):
         return ApplicationController
@@ -168,9 +164,7 @@
                         ob2 =  adapter.publishTraverse(request, name)
                     else:
                         raise NotFound(ob, name, request)
-                # the only difference--is this the best way to
-                # accomplish the wrap we want?
-                return self._wrap(ob2, origOb, name, name)
+                return ob2
                 
             except NotFound:
                 ob = getWrapperContext(ob)
@@ -181,7 +175,7 @@
     def _traversecreate(self, request, ob, name): 
         for addable in getService(ob,'AddableContent').getAddables(ob):
             if addable.id == name:
-                return self._wrap(addable, ob, name, name)
+                return addable
         raise NotFound(ob, name, request)