9386: Slow exit of Gramps GUI
This commit is contained in:
parent
f09c32181a
commit
12655fc22e
@ -2049,13 +2049,15 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
||||
def _order_by_tag_key(self, key):
|
||||
return glocale.sort_key(key)
|
||||
|
||||
def backup(self):
|
||||
def backup(self, user=None):
|
||||
"""
|
||||
If you wish to support an optional backup routine, put it here.
|
||||
"""
|
||||
from gramps.plugins.export.exportxml import XmlWriter
|
||||
from gramps.cli.user import User
|
||||
writer = XmlWriter(self, User(), strip_photos=0, compress=1)
|
||||
if user is None:
|
||||
user = User()
|
||||
writer = XmlWriter(self, user, strip_photos=0, compress=1)
|
||||
timestamp = '{0:%Y-%m-%d-%H-%M-%S}'.format(datetime.datetime.now())
|
||||
filename = os.path.join(self._directory, "backup-%s.gramps" % timestamp)
|
||||
writer.write(filename)
|
||||
|
@ -761,7 +761,7 @@ class ViewManager(CLIManager):
|
||||
self.uistate.progress.show()
|
||||
self.uistate.push_message(self.dbstate, _("Autobackup..."))
|
||||
try:
|
||||
self.dbstate.db.backup()
|
||||
self.dbstate.db.backup(user=self.user)
|
||||
except DbException as msg:
|
||||
ErrorDialog(_("Error saving backup data"), msg,
|
||||
parent=self.uistate.window)
|
||||
|
@ -2471,7 +2471,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
||||
"""
|
||||
return DbTxn
|
||||
|
||||
def backup(self):
|
||||
def backup(self, user=None):
|
||||
"""
|
||||
Exports the database to a set of backup files. These files consist
|
||||
of the pickled database tables, one file for each table.
|
||||
|
Loading…
Reference in New Issue
Block a user