[Zope-Checkins] CVS: Zope3/lib/python/Zope/Server/VFS - OSFileSystem.py:1.1.2.4
Stephan Richter
srichter@cbu.edu
Tue, 2 Apr 2002 18:25:00 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/Server/VFS
In directory cvs.zope.org:/tmp/cvs-serv4703
Modified Files:
Tag: Zope3-Server-Branch
OSFileSystem.py
Log Message:
IReadFileSystem tests written and passing
=== Zope3/lib/python/Zope/Server/VFS/OSFileSystem.py 1.1.2.3 => 1.1.2.4 ===
import time
+from ListProducer import ListProducer
+
from IReadFileSystem import IReadFileSystem
from IWriteFileSystem import IWriteFileSystem
@@ -47,30 +49,30 @@
def exists(self, path):
'See Zope.Server.VFS.IReadFileSystem.IReadFileSystem'
- p = self.normalize (self.path_module.join (self.wd, path))
- return self.path_module.exists(self.translate(p))
+ p = self.translate(path)
+ return self.path_module.exists(p)
def isdir(self, path):
'See Zope.Server.VFS.IReadFileSystem.IReadFileSystem'
- p = self.normalize(self.path_module.join (self.wd, path))
- return self.path_module.isdir(self.translate(p))
+ p = self.translate(path)
+ return self.path_module.isdir(p)
def isfile(self, path):
'See Zope.Server.VFS.IReadFileSystem.IReadFileSystem'
- p = self.normalize(self.path_module.join(self.wd, path))
- return self.path_module.isfile(self.translate(p))
+ p = self.translate(path)
+ return self.path_module.isfile(p)
def listdir(self, path, long=0):
'See Zope.Server.VFS.IReadFileSystem.IReadFileSystem'
- p = self.translate (path)
+ p = self.translate(path)
# I think we should glob, but limit it to the current
# directory only.
ld = os.listdir(p)
if not long:
- return list_producer (ld, 0, None)
+ return ListProducer (ld, 0, None)
else:
old_dir = os.getcwd()
try:
@@ -79,10 +81,10 @@
result = filter(None, map(safe_stat, ld))
finally:
os.chdir (old_dir)
- return list_producer (result, 1, self.longify)
+ return ListProducer (result, 1, self.longify)
- def longify(self, path):
+ def longify(self, (path, stat_info)):
'See Zope.Server.VFS.IReadFileSystem.IReadFileSystem'
return unix_longify (path, stat_info)
@@ -96,7 +98,7 @@
def stat(self, path):
'See Zope.Server.VFS.IReadFileSystem.IReadFileSystem'
p = self.translate(path)
- return os.stat (p)
+ return os.stat(p)
#
############################################################
@@ -210,7 +212,7 @@
def __repr__ (self):
- return '<Unix-Style FS Root:%s CWD:%s>' % (self.root, self.wd)
+ return '<Unix-Style Root:%s>' % self.root
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',