Added missing bookmark count methods to djangodb and dictionarydb
This commit is contained in:
parent
b6fb46b760
commit
c2fb186edc
@ -393,6 +393,7 @@ class DictionaryDb(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
self.transaction = None
|
self.transaction = None
|
||||||
self.undodb = DbUndo(self)
|
self.undodb = DbUndo(self)
|
||||||
self.abort_possible = False
|
self.abort_possible = False
|
||||||
|
self._bm_changes = 0
|
||||||
self._directory = directory
|
self._directory = directory
|
||||||
if directory:
|
if directory:
|
||||||
self.load(directory)
|
self.load(directory)
|
||||||
@ -1689,3 +1690,15 @@ class DictionaryDb(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
with open(versionpath, "w") as version_file:
|
with open(versionpath, "w") as version_file:
|
||||||
version_file.write("dictionarydb")
|
version_file.write("dictionarydb")
|
||||||
|
|
||||||
|
def report_bm_change(self):
|
||||||
|
"""
|
||||||
|
Add 1 to the number of bookmark changes during this session.
|
||||||
|
"""
|
||||||
|
self._bm_changes += 1
|
||||||
|
|
||||||
|
def db_has_bm_changes(self):
|
||||||
|
"""
|
||||||
|
Return whethere there were bookmark changes during the session.
|
||||||
|
"""
|
||||||
|
return self._bm_changes > 0
|
||||||
|
|
||||||
|
@ -338,6 +338,7 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
self.use_db_cache = True
|
self.use_db_cache = True
|
||||||
self.undodb = DbUndo(self)
|
self.undodb = DbUndo(self)
|
||||||
self.abort_possible = False
|
self.abort_possible = False
|
||||||
|
self._bm_changes = 0
|
||||||
self._directory = directory
|
self._directory = directory
|
||||||
if directory:
|
if directory:
|
||||||
self.load(directory)
|
self.load(directory)
|
||||||
@ -2088,3 +2089,16 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
for filename in os.listdir(defaults):
|
for filename in os.listdir(defaults):
|
||||||
fullpath = os.path.abspath(os.path.join(defaults, filename))
|
fullpath = os.path.abspath(os.path.join(defaults, filename))
|
||||||
shutil.copy2(fullpath, directory)
|
shutil.copy2(fullpath, directory)
|
||||||
|
|
||||||
|
def report_bm_change(self):
|
||||||
|
"""
|
||||||
|
Add 1 to the number of bookmark changes during this session.
|
||||||
|
"""
|
||||||
|
self._bm_changes += 1
|
||||||
|
|
||||||
|
def db_has_bm_changes(self):
|
||||||
|
"""
|
||||||
|
Return whethere there were bookmark changes during the session.
|
||||||
|
"""
|
||||||
|
return self._bm_changes > 0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user