summaryrefslogtreecommitdiffstats
path: root/Lib/bsddb/dbshelve.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2002-12-30 20:53:52 (GMT)
committerBarry Warsaw <barry@python.org>2002-12-30 20:53:52 (GMT)
commit9a0d779c7d39ba5f4666eac7c3f913720198e0f8 (patch)
tree1c4c47178b74e5b8564c625d79a940107c217b04 /Lib/bsddb/dbshelve.py
parent0a26235e671064ddda5625c1981aa2edf91bb7a8 (diff)
downloadcpython-9a0d779c7d39ba5f4666eac7c3f913720198e0f8.zip
cpython-9a0d779c7d39ba5f4666eac7c3f913720198e0f8.tar.gz
cpython-9a0d779c7d39ba5f4666eac7c3f913720198e0f8.tar.bz2
Port BerkeleyDB 4.1 support from the pybsddb project. bsddb is now at
version 4.1.1 and works with up to BerkeleyDB 4.1.25.
Diffstat (limited to 'Lib/bsddb/dbshelve.py')
-rw-r--r--Lib/bsddb/dbshelve.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/bsddb/dbshelve.py b/Lib/bsddb/dbshelve.py
index 6ac54b7..9137df3 100644
--- a/Lib/bsddb/dbshelve.py
+++ b/Lib/bsddb/dbshelve.py
@@ -23,8 +23,7 @@
#
#------------------------------------------------------------------------
-"""
-Manage shelves of pickled objects using bsddb3 database files for the
+"""Manage shelves of pickled objects using bsddb database files for the
storage.
"""
@@ -43,7 +42,7 @@ def open(filename, flags=db.DB_CREATE, mode=0660, filetype=db.DB_HASH,
shleve.py module. It can be used like this, where key is a string
and data is a pickleable object:
- from bsddb3 import dbshelve
+ from bsddb import dbshelve
db = dbshelve.open(filename)
db[key] = data
@@ -63,7 +62,7 @@ def open(filename, flags=db.DB_CREATE, mode=0660, filetype=db.DB_HASH,
elif sflag == 'n':
flags = db.DB_TRUNCATE | db.DB_CREATE
else:
- raise error, "flags should be one of 'r', 'w', 'c' or 'n' or use the bsddb3.db.DB_* flags"
+ raise error, "flags should be one of 'r', 'w', 'c' or 'n' or use the bsddb.db.DB_* flags"
d = DBShelf(dbenv)
d.open(filename, dbname, filetype, flags, mode)
@@ -73,7 +72,7 @@ def open(filename, flags=db.DB_CREATE, mode=0660, filetype=db.DB_HASH,
class DBShelf:
"""
- A shelf to hold pickled objects, built upon a bsddb3 DB object. It
+ A shelf to hold pickled objects, built upon a bsddb DB object. It
automatically pickles/unpickles data objects going to/from the DB.
"""
def __init__(self, dbenv=None):
@@ -286,3 +285,6 @@ class DBShelfCursor:
#---------------------------------------------------------------------------
+
+
+