[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Folder - Folder.py:1.1.2.11 folder.zcml:1.1.2.12
Gary Poster
garyposter@earthlink.net
Fri, 17 May 2002 13:16:14 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Folder
In directory cvs.zope.org:/tmp/cvs-serv15153/App/OFS/Folder
Modified Files:
Tag: Zope-3x-branch
Folder.py folder.zcml
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/OFS/Folder/Folder.py 1.1.2.10 => 1.1.2.11 ===
from Zope.App.OFS.Container.Exceptions import UnaddableError
-_marker = object()
-
class IFolder(IContainer, IServiceManagerContainer):
"""The standard Zope Folder object interface."""
-_RAISE_KEYERROR = []
-
class Folder(Persistence.Persistent, ServiceManagerContainer):
"""The standard Zope Folder implementation."""
@@ -61,14 +57,14 @@
"""
return self.data.items()
- def getObject(self, name, default=_RAISE_KEYERROR):
+ def getObject(self, name, default=KeyError):
"""Return the named object, or the value of the default
argument if given and the named object is not found.
If no default is given and the object is not found a
KeyError is raised.
"""
object = self.data.get(name, default)
- if object is _RAISE_KEYERROR:
+ if object is KeyError:
raise KeyError, name
return object
=== Zope3/lib/python/Zope/App/OFS/Folder/folder.zcml 1.1.2.11 => 1.1.2.12 ===
<security:protect
interface="Zope.ComponentArchitecture.IServiceManagerContainer.IReadServiceManagerContainer"
- permission_id="Zope.Public" />
+ permission_id="Zope.Public" />
<security:protect
interface="Zope.ComponentArchitecture.IServiceManagerContainer.IWriteServiceManagerContainer"
- permission_id="Zope.ManageServices" />
+ permission_id="Zope.ManageServices" />
<security:protect
interface="Zope.App.OFS.Container.IContainer.IReadContainer"
permission_id="Zope.View" />