[Zope3-checkins] CVS: Zope3/src/zope/app/ftp - __init__.py:1.4.26.1

Jim Fulton jim at zope.com
Mon Sep 8 15:22:09 EDT 2003


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

Modified Files:
      Tag: parentgeddon-branch
	__init__.py 
Log Message:
Checking in work in progress on parentgeddon-branch so Fred can help
me to get the tests passing.  Specific log entries will be provided
when we merge this into the head.


=== Zope3/src/zope/app/ftp/__init__.py 1.4 => 1.4.26.1 ===
--- Zope3/src/zope/app/ftp/__init__.py:1.4	Wed May 28 11:46:09 2003
+++ Zope3/src/zope/app/ftp/__init__.py	Mon Sep  8 14:21:38 2003
@@ -27,10 +27,12 @@
 from zope.app.event.objectevent import ObjectCreatedEvent
 
 from zope.app.interfaces.dublincore import IZopeDublinCore
-from zope.app.interfaces.container import IZopeWriteContainer
+from zope.app.interfaces.container import IAddTarget, IRemoveSource
 
 from zope.proxy import removeAllProxies
 
+from zope.app.copypastemove import rename
+
 class FTPView:
 
     def __init__(self, context, request):
@@ -138,25 +140,24 @@
 
     def mkdir(self, name):
         dir = queryAdapter(self.context, IWriteDirectory)
-        dir = getAdapter(dir, IZopeWriteContainer)
+        dir = getAdapter(dir, IAddTarget)
 
         factory = getAdapter(self.context, IDirectoryFactory)
         newdir = factory(name)
         publish(self.context, ObjectCreatedEvent(newdir))
-        dir.setObject(name, newdir)
+        dir.addObject(name, newdir)
 
     def remove(self, name):
         dir = queryAdapter(self.context, IWriteDirectory)
-        dir = getAdapter(dir, IZopeWriteContainer)
-        del dir[name]
+        dir = getAdapter(dir, IRemoveSource)
+        dir.removeObject(name)
 
     def rmdir(self, name):
         self.remove(name)
 
     def rename(self, old, new):
         dir = queryAdapter(self.context, IWriteDirectory)
-        dir = getAdapter(dir, IZopeWriteContainer)
-        dir.rename(old, new)
+        rename(dir, old, new)
 
     def _overwrite(self, name, instream, start=None, end=None, append=False):
         file = self._dir[name]
@@ -207,7 +208,7 @@
             ext = "."
 
         dir = queryAdapter(self.context, IWriteDirectory)
-        dir = getAdapter(dir, IZopeWriteContainer)
+        dir = getAdapter(dir, IAddTarget)
 
         factory = queryNamedAdapter(self.context, IFileFactory, ext)
         if factory is None:
@@ -215,7 +216,7 @@
 
         newfile = factory(name, '', data)
         publish(self.context, ObjectCreatedEvent(newfile))
-        dir.setObject(name, newfile)
+        dir.addObject(name, newfile)
 
     def writable(self, name):
         if name in self._dir:




More information about the Zope3-Checkins mailing list