diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2006-06-05 01:39:52 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2006-06-05 01:39:52 (GMT) |
commit | 76a82e89ab981295f973848419b9df0f11e0b5fa (patch) | |
tree | 145b55d042e69f04474165c41d0cf6fa15f86b69 /Lib/bsddb | |
parent | 58ce5bc14c514a3d7ddc06a4b57d2101104cd8aa (diff) | |
download | cpython-76a82e89ab981295f973848419b9df0f11e0b5fa.zip cpython-76a82e89ab981295f973848419b9df0f11e0b5fa.tar.gz cpython-76a82e89ab981295f973848419b9df0f11e0b5fa.tar.bz2 |
* support DBEnv.log_stat() method on BerkeleyDB >= 4.0 [patch #1494885]
Diffstat (limited to 'Lib/bsddb')
-rw-r--r-- | Lib/bsddb/dbobj.py | 3 | ||||
-rw-r--r-- | Lib/bsddb/test/test_basics.py | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Lib/bsddb/dbobj.py b/Lib/bsddb/dbobj.py index 5bcf84b..b06106e 100644 --- a/Lib/bsddb/dbobj.py +++ b/Lib/bsddb/dbobj.py @@ -91,6 +91,9 @@ class DBEnv: return apply(self._cobj.lock_stat, args, kwargs) def log_archive(self, *args, **kwargs): return apply(self._cobj.log_archive, args, kwargs) + if db.version() >= (4,0): + def log_stat(self, *args, **kwargs): + return apply(self._cobj.log_stat, args, kwargs) def set_get_returns_none(self, *args, **kwargs): return apply(self._cobj.set_get_returns_none, args, kwargs) diff --git a/Lib/bsddb/test/test_basics.py b/Lib/bsddb/test/test_basics.py index 92cad06..0ae8732 100644 --- a/Lib/bsddb/test/test_basics.py +++ b/Lib/bsddb/test/test_basics.py @@ -659,6 +659,13 @@ class BasicTransactionTestCase(BasicTestCase): except db.DBIncompleteError: pass + if db.version() >= (4,0): + statDict = self.env.log_stat(0); + assert statDict.has_key('magic') + assert statDict.has_key('version') + assert statDict.has_key('cur_file') + assert statDict.has_key('region_nowait') + # must have at least one log file present: logs = self.env.log_archive(db.DB_ARCH_ABS | db.DB_ARCH_LOG) assert logs != None |