to have a full dictionary interface.
#
import db
+from UserDict import DictMixin
class DBEnv:
def __init__(self, *args, **kwargs):
return apply(self._cobj.set_encrypt, args, kwargs)
-class DB:
+class DB(DictMixin):
def __init__(self, dbenv, *args, **kwargs):
# give it the proper DBEnv C object that its expecting
self._cobj = apply(db.DB, (dbenv._cobj,) + args, kwargs)
#------------------------------------------------------------------------
import cPickle
+from UserDict import DictMixin
try:
# For Python 2.3
from bsddb import db
#---------------------------------------------------------------------------
-class DBShelf:
+class DBShelf(DictMixin):
"""
A shelf to hold pickled objects, built upon a bsddb DB object. It
automatically pickles/unpickles data objects going to/from the DB.