From 06d0291ff4bed0c01ef9656004d1285c76521957 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Thu, 24 Dec 2009 14:38:39 +0000 Subject: [PATCH] Refinements on database hierarchy svn: r13907 --- src/gen/db/base.py | 6 +----- src/gen/db/read.py | 2 +- src/gen/db/write.py | 6 +++--- src/web/djangodb.py | 7 ++++--- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/gen/db/base.py b/src/gen/db/base.py index d3f49ccbf..9282957e2 100644 --- a/src/gen/db/base.py +++ b/src/gen/db/base.py @@ -46,8 +46,6 @@ class DbReadBase(object): derived from this class should be created. """ - super(DbReadBase, self).__init__() - def all_handles(self, table): """ Return all handles from the specified table as a list @@ -1172,7 +1170,7 @@ class DbReadBase(object): """ raise NotImplementedError -class DbWriteBase(DbReadBase): +class DbWriteBase(object): """ GRAMPS database object. This object is a base class for all database interfaces. All methods raise NotImplementedError @@ -1187,8 +1185,6 @@ class DbWriteBase(DbReadBase): derived from this class should be created. """ - super(DbWriteBase, self).__init__() - def add_event(self, event, transaction, set_gid=True): """ Add an Event to the database, assigning internal IDs if they have diff --git a/src/gen/db/read.py b/src/gen/db/read.py index 2906bba81..4e464792a 100644 --- a/src/gen/db/read.py +++ b/src/gen/db/read.py @@ -180,7 +180,7 @@ class DbBsddbRead(DbReadBase, Callback): """ DbReadBase.__init__(self) - #Callback.__init__(self) + Callback.__init__(self) self.set_person_id_prefix('I%04d') self.set_object_id_prefix('O%04d') diff --git a/src/gen/db/write.py b/src/gen/db/write.py index 6a66c061e..af9717fb1 100644 --- a/src/gen/db/write.py +++ b/src/gen/db/write.py @@ -167,8 +167,7 @@ class DbBsddbAssocCursor(GrampsCursor): # DbBsddb # #------------------------------------------------------------------------- -class DbBsddb(DbBsddbRead, DbWriteBase, - Callback, UpdateCallback): +class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): """ GRAMPS database write access object. """ @@ -200,7 +199,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, self.txn = None DbBsddbRead.__init__(self) - Callback.__init__(self) + DbWriteBase.__init__(self) + #UpdateCallback.__init__(self) self.secondary_connected = False self.has_changed = False diff --git a/src/web/djangodb.py b/src/web/djangodb.py index e155e563f..0cc540e11 100644 --- a/src/web/djangodb.py +++ b/src/web/djangodb.py @@ -28,7 +28,7 @@ #------------------------------------------------------------------------ import web import gen -from gen.db import DbBase +from gen.db import DbReadBase, DbWriteBase from web.libdjango import DjangoInterface # from ReportBase._CommandLineReport import run_report @@ -50,13 +50,14 @@ class Cursor(object): def __exit__(self, *args, **kwargs): pass -class DjangoDb(DbBase): +class DjangoDb(DbReadBase, DbWriteBase): """ A Gramps Database Backend. This replicates the grampsdb functions. """ def __init__(self): - super(DjangoDb, self).__init__() + DbReadBase.__init__(self) + DbWriteBase.__init__(self) self.dji = DjangoInterface() self.readonly = False self.db_is_open = True