Commit eae0cb41 authored by Gregory P. Smith's avatar Gregory P. Smith

* add support for DBSequence objects [patch #1466734]

parent eae034bf
...@@ -217,3 +217,38 @@ class DB(DictMixin): ...@@ -217,3 +217,38 @@ class DB(DictMixin):
if db.version() >= (4,1): if db.version() >= (4,1):
def set_encrypt(self, *args, **kwargs): def set_encrypt(self, *args, **kwargs):
return apply(self._cobj.set_encrypt, args, kwargs) return apply(self._cobj.set_encrypt, args, kwargs)
class DBSequence:
def __init__(self, *args, **kwargs):
self._cobj = apply(db.DBSequence, args, kwargs)
def close(self, *args, **kwargs):
return apply(self._cobj.close, args, kwargs)
def get(self, *args, **kwargs):
return apply(self._cobj.get, args, kwargs)
def get_dbp(self, *args, **kwargs):
return apply(self._cobj.get_dbp, args, kwargs)
def get_key(self, *args, **kwargs):
return apply(self._cobj.get_key, args, kwargs)
def init_value(self, *args, **kwargs):
return apply(self._cobj.init_value, args, kwargs)
def open(self, *args, **kwargs):
return apply(self._cobj.open, args, kwargs)
def remove(self, *args, **kwargs):
return apply(self._cobj.remove, args, kwargs)
def stat(self, *args, **kwargs):
return apply(self._cobj.stat, args, kwargs)
def set_cachesize(self, *args, **kwargs):
return apply(self._cobj.set_cachesize, args, kwargs)
def set_flags(self, *args, **kwargs):
return apply(self._cobj.set_flags, args, kwargs)
def set_range(self, *args, **kwargs):
return apply(self._cobj.set_range, args, kwargs)
def get_cachesize(self, *args, **kwargs):
return apply(self._cobj.get_cachesize, args, kwargs)
def get_flags(self, *args, **kwargs):
return apply(self._cobj.get_flags, args, kwargs)
def get_range(self, *args, **kwargs):
return apply(self._cobj.get_range, args, kwargs)
...@@ -4,6 +4,12 @@ ...@@ -4,6 +4,12 @@
import sys import sys
import os import os
import unittest import unittest
try:
# For Pythons w/distutils pybsddb
from bsddb3 import db
except ImportError:
# For Python 2.3
from bsddb import db
verbose = 0 verbose = 0
if 'verbose' in sys.argv: if 'verbose' in sys.argv:
...@@ -16,12 +22,6 @@ if 'silent' in sys.argv: # take care of old flag, just in case ...@@ -16,12 +22,6 @@ if 'silent' in sys.argv: # take care of old flag, just in case
def print_versions(): def print_versions():
try:
# For Pythons w/distutils pybsddb
from bsddb3 import db
except ImportError:
# For Python 2.3
from bsddb import db
print print
print '-=' * 38 print '-=' * 38
print db.DB_VERSION_STRING print db.DB_VERSION_STRING
...@@ -69,6 +69,7 @@ def suite(): ...@@ -69,6 +69,7 @@ def suite():
'test_queue', 'test_queue',
'test_recno', 'test_recno',
'test_thread', 'test_thread',
'test_sequence',
] ]
alltests = unittest.TestSuite() alltests = unittest.TestSuite()
......
...@@ -44,6 +44,7 @@ def suite(): ...@@ -44,6 +44,7 @@ def suite():
'test_queue', 'test_queue',
'test_recno', 'test_recno',
'test_thread', 'test_thread',
'test_sequence',
] ]
alltests = unittest.TestSuite() alltests = unittest.TestSuite()
......
...@@ -109,6 +109,9 @@ Extension Modules ...@@ -109,6 +109,9 @@ Extension Modules
assuming BerkeleyDB >= 4.0 and 4.4 respectively. [pybsddb project SF assuming BerkeleyDB >= 4.0 and 4.4 respectively. [pybsddb project SF
patch numbers 1494885 and 1494902] patch numbers 1494885 and 1494902]
- bsddb: added an interface for the BerkeleyDB >= 4.3 DBSequence class
[pybsddb project SF patch number 1466734]
Library Library
------- -------
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment