[Zope3-checkins] CVS: Zope3/src/zope/app/content - folder.py:1.15.2.2

Jim Fulton jim at zope.com
Fri Sep 12 15:15:53 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/content
In directory cvs.zope.org:/tmp/cvs-serv13470/src/zope/app/content

Modified Files:
      Tag: parentgeddon-branch
	folder.py 
Log Message:
Can't have the tests passing, can we?

=== Zope3/src/zope/app/content/folder.py 1.15.2.1 => 1.15.2.2 ===
--- Zope3/src/zope/app/content/folder.py:1.15.2.1	Mon Sep  8 14:21:35 2003
+++ Zope3/src/zope/app/content/folder.py	Fri Sep 12 15:15:22 2003
@@ -15,7 +15,6 @@
 from persistence import Persistent
 from zodb.btrees.OOBTree import OOBTree
 from zope.app.content.fssync import DirectoryAdapter
-from zope.app.interfaces.content.folder import ICloneWithoutChildren
 from zope.app.interfaces.content.folder import IFolder, IRootFolder
 from zope.app.interfaces.services.service import ISite
 from zope.app.services.servicecontainer import ServiceManagerContainer
@@ -26,7 +25,7 @@
 class Folder(Persistent, ServiceManagerContainer, Contained):
     """The standard Zope Folder implementation."""
 
-    implements(IFolder, ICloneWithoutChildren)
+    implements(IFolder)
 
     def __init__(self):
         self.data = OOBTree()
@@ -76,7 +75,7 @@
         """Return the number of objects in the folder."""
         return len(self.data)
 
-    def setObject(self, name, object):
+    def __setitem__(self, name, object):
         """Add the given object to the folder under the given name."""
 
         if not (isinstance(name, str) or isinstance(name, unicode)):
@@ -98,15 +97,8 @@
     def __delitem__(self, name):
         """Delete the named object from the folder. Raises a KeyError
            if the object is not found."""
-        uncontained(self.data[name])
+        uncontained(self.data[name], self)
         del self.data[name]
-
-    def cloneWithoutChildren(self):
-        new = self.__class__()
-        for k, v in self.__dict__.items():
-            if k != 'data':
-                new.__dict__[k] = v
-        return new
 
 class RootFolder(Folder):
     """The standard Zope root Folder implementation."""




More information about the Zope3-Checkins mailing list