From c9ae621d612bd798b99dc2ef303f579e70b42553 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sat, 15 Oct 2016 23:15:21 +0100 Subject: [PATCH] Remove get_transaction_class method --- gramps/gen/db/generic.py | 6 ------ gramps/gen/lib/test/field_test.py | 4 ++-- gramps/plugins/db/bsddb/write.py | 6 ------ 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/gramps/gen/db/generic.py b/gramps/gen/db/generic.py index 659cedb69..003f4c745 100644 --- a/gramps/gen/db/generic.py +++ b/gramps/gen/db/generic.py @@ -1590,12 +1590,6 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback): handle = str(handle, "utf-8") map[handle] = class_.create(data) - def get_transaction_class(self): - """ - Get the transaction class associated with this database backend. - """ - return DbGenericTxn - def get_from_name_and_handle(self, table_name, handle): """ Returns a gen.lib object (or None) given table_name and diff --git a/gramps/gen/lib/test/field_test.py b/gramps/gen/lib/test/field_test.py index e23d24bb3..8f40403d0 100644 --- a/gramps/gen/lib/test/field_test.py +++ b/gramps/gen/lib/test/field_test.py @@ -22,7 +22,7 @@ import unittest -from gramps.gen.db import make_database +from gramps.gen.db import make_database, DbTxn from ..import (Person, Surname, Name, NameType, Family, FamilyRelType, Event, EventType, Source, Place, PlaceName, Citation, Date, @@ -38,7 +38,7 @@ class FieldBaseTest(unittest.TestCase): def setUp(self): db = make_database("inmemorydb") db.load(None) - with db.get_transaction_class()("Test", db) as trans: + with DbTxn("Test", db) as trans: # Add some people: person1 = Person() person1.primary_name = Name() diff --git a/gramps/plugins/db/bsddb/write.py b/gramps/plugins/db/bsddb/write.py index 8520f68aa..6c2f1fef6 100644 --- a/gramps/plugins/db/bsddb/write.py +++ b/gramps/plugins/db/bsddb/write.py @@ -2463,12 +2463,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): """ return self.brief_name - def get_transaction_class(self): - """ - Get the transaction class associated with this database backend. - """ - return DbTxn - def backup(self, user=None): """ Exports the database to a set of backup files. These files consist