From ae404f496fa6c65cfd03365ea37487be2eefa619 Mon Sep 17 00:00:00 2001 From: Gerald Britton Date: Fri, 21 Aug 2009 20:06:11 +0000 Subject: [PATCH] Latest updates to new modules svn: r13101 --- src/gen/db/read.py | 12 +++++++++--- src/gen/db/write.py | 7 ------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/gen/db/read.py b/src/gen/db/read.py index fc34af605..57e89e556 100644 --- a/src/gen/db/read.py +++ b/src/gen/db/read.py @@ -595,9 +595,11 @@ class GrampsDbRead(GrampsDbBase, Callback): """ raise NotImplementedError - @staticmethod - def get_number_of_records(table): - return len(table) + def get_number_of_records(self, table): + if self.txn is None: + return len(table) + else: + return table.stat(flags=db.DB_FAST_STAT, txn=self.txn)['nkeys'] def get_number_of_people(self): """ @@ -1453,6 +1455,10 @@ class GrampsDbRead(GrampsDbBase, Callback): """ default = [(1, 0, 200), (1, 1, 75), (1, 2, 100), (1, 3, 150), (1, 4, 200), (0, 5, 100)] + # Benny's new column order + default = [(1, 0, 200), (1, 1, 75), (1, 2, 100), + (0, 6, 230), (1, 3, 150), + (1, 4, 200), (0, 5, 100)] return self.__get_columns(EVENT_COL_KEY, default) def get_repository_column_order(self): diff --git a/src/gen/db/write.py b/src/gen/db/write.py index 6755e5e2c..87e1f0166 100644 --- a/src/gen/db/write.py +++ b/src/gen/db/write.py @@ -1387,13 +1387,6 @@ class GrampsDBDir(GrampsDbRead, Callback, UpdateCallback): transaction.add(key, op, handle, old_data, new_data) return old_data - def do_commit(self, add_list, db_map): - retlist = [] - for (handle, data) in add_list: - db_map.put(handle, data, self.txn) - retlist.append(str(handle)) - return retlist - def commit_person(self, person, transaction, change_time=None): """ Commit the specified Person to the database, storing the changes as