[Zope-CVS] CVS: Products/Ape/lib/apelib/fs - properties.py:1.3 structure.py:1.3

Shane Hathaway shane@zope.com
Wed, 9 Jul 2003 11:40:37 -0400


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

Modified Files:
	properties.py structure.py 
Log Message:
Merged ape-newconf-branch.  Mappers are now configured using XML.


=== Products/Ape/lib/apelib/fs/properties.py 1.2 => 1.3 ===
--- Products/Ape/lib/apelib/fs/properties.py:1.2	Tue Apr 29 18:11:50 2003
+++ Products/Ape/lib/apelib/fs/properties.py	Wed Jul  9 11:40:03 2003
@@ -68,7 +68,7 @@
     schema.addField('data', 'string')
 
     def __init__(self, section='properties', conn_name='fs'):
-        self.section = section
+        self.section = str(section)
         FSGatewayBase.__init__(self, conn_name)
 
     def load(self, event):
@@ -111,7 +111,7 @@
     schema = FieldSchema('data', 'string')
 
     def __init__(self, section, conn_name='fs'):
-        self.section = section
+        self.section = str(section)
         FSGatewayBase.__init__(self, conn_name)
 
     def load(self, event):


=== Products/Ape/lib/apelib/fs/structure.py 1.2 => 1.3 ===
--- Products/Ape/lib/apelib/fs/structure.py:1.2	Tue Apr 29 18:11:50 2003
+++ Products/Ape/lib/apelib/fs/structure.py	Wed Jul  9 11:40:03 2003
@@ -33,6 +33,10 @@
     schema = FieldSchema('data', 'string')
 
     def __init__(self, text=0, conn_name='fs'):
+        if text == 'text':
+            text = 1
+        elif text == 'binary':
+            text = 0
         self.text = text
         FSGatewayBase.__init__(self, conn_name)
 
@@ -53,7 +57,6 @@
         return state
 
 
-
 class FSAutoId (FSGatewayBase):
     """Automatic ID gateway based on the key of the item."""
 
@@ -88,6 +91,7 @@
 
     schema = RowSequenceSchema()
     schema.addField('id', 'string', 1)
+    schema.addField('keychain', 'keychain')
 
     def load(self, event):
         p = event.getKey()
@@ -95,7 +99,11 @@
         assert c.readNodeType(p) == 'd'
         names = c.readData(p)
         names.sort()
-        res = tuple([(name,) for name in names])
+        res = []
+        for name in names:
+            keychain = event.makeKeychain(name, 0)
+            res.append((name, keychain))
+        res = tuple(res)
         return res, res
 
     def store(self, event, state):
@@ -104,6 +112,12 @@
         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))
         names = [row[0] for row in state]
         c.writeData(p, names)
         return tuple(state)