[Zope3-checkins] CVS: Zope3/src/zope/app - copypastemove.py:1.10 zapi.py:1.6

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


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

Modified Files:
	copypastemove.py zapi.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/copypastemove.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/copypastemove.py:1.9	Tue Jun  3 11:33:55 2003
+++ Zope3/src/zope/app/copypastemove.py	Fri Jun 13 13:41:10 2003
@@ -17,7 +17,7 @@
 $Id$
 """
 
-from zope.app.traversing import getParent, objectName, getPath
+from zope.app.traversing import getParent, getName, getPath
 from zope.component import getAdapter, queryAdapter
 from zope.app.interfaces.copypastemove import IObjectMover
 from zope.app.interfaces.copypastemove import IObjectCopier
@@ -51,7 +51,7 @@
 
         obj = self.context
         container = getParent(obj)
-        orig_name = objectName(obj)
+        orig_name = getName(obj)
         if new_name is None:
             new_name = orig_name
 
@@ -96,7 +96,7 @@
         '''
         obj = self.context
         if name is None:
-            name = objectName(obj)
+            name = getName(obj)
         pastetarget = getAdapter(target, IPasteTarget)
         return pastetarget.acceptsObject(name, obj)
 
@@ -120,7 +120,7 @@
         """
         obj = self.context
         container = getParent(obj)
-        orig_name = objectName(obj)
+        orig_name = getName(obj)
         if new_name is None:
             new_name = orig_name
 
@@ -159,7 +159,7 @@
         '''
         obj = self.context
         if name is None:
-            name = objectName(obj)
+            name = getName(obj)
         pastetarget = getAdapter(target, IPasteTarget)
         return pastetarget.acceptsObject(name, obj)
 
@@ -184,7 +184,7 @@
         """
         obj = self.context
         container = getParent(obj)
-        orig_name = objectName(obj)
+        orig_name = getName(obj)
         if new_name is None:
             new_name = orig_name
 


=== Zope3/src/zope/app/zapi.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/zapi.py:1.5	Tue Jun  3 15:50:02 2003
+++ Zope3/src/zope/app/zapi.py	Fri Jun 13 13:41:10 2003
@@ -30,11 +30,4 @@
 from zope.app.context import *
 from zope.app.traversing import *
 
-def name(obj):
-    data = getWrapperData(obj)
-    if data:
-        return data.get('name')
-    else:
-        return None
-
-    
+name = getName