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

Shane Hathaway shane@cvs.zope.org
Wed, 24 Apr 2002 11:37:57 -0400


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

Modified Files:
      Tag: Zope-3x-branch
	PublisherFileSystem.py 
Log Message:
Fixed most of the Windows test failures.  Used the posixpath module instead of
os.path where appropriate.  (Yay WINE! :-) )


=== Zope3/lib/python/Zope/Server/VFS/PublisherFileSystem.py 1.1.4.1 => 1.1.4.2 ===
 """
 
-import os, re
+import re
 import stat
 import time
+import posixpath
 
 from cStringIO import StringIO
 
@@ -79,7 +80,7 @@
         path = self.translate(path)
         if path == '/':
             return 1
-        path, file = os.path.split(path)
+        path, file = posixpath.split(path)
         env = {'name': file}
         return self._execute(path, 'exists', env)
 
@@ -129,7 +130,7 @@
     def mkdir(self, path, mode=777):
         'See Zope.Server.VFS.IWriteFileSystem.IWriteFileSystem'
         path = self.translate(path)
-        path, dir = os.path.split(path)
+        path, dir = posixpath.split(path)
         env = {'name': dir}
         return self._execute(path, 'mkdir', env)
 
@@ -137,7 +138,7 @@
     def remove(self, path):
         'See Zope.Server.VFS.IWriteFileSystem.IWriteFileSystem'
         path = self.translate(path)
-        path, name = os.path.split(path)
+        path, name = posixpath.split(path)
         env = {'name': name}
         return self._execute(path, 'remove', env)
 
@@ -145,7 +146,7 @@
     def rmdir(self, path):
         'See Zope.Server.VFS.IWriteFileSystem.IWriteFileSystem'
         path = self.translate(path)
-        path, dir = os.path.split(path)
+        path, dir = posixpath.split(path)
         env = {'name': dir}
         return self._execute(path, 'rmdir', env)
 
@@ -154,8 +155,8 @@
         'See Zope.Server.VFS.IWriteFileSystem.IWriteFileSystem'
         old = self.translate(old)
         new = self.translate(new)
-        path0, old = os.path.split(old)
-        path1, new = os.path.split(new)
+        path0, old = posixpath.split(old)
+        path1, new = posixpath.split(new)
         assert path0 == path1
         env = {'old' : old,
                'new' : new}
@@ -164,7 +165,7 @@
     def writefile(self, path, mode, instream, start=0):
         'See Zope.Server.VFS.IWriteFileSystem.IWriteFileSystem'
         path = self.translate(path)
-        path, name = os.path.split(path)
+        path, name = posixpath.split(path)
         env = {'name'      : name,
                'mode'      : mode,
                'instream'  : instream,
@@ -175,7 +176,7 @@
     def check_writable(self, path):
         'See Zope.Server.VFS.IWriteFileSystem.IWriteFileSystem'
         path = self.translate(path)
-        path, name = os.path.split(path)
+        path, name = posixpath.split(path)
         env = {'name'      : name}
         return self._execute(path, 'check_writable', env)
 
@@ -186,7 +187,7 @@
 
     def translate (self, path):
         # Normalize
-        path = os.path.normpath(path)
+        path = posixpath.normpath(path)
         if path.startswith('..'):
             # Someone is trying to get lower than the permitted root.
             # We just ignore it.