From 9a53fae5a0bac1cbea0eea497760d7d5c688262a Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Fri, 16 Dec 2016 21:39:39 +0000 Subject: [PATCH] Remove backup summary and auto-load Automatic backups are now saved to a user-defined directory. --- gramps/gen/db/generic.py | 13 ------------- gramps/plugins/db/dbapi/inmemorydb.py | 13 ------------- 2 files changed, 26 deletions(-) diff --git a/gramps/gen/db/generic.py b/gramps/gen/db/generic.py index efb07849f..0d78ca884 100644 --- a/gramps/gen/db/generic.py +++ b/gramps/gen/db/generic.py @@ -2554,17 +2554,6 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback): _("Version") _("Data version") """ - last_backup = "n/a" - backups = sorted(glob.glob(os.path.join( - self._directory, "backup-*.gramps")), reverse=True) - if backups: - path, filename = os.path.split(backups[0]) - filename, ext = os.path.splitext(filename) - if filename.count("-") == 6: - backup, year, month, day, hour, minute, second = filename.split("-") - last_backup = time.strftime('%x %X', time.localtime(time.mktime( - (int(year), int(month), int(day), int(hour), int(minute), int(second), - 0, 0, 0)))) return { _("Number of people"): self.get_number_of_people(), _("Number of families"): self.get_number_of_families(), @@ -2577,8 +2566,6 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback): _("Number of notes"): self.get_number_of_notes(), _("Number of tags"): self.get_number_of_tags(), _("Data version"): ".".join([str(v) for v in self.VERSION]), - _("Backups, count"): str(len(backups)), - _("Backups, last"): last_backup, } def _order_by_person_key(self, person): diff --git a/gramps/plugins/db/dbapi/inmemorydb.py b/gramps/plugins/db/dbapi/inmemorydb.py index 59926e78a..f431e8d53 100644 --- a/gramps/plugins/db/dbapi/inmemorydb.py +++ b/gramps/plugins/db/dbapi/inmemorydb.py @@ -64,16 +64,3 @@ class InMemoryDB(DBAPI): force_bsddb_upgrade, force_bsddb_downgrade, force_python_upgrade) - # Dictionary-specific load: - from gramps.plugins.importer.importxml import importData - from gramps.cli.user import User - if self._directory: - backups = sorted(glob.glob(os.path.join( - self._directory, "backup-*.gramps")), reverse=True) - if backups: - filename = backups[0] - if os.path.isfile(filename): - importData(self, filename, User()) - self.reindex_reference_map(lambda progress: None) - self.rebuild_secondary(lambda progress: None) - self.has_changed = False