Added a 'sync' method to shelve. If the underlying database does not have a sync
attribute, this method silently ignores this fact. The default (bsddb's dbhash) does.
This commit is contained in:
parent
e8e87999ab
commit
4fc7067055
|
@ -72,6 +72,10 @@ class Shelf:
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
self.close()
|
self.close()
|
||||||
|
|
||||||
|
def sync(self):
|
||||||
|
if hasattr(self.dict, 'sync'):
|
||||||
|
self.dict.sync()
|
||||||
|
|
||||||
|
|
||||||
class BsdDbShelf(Shelf):
|
class BsdDbShelf(Shelf):
|
||||||
"""Shelf implementation using the "BSD" db interface.
|
"""Shelf implementation using the "BSD" db interface.
|
||||||
|
|
Loading…
Reference in New Issue