[Zope3-checkins] CVS: Zope3/src/zope/server/interfaces - vfs.py:1.1.2.2

Guido van Rossum guido@python.org
Mon, 23 Dec 2002 16:30:26 -0500


Update of /cvs-repository/Zope3/src/zope/server/interfaces
In directory cvs.zope.org:/tmp/cvs-serv11120

Modified Files:
      Tag: NameGeddon-branch
	vfs.py 
Log Message:
Moved things around again.


=== Zope3/src/zope/server/interfaces/vfs.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/server/interfaces/vfs.py:1.1.2.1	Mon Dec 23 14:33:22 2002
+++ Zope3/src/zope/server/interfaces/vfs.py	Mon Dec 23 16:30:26 2002
@@ -18,80 +18,10 @@
 
 from zope.interface import Interface
 
-class IWriteFileSystem(Interface):
-    """We want to provide a complete wrapper around any and all write
-       filesystem operations.
-
-       Notes:
-         - A file system should *not* store any state!
-         - Most of the commands copy the functionality given in os.
-    """
-
-    def mkdir(path, mode=777):
-        """Create a directory.
-        """
-
-    def remove(path):
-        """Remove a file. Same as unlink.
-        """
-
-    def rmdir(path):
-        """Remove a directory.
-        """
-
-    def rename(old, new):
-        """Rename a file or directory.
-        """
-
-    def writefile(path, mode, instream, start=0):
-        """Write data to a file.
-        """
-
-    def check_writable(path):
-        """Ensures a path is writable.  Throws an IOError if not."""
-
-
-
-"""
-
-$Id$
-"""
-
-from zope.interface import Interface
-
-# XXX This interface should be in a more central location.
-
-class IFilesystemAccess(Interface):
-    """Provides authenticated access to a filesystem.
-    """
-
-    def authenticate(credentials):
-        """Verifies filesystem access based on the presented credentials.
-
-        Should raise Unauthorized if the user can not be authenticated.
-
-        This method only checks general access and is not used for each
-        call to open().  Rather, open() should do its own verification.
-        """
-
-    def open(credentials):
-        """Returns an IReadFilesystem or IWriteFilesystem.
-
-        Should raise Unauthorized if the user can not be authenticated.
-        """
-
-
-"""
-
-$Id$
-"""
-
-from zope.interface import Interface
 
 # XXX These interfaces should be located in a more central location.
 # (so I don't mind putting them together in one module for now ;-) )
 
-
 class ICredentials(Interface):
     """Base interface for presentation of authentication credentials.
 
@@ -114,49 +44,28 @@
         """
 
 
+# XXX This interface should be in a more central location.
 
-"""
-
-$Id$
-"""
-
-
-
-
-
-class IPosixFileSystem(IWriteFileSystem, IReadFileSystem):
-    """
+class IFilesystemAccess(Interface):
+    """Provides authenticated access to a filesystem.
     """
 
-    def chmod(path, mode):
-        """Change the access permissions of a file.
-        """
+    def authenticate(credentials):
+        """Verifies filesystem access based on the presented credentials.
 
-    def chown(path, uid, gid):
-        """Change the owner and group id of path to numeric uid and gid.
-        """
+        Should raise Unauthorized if the user can not be authenticated.
 
-    def link(src, dst):
-        """Create a heard link to a file.
+        This method only checks general access and is not used for each
+        call to open().  Rather, open() should do its own verification.
         """
 
-    def mkfifo(path, mode=777):
-        """Create a FIFO (a POSIX named pipe).
-        """
+    def open(credentials):
+        """Returns an IReadFilesystem or IWriteFilesystem.
 
-    def symlink(src, dst):
-        """Create a symbolic link at dst pointing to src.
+        Should raise Unauthorized if the user can not be authenticated.
         """
 
 
-
-"""
-
-$Id$
-"""
-
-from zope.interface import Interface
-
 class IReadFileSystem(Interface):
     """We want to provide a complete wrapper around any and all read
        filesystem operations.
@@ -200,4 +109,62 @@
         """Return the equivalent of os.stat() on the given path:
 
            (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime)
+        """
+
+
+class IWriteFileSystem(Interface):
+    """We want to provide a complete wrapper around any and all write
+       filesystem operations.
+
+       Notes:
+         - A file system should *not* store any state!
+         - Most of the commands copy the functionality given in os.
+    """
+
+    def mkdir(path, mode=777):
+        """Create a directory.
+        """
+
+    def remove(path):
+        """Remove a file. Same as unlink.
+        """
+
+    def rmdir(path):
+        """Remove a directory.
+        """
+
+    def rename(old, new):
+        """Rename a file or directory.
+        """
+
+    def writefile(path, mode, instream, start=0):
+        """Write data to a file.
+        """
+
+    def check_writable(path):
+        """Ensures a path is writable.  Throws an IOError if not."""
+
+
+class IPosixFileSystem(IWriteFileSystem, IReadFileSystem):
+    """
+    """
+
+    def chmod(path, mode):
+        """Change the access permissions of a file.
+        """
+
+    def chown(path, uid, gid):
+        """Change the owner and group id of path to numeric uid and gid.
+        """
+
+    def link(src, dst):
+        """Create a heard link to a file.
+        """
+
+    def mkfifo(path, mode=777):
+        """Create a FIFO (a POSIX named pipe).
+        """
+
+    def symlink(src, dst):
+        """Create a symbolic link at dst pointing to src.
         """