Remove get_transaction_class method

This commit is contained in:
Nick Hall 2016-10-15 23:15:21 +01:00
parent 22c93d8c87
commit c9ae621d61
3 changed files with 2 additions and 14 deletions

View File

@ -1590,12 +1590,6 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
handle = str(handle, "utf-8") handle = str(handle, "utf-8")
map[handle] = class_.create(data) 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): def get_from_name_and_handle(self, table_name, handle):
""" """
Returns a gen.lib object (or None) given table_name and Returns a gen.lib object (or None) given table_name and

View File

@ -22,7 +22,7 @@
import unittest 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, from ..import (Person, Surname, Name, NameType, Family, FamilyRelType,
Event, EventType, Source, Place, PlaceName, Citation, Date, Event, EventType, Source, Place, PlaceName, Citation, Date,
@ -38,7 +38,7 @@ class FieldBaseTest(unittest.TestCase):
def setUp(self): def setUp(self):
db = make_database("inmemorydb") db = make_database("inmemorydb")
db.load(None) db.load(None)
with db.get_transaction_class()("Test", db) as trans: with DbTxn("Test", db) as trans:
# Add some people: # Add some people:
person1 = Person() person1 = Person()
person1.primary_name = Name() person1.primary_name = Name()

View File

@ -2463,12 +2463,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
""" """
return self.brief_name 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): def backup(self, user=None):
""" """
Exports the database to a set of backup files. These files consist Exports the database to a set of backup files. These files consist