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

Jim Fulton jim at zope.com
Sat Mar 6 11:50:55 EST 2004


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

Modified Files:
	__init__.py 
Log Message:
Converted most getAdapter calls to use interface calls instead.


=== Zope3/src/zope/app/ftp/__init__.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/ftp/__init__.py:1.6	Mon Mar  1 10:02:51 2004
+++ Zope3/src/zope/app/ftp/__init__.py	Sat Mar  6 11:50:24 2004
@@ -18,7 +18,7 @@
 """
 __metaclass__ = type
 
-from zope.component import queryAdapter, getAdapter, queryNamedAdapter
+from zope.component import queryAdapter, queryNamedAdapter
 from zope.proxy import removeAllProxies
 
 from zope.app.interfaces.file import IReadFile, IWriteFile
@@ -35,7 +35,7 @@
     def __init__(self, context, request):
         self.context = context
         self.request = request
-        self._dir = getAdapter(self.context, IReadDirectory)
+        self._dir = IReadDirectory(self.context)
 
     def publishTraverse(self, request, name):
         return self._dir[name]
@@ -100,7 +100,7 @@
 
     def readfile(self, name, outstream, start = 0, end = None):
         file = self._dir[name]
-        file = getAdapter(file, IReadFile)
+        file = IReadFile(file)
         data = file.read()
         if end is not None:
             data = data[:end]
@@ -115,7 +115,7 @@
         return self._lsinfo(name, self._dir[name])
 
     def _mtime(self, file):
-        dc = getAdapter(file, IZopeDublinCore)
+        dc = IZopeDublinCore(file)
         if dc is not None:
             return dc.modified
 
@@ -137,7 +137,7 @@
 
     def mkdir(self, name):
         dir = queryAdapter(self.context, IWriteDirectory)
-        factory = getAdapter(self.context, IDirectoryFactory)
+        factory = IDirectoryFactory(self.context)
         newdir = factory(name)
         publish(self.context, ObjectCreatedEvent(newdir))
         dir[name] = newdir
@@ -205,7 +205,7 @@
 
         factory = queryNamedAdapter(self.context, IFileFactory, ext)
         if factory is None:
-            factory = getAdapter(self.context, IFileFactory)
+            factory = IFileFactory(self.context)
 
         newfile = factory(name, '', data)
         publish(self.context, ObjectCreatedEvent(newfile))




More information about the Zope3-Checkins mailing list