[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Folder - Folder.py:1.1.2.9 LoadedFolder.py:1.1.4.3

Gary Poster garyposter@earthlink.net
Mon, 22 Apr 2002 15:03:50 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Folder
In directory cvs.zope.org:/tmp/cvs-serv31509/App/OFS/Folder

Modified Files:
      Tag: Zope-3x-branch
	Folder.py LoadedFolder.py 
Log Message:
1. As per ZopeTop discussion, moved Addable out of ZMI into the Services folder, and turned it into a true service (this involved a lot of small changes, particularly in the folders and a number of tests) and gave it some hooks
2. used SteveA's ContextWrapper.ContextMethod to make the ServiceManager and Services placefully look up to parent placeful equivalents
3. Made Event into a more standard service, and gave it some hooks
4. Built the beginning of a placeful EventService (will need tests, and views, and EventChannels, and more meat; just wanted to check this in for now)
5. made it so you can't add an item to a folder with a blank string id, and updated the folder interface
6. some typos fixed here and there
7. a few more tests here and there

I'm checking this in then checking it out again to check my work; also tagged previous version as gary-service_update.



=== Zope3/lib/python/Zope/App/OFS/Folder/Folder.py 1.1.2.8 => 1.1.2.9 ===
 from Zope.ComponentArchitecture.IServiceManagerContainer import \
      IServiceManagerContainer
+from types import StringTypes
 
 _marker = object()
 
@@ -79,6 +80,8 @@
 
     def setObject(self, name, object):
         """Add the given object to the folder under the given name."""
+        if type(name) in StringTypes and len(name)==0:
+            raise ValueError
         self.data[name] = object
 
     def delObject(self, name):


=== Zope3/lib/python/Zope/App/OFS/Folder/LoadedFolder.py 1.1.4.2 => 1.1.4.3 ===
 from FolderLimit import FolderLimit, FolderLimitExeededError
 from OrderedFolder import OrderedFolder
+from types import StringTypes
 
 
 class ILoadedFolder(IFolder):
@@ -88,6 +89,8 @@
 
     def setObject(self, name, object):
         """Add the given object to the folder under the given name."""
+        if type(name) in StringTypes and len(name)==0:
+            raise ValueError
         if self.isLimitReached():
             raise FolderLimitExeededError, 'The folder\'s limit was exeeded.' 
         else: