[Zope-CVS] CVS: Products/Ape/lib/apelib/fs - base.py:1.5.2.1 connection.py:1.5.2.1 security.py:1.2.6.1 structure.py:1.4.2.1

Shane Hathaway shane at zope.com
Fri Dec 19 21:53:19 EST 2003


Update of /cvs-repository/Products/Ape/lib/apelib/fs
In directory cvs.zope.org:/tmp/cvs-serv5534/fs

Modified Files:
      Tag: ape-0_8-branch
	base.py connection.py security.py structure.py 
Log Message:
Cleaned up to the point that ApelibImplTests pass.


=== Products/Ape/lib/apelib/fs/base.py 1.5 => 1.5.2.1 ===
--- Products/Ape/lib/apelib/fs/base.py:1.5	Wed Jul 30 17:33:02 2003
+++ Products/Ape/lib/apelib/fs/base.py	Fri Dec 19 21:52:48 2003
@@ -33,5 +33,5 @@
     def getConnection(self, event):
         return event.getConnection(self.conn_name)
 
-    def getSources(self, event):
+    def getPollSources(self, event):
         return None


=== Products/Ape/lib/apelib/fs/connection.py 1.5 => 1.5.2.1 ===
--- Products/Ape/lib/apelib/fs/connection.py:1.5	Mon Sep 22 07:15:36 2003
+++ Products/Ape/lib/apelib/fs/connection.py	Fri Dec 19 21:52:48 2003
@@ -19,8 +19,7 @@
 import re
 from types import StringType
 
-from apelib.core.interfaces import ITPCConnection, ISourceRepository
-from apelib.core.exceptions import NoStateFoundError
+from apelib.core.interfaces import ITPCConnection, ISourceRepository, LoadError
 from interfaces import IFSConnection
 from exceptions import FSWriteError
 from cache import ShortLivedCache
@@ -217,7 +216,7 @@
     def readNodeType(self, subpath):
         path = self._expandPath(subpath)
         if not self.ops.exists(path):
-            raise NoStateFoundError(subpath)
+            raise LoadError("%s does not exist" % path)
         return self.ops.isdir(path) and 'd' or 'f'
 
 
@@ -584,7 +583,7 @@
         return {(self, paths): t}
 
 
-    def freshen(self, sources):
+    def poll(self, sources):
         """ISourceRepository implementation.
 
         Returns the changed items.


=== Products/Ape/lib/apelib/fs/security.py 1.2 => 1.2.6.1 ===
--- Products/Ape/lib/apelib/fs/security.py:1.2	Tue Apr 29 18:11:50 2003
+++ Products/Ape/lib/apelib/fs/security.py	Fri Dec 19 21:52:48 2003
@@ -16,9 +16,8 @@
 $Id$
 """
 
-from apelib.core.interfaces import IGateway
+from apelib.core.interfaces import IGateway, MappingError
 from apelib.core.schemas import RowSequenceSchema
-from apelib.core.exceptions import MappingError
 from params import stringToParams, paramsToString
 
 from base import FSGatewayBase


=== Products/Ape/lib/apelib/fs/structure.py 1.4 => 1.4.2.1 ===
--- Products/Ape/lib/apelib/fs/structure.py:1.4	Wed Jul 30 17:33:02 2003
+++ Products/Ape/lib/apelib/fs/structure.py	Fri Dec 19 21:52:48 2003
@@ -42,7 +42,7 @@
 
     def load(self, event):
         c = self.getConnection(event)
-        p = event.getKey()
+        p = event.oid
         assert c.readNodeType(p) == 'f'
         state = c.readData(p, as_text=self.text)
         return state, state
@@ -51,7 +51,7 @@
         if not isinstance(state, StringType):
             raise ValueError('Not a string: %s' % repr(state))
         c = self.getConnection(event)
-        p = event.getKey()
+        p = event.oid
         c.writeNodeType(p, 'f')
         c.writeData(p, state, as_text=self.text)
         return state
@@ -65,7 +65,7 @@
     schema = FieldSchema('id', 'string')
 
     def getIdFrom(self, event):
-        path = event.getKey()
+        path = event.oid
         pos = path.rfind('/')
         if pos >= 0:
             return path[pos + 1:]
@@ -82,10 +82,9 @@
             raise ValueError('Mismatched file ID')
         return id
 
-    def getSources(self, event):
+    def getPollSources(self, event):
         fs_conn = self.getConnection(event)
-        return fs_conn.getSources(event.getKey())
-        
+        return fs_conn.getPollSources(event.oid)
 
 
 class FSDirectoryItems (FSGatewayBase):
@@ -95,33 +94,33 @@
 
     schema = RowSequenceSchema()
     schema.addField('id', 'string', 1)
-    schema.addField('keychain', 'keychain')
+    schema.addField('oid', 'string')
 
     def load(self, event):
-        p = event.getKey()
+        p = event.oid
         c = self.getConnection(event)
         assert c.readNodeType(p) == 'd'
         names = c.readData(p)
         names.sort()
         res = []
         for name in names:
-            keychain = event.makeKeychain(name, 0)
-            res.append((name, keychain))
+            oid = event.conf.oid_gen.new_oid(event, name, False)
+            res.append((name, oid))
         res = tuple(res)
         return res, res
 
     def store(self, event, state):
-        p = event.getKey()
+        p = event.oid
         c = self.getConnection(event)
         c.writeNodeType(p, 'd')
         state = list(state)
         state.sort()
         if __debug__:
-            for name, keychain in state:
-                expect = event.makeKeychain(name, 0)
-                assert expect == keychain, (
-                    "Child of %s named %s must use keychain %s, but used %s" %
-                    (event.getKeychain(), name, expect, keychain))
+            for name, oid in state:
+                expect = event.conf.oid_gen.new_oid(event, name, False)
+                assert expect == oid, (
+                    "Child of %s named %s must use OID %s, but used %s" %
+                    (event.oid, name, expect, oid))
         names = [row[0] for row in state]
         c.writeData(p, names)
         return tuple(state)
@@ -135,7 +134,7 @@
     schema = FieldSchema('mtime', 'int')
 
     def load(self, event):
-        p = event.getKey()
+        p = event.oid
         fs_conn = self.getConnection(event)
         state = long(fs_conn.getModTime(p))
         return state, None  # Use None as the hash (see store())




More information about the Zope-CVS mailing list