[Zope-CVS] CVS: Products/AdaptableStorage/serial - ObjectGateway.py:1.3

Shane Hathaway shane@zope.com
Thu, 5 Dec 2002 12:39:18 -0500


Update of /cvs-repository/Products/AdaptableStorage/serial
In directory cvs.zope.org:/tmp/cvs-serv16479/serial

Modified Files:
	ObjectGateway.py 
Log Message:
The following comments might not make sense to anyone but me right now,
but someday it might be useful for historical purposes.

- Removed ClassificationAspect.  This strategy simply can't work correctly.
  The load() method of FSClassificationSection was using the wrong object
  mapper to classify filenames (it was using the child's rather than the
  container's object mapper), revealing that classification should be
  known only to the container, not the object.

- Added a "preserve" write mode to FSConnection, enabling classification to
  be preserved even though other sections get changed.

- Simplified FSClassificationSection using the new preserve write mode.

- Since ClassificationAspect no longer exists, nothing will ever delegate
  aspect loading/storing to MetaTypeClassifier.  Removed the methods that
  implemented the IAspectSerializer interface.

- Now gateways can return None as the serial, making them invisible to the
  hash computation.

- Added tests that verify that classifications get stored in preserve mode.

- Turned the debug flag back off :-)



=== Products/AdaptableStorage/serial/ObjectGateway.py 1.2 => 1.3 ===
--- Products/AdaptableStorage/serial/ObjectGateway.py:1.2	Tue Dec  3 18:10:53 2002
+++ Products/AdaptableStorage/serial/ObjectGateway.py	Thu Dec  5 12:38:46 2002
@@ -56,9 +56,9 @@
         for name, gw in self._gws.items():
             state, serial = gw.load(object_mapper, key)
             if state is not None:
-                assert serial is not None
                 full_state[name] = state
-                serials[name] = serial
+                if serial is not None:
+                    serials[name] = serial
         serials = serials.items()
         serials.sort()
         return full_state, tuple(serials)
@@ -73,8 +73,8 @@
             state = full_state.get(name)
             # print 'gateway storing', key, name, state
             serial = gw.store(object_mapper, key, state)
-            assert serial is not None
-            serials[name] = serial
+            if serial is not None:
+                serials[name] = serial
         serials = serials.items()
         serials.sort()
         return tuple(serials)