[Checkins] SVN: zope.location/trunk/ backed out changes concerning the getParent cleanup which got its feature branch

Thomas Lotze tl at gocept.com
Wed Sep 23 13:51:01 EDT 2009


Log message for revision 104462:
  backed out changes concerning the getParent cleanup which got its feature branch

Changed:
  U   zope.location/trunk/CHANGES.txt
  U   zope.location/trunk/src/zope/location/interfaces.py
  U   zope.location/trunk/src/zope/location/traversing.py

-=-
Modified: zope.location/trunk/CHANGES.txt
===================================================================
--- zope.location/trunk/CHANGES.txt	2009-09-23 17:48:54 UTC (rev 104461)
+++ zope.location/trunk/CHANGES.txt	2009-09-23 17:51:00 UTC (rev 104462)
@@ -2,11 +2,10 @@
 CHANGES
 =======
 
-3.7.0 (unreleased)
+3.6.1 (unreleased)
 ------------------
 
-- Added getParent() to ILocationInfo and moved the actual implementation here
-  from zope.traversal.api, analogous to getParents().
+- ...
 
 - Actually removed deprecated PathPersistent class from
   zope.location.pickling.

Modified: zope.location/trunk/src/zope/location/interfaces.py
===================================================================
--- zope.location/trunk/src/zope/location/interfaces.py	2009-09-23 17:48:54 UTC (rev 104461)
+++ zope.location/trunk/src/zope/location/interfaces.py	2009-09-23 17:51:00 UTC (rev 104462)
@@ -75,15 +75,6 @@
 
         """
 
-    def getParent():
-        """Returns the container the object was traversed via.
-
-        Returns None if the object is a containment root.
-        Raises TypeError if the object doesn't have enough context to get the
-        parent.
-
-        """
-
     def getParents():
         """Returns a list starting with the object's parent followed by
         each of its parents.

Modified: zope.location/trunk/src/zope/location/traversing.py
===================================================================
--- zope.location/trunk/src/zope/location/traversing.py	2009-09-23 17:48:54 UTC (rev 104461)
+++ zope.location/trunk/src/zope/location/traversing.py	2009-09-23 17:51:00 UTC (rev 104462)
@@ -160,38 +160,6 @@
 
         raise TypeError("Not enough context to determine location root")
 
-    def getParent(self):
-        """Returns the container the object was traversed via.
-
-        Returns None if the object is a containment root.
-        Raises TypeError if the object doesn't have enough context to get the
-        parent.
-
-        >>> root = Location()
-        >>> zope.interface.directlyProvides(root, IRoot)
-        >>> o1 = Location()
-        >>> o2 = Location()
-
-        >>> LocationPhysicallyLocatable(o2).getParent() # doctest: +ELLIPSIS
-        Traceback (most recent call last):
-        TypeError: ('Not enough context information to get parent', <zope.location.location.Location object at 0x...>)
-
-        >>> o1.__parent__ = root
-        >>> LocationPhysicallyLocatable(o1).getParent() == root
-        True
-
-        >>> o2.__parent__ = o1
-        >>> LocationPhysicallyLocatable(o2).getParent() == o1
-        True
-
-        """
-        parent = getattr(self.context, '__parent__', None)
-        if parent is not None:
-            return parent
-
-        raise TypeError('Not enough context information to get parent',
-                        self.context)
-
     def getParents(self):
         """Returns a list starting with the object's parent followed by
         each of its parents.
@@ -335,19 +303,6 @@
         """
         return u''
 
-    def getParent(self):
-        """Returns the container the object was traversed via.
-
-        Returns None if the object is a containment root.
-        Raises TypeError if the object doesn't have enough context to get the
-        parent.
-
-        >>> o1 = object()
-        >>> RootPhysicallyLocatable(o1).getParent()
-
-        """
-        return None
-
     def getParents(self):
         """See ILocationInfo
 



More information about the checkins mailing list