[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Container/Views/VFS - VFSContainerView.py:1.1.2.2

Stephan Richter srichter@cbu.edu
Tue, 9 Apr 2002 20:23:32 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Container/Views/VFS
In directory cvs.zope.org:/tmp/cvs-serv17043/lib/python/Zope/App/OFS/Container/Views/VFS

Modified Files:
      Tag: Zope3-Server-Branch
	VFSContainerView.py 
Log Message:
This check-in makes the Publisher FTP Server finally work. Yipee!
Everything worked out much better than I hope and my protyping turned out
to be an overkill. Now it is time to clean up some things and complete the
code. Things that need to be done:

1. Finish File view, so that read and write can be supported.
2. Implement security. Right now it allows any username/password pair.
3. Fix bugs and remove debugging statements.
4. Write tests.


=== Zope3/lib/python/Zope/App/OFS/Container/Views/VFS/VFSContainerView.py 1.1.2.1 => 1.1.2.2 ===
     def listdir(self, with_stats=0, pattern='*'):
         'See Zope.Publisher.VFS.IVFSDirectoryPublisher.IVFSDirectoryPublisher'
-        ld = self._container.objectIds()
+        file_list = self._container.objectIds()
         # filter them using the pattern
-        ld = filter(lambda f, p=pattern, fnm=fnmatch.fnmatch: fnm(f, p), ld)
+        file_list = list(
+            filter(lambda f, p=pattern, fnm=fnmatch.fnmatch: fnm(f, p),
+                   file_list))
         # sort them alphabetically
-        ld.sort()
+        file_list.sort()
         if not with_stats:
             result = ld
         else:
             result = []
-            for file in ld:
+            for file in file_list:
                 stat = (16893, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                 if stat is not None:
                     result.append((file, stat))