[Zope-CVS] CVS: Products/AdaptableStorage/serial_std - FixedPersistentMapping.py:1.3 MappingGateway.py:1.2

Shane Hathaway shane@zope.com
Fri, 6 Dec 2002 17:07:21 -0500


Update of /cvs-repository/Products/AdaptableStorage/serial_std
In directory cvs.zope.org:/tmp/cvs-serv8198/serial_std

Modified Files:
	FixedPersistentMapping.py MappingGateway.py 
Log Message:
Experiment: removed mapper_name from OIDs, with the intent of allowing
loading and storage by different mappers depending on what the classifier
specifies.  Not yet complete.  Involved changes to virtually every module. :-)

I may decide to revert this.  The shane-before-mapper-name-removal tag
was added just before this checkin.


=== Products/AdaptableStorage/serial_std/FixedPersistentMapping.py 1.2 => 1.3 ===
--- Products/AdaptableStorage/serial_std/FixedPersistentMapping.py:1.2	Wed Dec  4 23:18:08 2002
+++ Products/AdaptableStorage/serial_std/FixedPersistentMapping.py	Fri Dec  6 17:06:51 2002
@@ -23,7 +23,7 @@
     __implements__ = IAspectSerializer
 
     def __init__(self, map):
-        # map: { name -> (mapper_name, key) }
+        # map: { name -> keychain }
         self.map = map
 
     def getSchema(self):
@@ -37,9 +37,9 @@
         assert names == expected, '%s != %s' % (names, expected)
 
         for name in names:
-            mapper_name, key = self.map[name]
+            keychain = self.map[name]
             subob = object[name]
-            event.notifySerializedRef(name, subob, 0, mapper_name, key)
+            event.notifySerializedRef(name, subob, 0, keychain)
 
         # One of the two will work. ;-)
         event.ignoreAttribute('data')
@@ -49,8 +49,8 @@
     def deserialize(self, object, event, state):
         assert state is None
         data = {}
-        for name, (mapper_name, key) in self.map.items():
-            subob = event.dereference(name, mapper_name=mapper_name, key=key)
+        for name, keychain in self.map.items():
+            subob = event.dereference(name, keychain)
             data[name] = subob
         # The PersistentMapping doesn't have its data or _container
         # attribute yet, and we don't know what its name should be


=== Products/AdaptableStorage/serial_std/MappingGateway.py 1.1 => 1.2 ===
--- Products/AdaptableStorage/serial_std/MappingGateway.py:1.1	Wed Nov 27 13:37:07 2002
+++ Products/AdaptableStorage/serial_std/MappingGateway.py	Fri Dec  6 17:06:51 2002
@@ -32,11 +32,11 @@
     def getSchema(self):
         return self.schema
 
-    def load(self, object_mapper, key):
+    def load(self, object_mapper, keychain):
         # Returns (data, serial)
-        return self.data[key]
+        return self.data[keychain]
 
-    def store(self, object_mapper, key, data):
+    def store(self, object_mapper, keychain, data):
         serial = time.time()
-        self.data[key] = (data, serial)
+        self.data[keychain] = (data, serial)
         return serial