[Zope-Checkins] CVS: Zope3/lib/python/Zope/Server/VFS - OSFileSystem.py:1.1.2.11 PublisherFileSystem.py:1.1.2.3

Shane Hathaway shane@cvs.zope.org
Fri, 5 Apr 2002 17:53:55 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/Server/VFS
In directory cvs.zope.org:/tmp/cvs-serv22490/VFS

Modified Files:
      Tag: Zope3-Server-Branch
	OSFileSystem.py PublisherFileSystem.py 
Log Message:
listdir() no longer returns a producer, just a string or stream.

=== Zope3/lib/python/Zope/Server/VFS/OSFileSystem.py 1.1.2.10 => 1.1.2.11 ===
 import time
 
-from ListProducer import ListProducer
-
 from IReadFileSystem import IReadFileSystem
 from IWriteFileSystem import IWriteFileSystem
 
@@ -73,22 +71,20 @@
         ld = os.listdir(p)
         ld.sort()
         if not long:
-            return ListProducer (ld, 0, None)
+            result = ld
         else:
-            try:
-                result = []
-                for file in ld:
-                    path = self.path_module.join(p, file)
-                    stat = safe_stat(path)
-                    if stat is not None:
-                        result.append((file, safe_stat(path)))
-            finally:
-                return ListProducer(result, 1, self.longify)
+            result = []
+            for file in ld:
+                path = self.path_module.join(p, file)
+                stat = safe_stat(path)
+                if stat is not None:
+                    result.append(self.longify(file, safe_stat(path)))
+        return '\r\n'.join(result) + '\r\n'
 
 
-    def longify(self, (path, stat_info)):
+    def longify(self, path, stat_info):
         'See Zope.Server.VFS.IReadFileSystem.IReadFileSystem'
-        return unix_longify (path, stat_info)
+        return unix_longify(path, stat_info)
 
 
     def open(self, path, mode):


=== Zope3/lib/python/Zope/Server/VFS/PublisherFileSystem.py 1.1.2.2 => 1.1.2.3 ===
         ld.sort()
         if not long:
-            return ListProducer(ld, 0, None)
+            result = ld
         else:
-            return ListProducer(result, 1, self.longify)
+            result = map(self.longify, ld)
+        return '\r\n'.join(result) + '\r\n'
 
 
     def longify(self, (path, stat_info)):