[Zope-CVS] CVS: Products/AdaptableStorage/gateway_fs - FSDirectoryItems.py:1.7

Shane Hathaway shane@zope.com
Tue, 10 Dec 2002 15:35:57 -0500


Update of /cvs-repository/Products/AdaptableStorage/gateway_fs
In directory cvs.zope.org:/tmp/cvs-serv9744/gateway_fs

Modified Files:
	FSDirectoryItems.py 
Log Message:
Since the keychain is not stored by FolderItems, it doesn't need to be
passed back and forth.  Simplified both FolderItems and FSDirectoryItems
by removing keychain from the schema, then added FolderItemsByKeychain
which *does* store the keychain.


=== Products/AdaptableStorage/gateway_fs/FSDirectoryItems.py 1.6 => 1.7 ===
--- Products/AdaptableStorage/gateway_fs/FSDirectoryItems.py:1.6	Mon Dec  9 13:25:27 2002
+++ Products/AdaptableStorage/gateway_fs/FSDirectoryItems.py	Tue Dec 10 15:35:57 2002
@@ -28,7 +28,6 @@
 
     schema = RowSequenceSchema()
     schema.addField('id', 'string', 1)
-    schema.addField('keychain', 'keychain', 0)
 
     def __init__(self, fs_conn):
         self.fs_conn = fs_conn
@@ -42,25 +41,16 @@
         assert c.readNodeType(p) == 'd'
         names = c.readData(p)
         names.sort()
-        res = []
-        for name in names:
-            subk = event.makeKeychain(name, 0)
-            res.append((name, subk))
-        res.sort()
-        res = tuple(res)
+        res = tuple([(name,) for name in names])
         return res, res
 
-
     def store(self, event, state):
         p = event.getKeychain()[-1]
         c = self.fs_conn
         c.writeNodeType(p, 'd')
-        names = []
         state = list(state)
         state.sort()
-        for name, subkeychain in state:
-            names.append(name)
-            assert subkeychain == event.makeKeychain(name, 0)
+        names = [row[0] for row in state]
         c.writeData(p, names)
         return tuple(state)