[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Container - ContainerTraversable.py:1.1.2.6.4.1 IOrderedContainer.py:1.1.2.4.8.1

Steve Alexander steve@cat-box.net
Tue, 4 Jun 2002 08:03:37 -0400


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

Modified Files:
      Tag: Zope3InWonderland-branch
	ContainerTraversable.py IOrderedContainer.py 
Log Message:
some formatting fixes.

Also, created an InsecureMarker class, instances of which don't get
wrapped in a security proxy (i.e. are Rocks), for use in methods where
you want to call a method with a default value, and compare the value
using 'is' later on.


=== Zope3/lib/python/Zope/App/OFS/Container/ContainerTraversable.py 1.1.2.6 => 1.1.2.6.4.1 ===
 from Zope.Exceptions import NotFoundError
 from Zope.ComponentArchitecture.Exceptions import ComponentLookupError
+from Zope.Security.Checker import InsecureMarker
+
+_marker = InsecureMarker()
 
 class ContainerTraversable:
     """Traverses containers via getattr and getObject.
@@ -44,18 +47,18 @@
     def __init__(self, container):
         self._container = container
 
+
     def traverse(self, name, parameters, original_name, furtherPath):
         if parameters:
             raise UnexpectedParameters(parameters)
 
         container = self._container
-
-        # self is just a marker for the rest of this method.
         
-        v = container.getObject(name, self)
-        if v is self:
-            v = getattr(container, name, self)
-            if v is self:            
+        v = container.getObject(name, _marker)
+        if v is _marker:
+            v = getattr(container, name, _marker)
+            if v is _marker:            
                 raise NotFoundError, original_name
 
         return v
+


=== Zope3/lib/python/Zope/App/OFS/Container/IOrderedContainer.py 1.1.2.4 => 1.1.2.4.8.1 ===
 # 
 ##############################################################################
-"""
+"""
   $Id$
-"""
-
-from Interface import Interface
-
-class IReadOrderedContainer(Interface):
-
-
-    def getObjectPosition(id):
-        """Get the position of the object having the id.
-        """
-    
-class IWriteOrderedContainer(Interface):
-
-
-    def moveObjectToPosition(id, position):
-        """Move an object having id to position.
-        """
-        
-
-    def moveObjectsUp(ids):
-        """Move the specified objects (via ids) one field up.
-        """
-
-    
-    def moveObjectsDown(ids):
-        """Move the specified objects (via ids) one field down.
-        """
-
-
-    def moveObjectsToTop(ids):
-        """Move the specified objects (via ids) to the top.
-        """
-
-
-    def moveObjectsToBottom(ids):
-        """Move the specified objects (via ids) to the bottom.
-        """
-
-
-class IOrderedContainer(IReadOrderedContainer, IWriteOrderedContainer):
-    """This interface adds functionality to containers that will allow
-       sorting of the contained items.
-       
-    """
-
+"""
+
+from Interface import Interface
+
+class IReadOrderedContainer(Interface):
+
+
+    def getObjectPosition(id):
+        """Get the position of the object having the id.
+        """
+    
+class IWriteOrderedContainer(Interface):
+
+
+    def moveObjectToPosition(id, position):
+        """Move an object having id to position.
+        """
+        
+
+    def moveObjectsUp(ids):
+        """Move the specified objects (via ids) one field up.
+        """
+
+    
+    def moveObjectsDown(ids):
+        """Move the specified objects (via ids) one field down.
+        """
+
+
+    def moveObjectsToTop(ids):
+        """Move the specified objects (via ids) to the top.
+        """
+
+
+    def moveObjectsToBottom(ids):
+        """Move the specified objects (via ids) to the bottom.
+        """
+
+
+class IOrderedContainer(IReadOrderedContainer, IWriteOrderedContainer):
+    """This interface adds functionality to containers that will allow
+       sorting of the contained items.
+       
+    """
+