From 73d87e59e350ba54cdaa41bedb5a72567eb10996 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 25 Oct 2016 22:18:48 +0100 Subject: [PATCH] Remove build_surname_list and save_surname_list from public API --- gramps/gen/db/base.py | 6 ------ gramps/gen/db/generic.py | 1 - gramps/plugins/db/bsddb/test/db_test.py | 1 - gramps/plugins/db/bsddb/write.py | 4 ++-- gramps/plugins/db/dbapi/dbapi.py | 15 --------------- 5 files changed, 2 insertions(+), 25 deletions(-) diff --git a/gramps/gen/db/base.py b/gramps/gen/db/base.py index 35c184963..16f952b0f 100644 --- a/gramps/gen/db/base.py +++ b/gramps/gen/db/base.py @@ -1323,12 +1323,6 @@ class DbWriteBase(DbReadBase): """ raise NotImplementedError - def build_surname_list(self): - """ - Build the list of locale-sorted surnames contained in the database. - """ - raise NotImplementedError - def commit_event(self, event, transaction, change_time=None): """ Commit the specified Event to the database, storing the changes as diff --git a/gramps/gen/db/generic.py b/gramps/gen/db/generic.py index f7c671c2e..2a06809b4 100644 --- a/gramps/gen/db/generic.py +++ b/gramps/gen/db/generic.py @@ -1655,7 +1655,6 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback): # Save misc items: if self.has_changed: - self.save_surname_list() self.save_gender_stats(self.genderStats) # Indexes: diff --git a/gramps/plugins/db/bsddb/test/db_test.py b/gramps/plugins/db/bsddb/test/db_test.py index 2c104b908..f0c62ff4b 100644 --- a/gramps/plugins/db/bsddb/test/db_test.py +++ b/gramps/plugins/db/bsddb/test/db_test.py @@ -183,7 +183,6 @@ class DbTest(unittest.TestCase): "add_source", "add_tag", "add_to_surname_list", - "build_surname_list", "commit_event", "commit_family", "commit_media", diff --git a/gramps/plugins/db/bsddb/write.py b/gramps/plugins/db/bsddb/write.py index 6c2f1fef6..1a88877be 100644 --- a/gramps/plugins/db/bsddb/write.py +++ b/gramps/plugins/db/bsddb/write.py @@ -1836,7 +1836,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): self.emit('person-groupname-rebuild', (name, grouppar)) @catch_db_error - def build_surname_list(self): + def __build_surname_list(self): """ Build surname list for use in autocompletion This is a list of unicode objects, which are decoded from the utf-8 in @@ -2317,7 +2317,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): find_referenced_handle, DBFLAGS_O) # Only build surname list after surname index is surely back - self.build_surname_list() + self.__build_surname_list() # Reset callbacks if necessary if transaction.batch or not len(transaction): diff --git a/gramps/plugins/db/dbapi/dbapi.py b/gramps/plugins/db/dbapi/dbapi.py index 05db9faed..530b786e7 100644 --- a/gramps/plugins/db/dbapi/dbapi.py +++ b/gramps/plugins/db/dbapi/dbapi.py @@ -365,7 +365,6 @@ class DBAPI(DbGeneric): TXNDEL: "-delete", None: "-delete"} if txn.batch: - self.build_surname_list() # FIXME: need a User GUI update callback here: self.reindex_reference_map(lambda percent: percent) self.dbapi.commit() @@ -1796,20 +1795,6 @@ class DBAPI(DbGeneric): surname_list.append(row[0]) return surname_list - def save_surname_list(self): - """ - Save the surname_list into persistant storage. - """ - # Nothing for DB-API to do; saves in person table - pass - - def build_surname_list(self): - """ - Rebuild the surname_list. - """ - # Nothing for DB-API to do; saves in person table - pass - def drop_tables(self): """ Useful in testing, reseting. If the test is unsure whether the tables