[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Folder - Folder.py:1.1.2.2
Kapil
k_vertigo@yahoo.com
Fri, 8 Feb 2002 15:50:07 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Folder
In directory cvs.zope.org:/tmp/cvs-serv9103
Modified Files:
Tag: Zope-3x-branch
Folder.py
Log Message:
added in service manager container interface and implementation for folder
=== Zope3/lib/python/Zope/App/OFS/Folder/Folder.py 1.1.2.1 => 1.1.2.2 ===
import IAttributeRolePermissionManageable
+from Zope.ComponentArchitecture.IServiceManagerContainer import \
+ IServiceManagerContainer
-class IFolder(IContainer):
+class IFolder(IContainer, IServiceManagerContainer):
"""The standard Zope Folder object interface."""
_RAISE_KEYERROR = []
@@ -19,14 +21,20 @@
class Folder(Persistence.Persistent):
"""The standard Zope Folder implementation."""
- __implements__ = IFolder, IAttributeRolePermissionManageable
+ __implements__ = (
+ IFolder,
+ IAttributeRolePermissionManageable,
+ )
+
+ _service_manager = None
def __init__(self):
# XXX - fix this to use a btree when persistence is online.
self.data = {}
def objectIds(self):
- """Return a sequence-like object containing the names associated
+ """Return a sequence-like object containing the names
+associated
with the objects that appear in the folder."""
return self.data.keys()
@@ -41,7 +49,8 @@
return self.data.items()
def getObject(self, name, default=_RAISE_KEYERROR):
- """Return the named object, or the value of the default argument
+ """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)
@@ -68,6 +77,12 @@
self.data = self.data # Signal a change to Persistence
del self.data[name]
-
+ def getServiceManager(self):
+ """Returns the service manager contained in this object."""
+ return self._service_manager
+
+ def setServiceManager(self, sm):
+ """Sets the service manager for this object."""
+ self._service_manager = sm