From 8a25a77c9ff718ae96f23b729bd0080349c1a43c Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Tue, 25 May 2010 23:29:37 +0000 Subject: [PATCH] Removed .get_base_db() method as there was already basedb for the same purpose svn: r15484 --- src/Utils.py | 4 ++-- src/gen/db/base.py | 1 + src/gen/db/read.py | 5 ----- src/gen/proxy/proxybase.py | 8 -------- src/plugins/quickview/FilterByName.py | 16 ++++++++-------- 5 files changed, 11 insertions(+), 23 deletions(-) diff --git a/src/Utils.py b/src/Utils.py index 52863438a..68b32c0e1 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -816,9 +816,9 @@ def probably_alive(person, db, :param max_age_prob_alive: maximum age of a person, in years :param avg_generation_gap: average generation gap, in years """ - # First, find the real database to use all people + # First, get the real database to use all people # for determining alive status: - basedb = db.get_base_db() + basedb = db.basedb # Now, we create a wrapper for doing work: pb = ProbablyAlive(basedb, max_sib_age_diff, max_age_prob_alive, diff --git a/src/gen/db/base.py b/src/gen/db/base.py index 86fb37437..257785ea0 100644 --- a/src/gen/db/base.py +++ b/src/gen/db/base.py @@ -53,6 +53,7 @@ class DbReadBase(object): A new DbReadBase class should never be directly created. Only classes derived from this class should be created. """ + self.basedb = self def all_handles(self, table): """ diff --git a/src/gen/db/read.py b/src/gen/db/read.py index 7bd37083a..7dd254c71 100644 --- a/src/gen/db/read.py +++ b/src/gen/db/read.py @@ -1466,8 +1466,3 @@ class DbBsddbRead(DbReadBase, Callback): """ return self._bm_changes > 0 - def get_base_db(self): - """ - Return the base database. - """ - return self diff --git a/src/gen/proxy/proxybase.py b/src/gen/proxy/proxybase.py index c53f75671..be358e235 100644 --- a/src/gen/proxy/proxybase.py +++ b/src/gen/proxy/proxybase.py @@ -723,11 +723,3 @@ class ProxyDbBase(DbReadBase): """returns the list of Note handles in the bookmarks""" return self.note_bookmarks - def get_base_db(self): - """ - Return the base database. - """ - basedb = self - while isinstance(basedb, ProxyDbBase): - basedb = basedb.db - return basedb diff --git a/src/plugins/quickview/FilterByName.py b/src/plugins/quickview/FilterByName.py index 3c6b5103b..6ff299498 100644 --- a/src/plugins/quickview/FilterByName.py +++ b/src/plugins/quickview/FilterByName.py @@ -74,28 +74,28 @@ def run(database, document, filter_name, *args, **kwargs): stab.columns(_("Object"), _("Count/Total")) stab.row([_("People"), "Filter", "all people"], "%d/%d" % (len(database.get_person_handles()), - len(database.get_base_db().get_person_handles()))) + len(database.basedb.get_person_handles()))) stab.row([_("Families"), "Filter", "all families"], "%d/%d" % (len(database.get_family_handles()), - len(database.get_base_db().get_family_handles()))) + len(database.basedb.get_family_handles()))) stab.row([_("Events"), "Filter", "all events"], "%d/%d" % (len(database.get_event_handles()), - len(database.get_base_db().get_event_handles()))) + len(database.basedb.get_event_handles()))) stab.row([_("Places"), "Filter", "all places"], "%d/%d" % (len(database.get_place_handles()), - len(database.get_base_db().get_place_handles()))) + len(database.basedb.get_place_handles()))) stab.row([_("Sources"), "Filter", "all sources"], "%d/%d" % (len(database.get_source_handles()), - len(database.get_base_db().get_source_handles()))) + len(database.basedb.get_source_handles()))) stab.row([_("Repositories"), "Filter", "all repositories"], "%d/%d" % (len(database.get_repository_handles()), - len(database.get_base_db().get_repository_handles()))) + len(database.basedb.get_repository_handles()))) stab.row([_("Media"), "Filter", "all media"], "%d/%d" % (len(database.get_media_object_handles()), - len(database.get_base_db().get_media_object_handles()))) + len(database.basedb.get_media_object_handles()))) stab.row([_("Notes"), "Filter", "all notes"], "%d/%d" % (len(database.get_note_handles()), - len(database.get_base_db().get_note_handles()))) + len(database.basedb.get_note_handles()))) sdoc.paragraph("") stab.write(sdoc) return