[Zodb-checkins] CVS: ZODB4/src/zodb/zeo - client.py:1.4.4.1
Barry Warsaw
barry@wooz.org
Mon, 10 Feb 2003 18:23:29 -0500
Update of /cvs-repository/ZODB4/src/zodb/zeo
In directory cvs.zope.org:/tmp/cvs-serv8509/src/zodb/zeo
Modified Files:
Tag: opaque-pickles-branch
client.py
Log Message:
The start of opaque pickles (from the p.o.v. of the storages). This
will eventually allow us to pass compressed pickles to the storage if
we want.
The approach basically changes store() so that the data argument is a
2-tuple of the pickle and the list of oids referenced in the pickle.
This is the first step in the changes, but currently, only Berkeley
storages natively store the refs included in the store() API call.
Changes here include:
- store(): kludge to make zeo work for now; split the 2-tuple data
args into data, refs and pass only the data across to the server.
See the XXX comment for fixing this by extending the protocol.
=== ZODB4/src/zodb/zeo/client.py 1.4 => 1.4.4.1 ===
--- ZODB4/src/zodb/zeo/client.py:1.4 Wed Feb 5 18:28:24 2003
+++ ZODB4/src/zodb/zeo/client.py Mon Feb 10 18:23:21 2003
@@ -601,6 +601,11 @@
def store(self, oid, serial, data, version, transaction):
"""Storage API: store data for an object."""
+ # XXX some tests pass non-tuples for data. We really need to extend
+ # the protocol so that the 2-tuple form of data gets passed over the
+ # wire, and fix the tests to not provide bogus data.
+ if isinstance(data, tuple):
+ data, refs = data
self._check_trans(transaction)
self._server.storea(oid, serial, data, version, self._serial)
self._tbuf.store(oid, version, data)