[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces - copypastemove.py:1.6 traversing.py:1.6

Steve Alexander steve@cat-box.net
Fri, 13 Jun 2003 13:41:49 -0400


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

Modified Files:
	copypastemove.py traversing.py 
Log Message:
Removed the @@object_name view, as used in some page templates, and
the ObjectName view and adapter also.
Extended IPhysicallyLocatable with a getName method.
Renamed the convenience function objectName to getName.

If you have page templates that use @@object_name, then you can replace it
with zope:name.



=== Zope3/src/zope/app/interfaces/copypastemove.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/interfaces/copypastemove.py:1.5	Thu Jun 12 07:04:56 2003
+++ Zope3/src/zope/app/interfaces/copypastemove.py	Fri Jun 13 13:41:18 2003
@@ -166,7 +166,7 @@
       def copyableTo(self, target, name=None):
           obj = self.context
           if name is None:
-              name = objectName(obj)
+              name = getName(obj)
           pastetarget = getAdapter(target, IPasteTarget)
           return pastetarget.acceptsObject(name, obj)
 
@@ -175,7 +175,7 @@
       def copy(self, target, name=None):
           obj = self.context
           if name is None:
-              name = objectName(obj)
+              name = getName(obj)
           copysource = getAdapter(getParent(obj), ICopySource)
           obj = copysource.copyObject(name, target)
           pastetarget = getAdapter(target, IPasteTarget)


=== Zope3/src/zope/app/interfaces/traversing.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/interfaces/traversing.py:1.5	Tue Jun  3 15:43:43 2003
+++ Zope3/src/zope/app/interfaces/traversing.py	Fri Jun 13 13:41:18 2003
@@ -37,20 +37,6 @@
         It is not the respoonsibility of the handler to wrap the return value.
         """
 
-class IObjectName(Interface):
-
-    def __str__():
-        """Get a human-readable string representation
-        """
-
-    def __repr__():
-        """Get a string representation
-        """
-
-    def __call__():
-        """Get a string representation
-        """
-
 class IPhysicallyLocatable(Interface):
     """Objects that have a physical location in a containment hierarchy.
     """
@@ -63,6 +49,10 @@
         """Return the physical path to the object as a string.
         """
 
+    def getName():
+        """Return the last segment of the physical path.
+        """
+
 class ITraversable(Interface):
     """To traverse an object, this interface must be provided"""
 
@@ -102,7 +92,7 @@
         'request' is passed in when traversing from presentation code. This
         allows paths like @@foo to work.
         """
- 
+
 class ITraversalAPI(Interface):
     """Common API functions to ease traversal computations
     """
@@ -172,10 +162,8 @@
 
         """
 
-    def objectName(obj):
+    def getName(obj):
         """Get the name an object was traversed via
-
-        Raises TypeError if the object is not context-wrapped
         """
 
     def getParent(obj):
@@ -201,4 +189,4 @@
 
         Raises ValueError if a badly formed path is given.
         """
-    
+