From 6ba2332f55e1d4dc49470cfc68fcedb3b6d096f8 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Wed, 3 Sep 2008 22:59:38 +0000 Subject: clean up some more bsddb scraps --- Doc/library/dbm.rst | 87 --------------------------------------------- Doc/library/persistence.rst | 5 +-- Lib/dbm/bsd.py | 11 ------ Misc/NEWS | 4 +-- 4 files changed, 3 insertions(+), 104 deletions(-) delete mode 100644 Lib/dbm/bsd.py diff --git a/Doc/library/dbm.rst b/Doc/library/dbm.rst index 1c4c0a3..09069e8 100644 --- a/Doc/library/dbm.rst +++ b/Doc/library/dbm.rst @@ -87,93 +87,6 @@ then prints out the contents of the database:: The individual submodules are described in the following sections. -:mod:`dbm.bsd` --- DBM-style interface to the BSD database library ------------------------------------------------------------------- - -.. module:: dbm.bsd - :synopsis: DBM-style interface to the BSD database library. -.. sectionauthor:: Fred L. Drake, Jr. - -.. index:: module: bsddb - -The :mod:`dbm.bsd` module provides a function to open databases using the BSD -``db`` library. This module mirrors the interface of the other Python database -modules that provide access to DBM-style databases. The :mod:`bsddb` module is -required to use :mod:`dbm.bsd`. - -.. exception:: error - - Exception raised on database errors other than :exc:`KeyError`. It is a synonym - for :exc:`bsddb.error`. - - -.. function:: open(path[, flag[, mode]]) - - Open a ``db`` database and return the database object. The *path* argument is - the name of the database file. - - The *flag* argument can be: - - +---------+-------------------------------------------+ - | Value | Meaning | - +=========+===========================================+ - | ``'r'`` | Open existing database for reading only | - | | (default) | - +---------+-------------------------------------------+ - | ``'w'`` | Open existing database for reading and | - | | writing | - +---------+-------------------------------------------+ - | ``'c'`` | Open database for reading and writing, | - | | creating it if it doesn't exist | - +---------+-------------------------------------------+ - | ``'n'`` | Always create a new, empty database, open | - | | for reading and writing | - +---------+-------------------------------------------+ - - For platforms on which the BSD ``db`` library supports locking, an ``'l'`` - can be appended to indicate that locking should be used. - - The optional *mode* parameter is used to indicate the Unix permission bits that - should be set if a new database must be created; this will be masked by the - current umask value for the process. - - The database objects returned by :func:`open` provide the methods common to all - the DBM-style databases and mapping objects. The following methods are - available in addition to the standard methods: - - .. method:: dbhash.first() - - It's possible to loop over every key/value pair in the database using this - method and the :meth:`next` method. The traversal is ordered by the databases - internal hash values, and won't be sorted by the key values. This method - returns the starting key. - - .. method:: dbhash.last() - - Return the last key/value pair in a database traversal. This may be used to - begin a reverse-order traversal; see :meth:`previous`. - - .. method:: dbhash.next() - - Returns the key next key/value pair in a database traversal. The following code - prints every key in the database ``db``, without having to create a list in - memory that contains them all:: - - print(db.first()) - for i in range(1, len(db)): - print(db.next()) - - .. method:: dbhash.previous() - - Returns the previous key/value pair in a forward-traversal of the database. In - conjunction with :meth:`last`, this may be used to implement a reverse-order - traversal. - - .. method:: dbhash.sync() - - This method forces any unwritten data to be written to the disk. - - :mod:`dbm.gnu` --- GNU's reinterpretation of dbm ------------------------------------------------ diff --git a/Doc/library/persistence.rst b/Doc/library/persistence.rst index 8d9fa3a..b90b2e1 100644 --- a/Doc/library/persistence.rst +++ b/Doc/library/persistence.rst @@ -9,9 +9,7 @@ The modules described in this chapter support storing Python data in a persistent form on disk. The :mod:`pickle` and :mod:`marshal` modules can turn many Python data types into a stream of bytes and then recreate the objects from the bytes. The various DBM-related modules support a family of hash-based file -formats that store a mapping of strings to other strings. The :mod:`bsddb` -module also provides such disk-based string-to-string mappings based on hashing, -and also supports B-Tree and record-based formats. +formats that store a mapping of strings to other strings. The list of modules described in this chapter is: @@ -23,5 +21,4 @@ The list of modules described in this chapter is: shelve.rst marshal.rst dbm.rst - bsddb.rst sqlite3.rst diff --git a/Lib/dbm/bsd.py b/Lib/dbm/bsd.py deleted file mode 100644 index 2dccadb..0000000 --- a/Lib/dbm/bsd.py +++ /dev/null @@ -1,11 +0,0 @@ -"""Provide a (g)dbm-compatible interface to bsddb.hashopen.""" - -import bsddb - -__all__ = ["error", "open"] - -class error(bsddb.error, IOError): - pass - -def open(file, flag = 'r', mode=0o666): - return bsddb.hashopen(file, flag, mode) diff --git a/Misc/NEWS b/Misc/NEWS index 16573d2..6aa4703 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -73,12 +73,12 @@ C API Library ------- +- The bsddb module (and therefore the dbm.bsd module) has been removed. + - Issue 600362: Relocated parse_qs() and parse_qsl(), from the cgi module to the urlparse one. Added a DeprecationWarning in the old module, it will be deprecated in the future. -- The bsddb module has been removed. - - Issue #3719: platform.architecture() fails if there are spaces in the path to the Python binary. -- cgit v0.12