[Zope-CVS] CVS: Products/AdaptableStorage/serial_ofs - FolderItems.py:1.5 MetaTypeClassifier.py:1.6

Shane Hathaway shane@zope.com
Mon, 9 Dec 2002 10:57:55 -0500


Update of /cvs-repository/Products/AdaptableStorage/serial_ofs
In directory cvs.zope.org:/tmp/cvs-serv29307/serial_ofs

Modified Files:
	FolderItems.py MetaTypeClassifier.py 
Log Message:
Tidying:

- Removed domain mapper, which has been folded into object mapper (as I had
  always hoped to do--yay!)

- Removed makeKey from various places, since it now has a less meaningful
  purpose

- Removed classifyObject() from serialization events since it now serves
  no purpose I can think of

- Removed commented code

- Removed IObjectGateway since it now defines nothing more than IGateway

- Switched the order of the arguments for classifyObject() to match the
  order of the other methods

- Corrected and added comments



=== Products/AdaptableStorage/serial_ofs/FolderItems.py 1.4 => 1.5 ===
--- Products/AdaptableStorage/serial_ofs/FolderItems.py:1.4	Sat Dec  7 00:59:13 2002
+++ Products/AdaptableStorage/serial_ofs/FolderItems.py	Mon Dec  9 10:57:24 2002
@@ -35,6 +35,9 @@
     def getSchema(self):
         return self.schema
 
+    def getSubKeychain(self, keychain, name):
+        return keychain[:-1] + ((keychain[-1] + '/%s' % name),)
+
     def serialize(self, object, event):
         assert isinstance(object, ObjectManager)
         state = []
@@ -43,9 +46,7 @@
             base = aq_base(subob)
             keychain = event.identifyObject(base)
             if keychain is None:
-                # XXX this needs to be delegated to something
-                keychain = event.getKeychain()
-                keychain = keychain[:-1] + ((keychain[-1] + '/' + id),)
+                keychain = self.getSubKeychain(event.getKeychain(), id)
             event.notifySerializedRef(id, base, 1, keychain)
             state.append((id, keychain))
         return state


=== Products/AdaptableStorage/serial_ofs/MetaTypeClassifier.py 1.5 => 1.6 ===
--- Products/AdaptableStorage/serial_ofs/MetaTypeClassifier.py:1.5	Sat Dec  7 00:59:13 2002
+++ Products/AdaptableStorage/serial_ofs/MetaTypeClassifier.py	Mon Dec  9 10:57:24 2002
@@ -67,7 +67,7 @@
         self.mt_to_mapper[meta_type] = mapper_name
 
 
-    def classifyObject(self, keychain, value):
+    def classifyObject(self, value, keychain):
         res = self.key_to_res.get(keychain[-1])
         if res is not None:
             return res