3465: Create a new hierarchy of base classes for gramps cor databases (read, write) and add methods

svn: r13894
This commit is contained in:
Doug Blank
2009-12-23 15:55:58 +00:00
parent 0f20544be3
commit ab3dfe1415
31 changed files with 1890 additions and 1693 deletions

View File

@@ -22,7 +22,7 @@
Provide the database state class
"""
from gen.db import GrampsDbRead
from gen.db import DbBsddbRead
from gen.utils import Callback
import config
@@ -32,18 +32,18 @@ class DbState(Callback):
"""
__signals__ = {
'database-changed' : (GrampsDbRead, ),
'database-changed' : (DbBsddbRead, ),
'active-changed' : (str, ),
'no-database' : None,
}
def __init__(self):
"""
Initalize the state with an empty (and useless) GrampsDbRead. This is
Initalize the state with an empty (and useless) DbBsddbRead. This is
just a place holder until a real DB is assigned.
"""
Callback.__init__(self)
self.db = GrampsDbRead()
self.db = DbBsddbRead()
self.open = False
self.active = None
self.sighndl = None
@@ -115,7 +115,7 @@ class DbState(Callback):
Closes the database without a new database
"""
self.db.close()
self.db = GrampsDbRead()
self.db = DbBsddbRead()
self.db.db_is_open = False
self.active = None
self.open = False