[Zope-CVS] CVS: Products/AdaptableStorage/zodb - OIDEncoder.py:1.3
Shane Hathaway
shane@zope.com
Fri, 6 Dec 2002 17:13:24 -0500
Update of /cvs-repository/Products/AdaptableStorage/zodb
In directory cvs.zope.org:/tmp/cvs-serv9786/zodb
Modified Files:
OIDEncoder.py
Log Message:
Got around the cPickleCache requirement that OIDs be strings.
=== Products/AdaptableStorage/zodb/OIDEncoder.py 1.2 => 1.3 ===
--- Products/AdaptableStorage/zodb/OIDEncoder.py:1.2 Fri Dec 6 17:06:51 2002
+++ Products/AdaptableStorage/zodb/OIDEncoder.py Fri Dec 6 17:13:23 2002
@@ -17,6 +17,7 @@
"""
from types import TupleType
+from marshal import dumps, loads
from consts import ROOT_OID
from interfaces.public import IOIDEncoder
@@ -32,13 +33,14 @@
"""Returns a keychain."""
if oid == ROOT_OID:
return ('',)
- assert isinstance(oid, TupleType)
- return oid
+ keychain = loads(oid)
+ assert isinstance(keychain, TupleType)
+ return keychain
def encode(self, keychain):
"""Returns an OID."""
assert isinstance(keychain, TupleType)
if keychain == ('',):
return ROOT_OID
- return keychain
+ return dumps(keychain)