From 16c2843073e0b2ea55de4cd4b5b533d1cca1f986 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Fri, 15 May 2015 09:12:21 -0400 Subject: [PATCH] bsddb backend: supply version details in get_summary --- .../plugins/database/bsddb_support/write.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gramps/plugins/database/bsddb_support/write.py b/gramps/plugins/database/bsddb_support/write.py index 836fcc364..cca39eae7 100644 --- a/gramps/plugins/database/bsddb_support/write.py +++ b/gramps/plugins/database/bsddb_support/write.py @@ -2448,6 +2448,28 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): except (OSError, IOError) as msg: raise DbException(str(msg)) + def get_summary(self): + """ + Returns dictionary of summary item. + Should include, if possible: + + _("Number of people") + _("Version") + _("Schema version") + """ + schema_version = self.metadata.get(b'version', default=None) + bdbversion_file = os.path.join(self.path, BDBVERSFN) + if os.path.isfile(bdbversion_file): + vers_file = open(bdbversion_file) + bsddb_version = vers_file.readline().strip() + else: + bsddb_version = _("Unknown") + return { + _("Number of people"): self.get_number_of_people(), + _("Schema version"): schema_version, + _("Version"): bsddb_version, + } + def mk_backup_name(database, base): """ Return the backup name of the database table