Remove QuestionDialog dependency from gen. The database now raises exceptions and the GUI generates the question dialog.

svn: r13865
This commit is contained in:
Brian Matherly
2009-12-20 22:44:32 +00:00
parent aa942f96d6
commit 814d721f68
10 changed files with 107 additions and 122 deletions

View File

@@ -53,7 +53,7 @@ from libgrdb import GrampsDbGrdb
from gen.db.txn import GrampsDbTxn as Transaction
from gen.db.cursor import GrampsCursor
from gen.db.dbconst import *
from gen.db.exceptions import FileVersionError
from gen.db.exceptions import GrampsDbVersionError
from gen.utils import db_copy
import const
from QuestionDialog import ErrorDialog
@@ -475,11 +475,6 @@ class GrampsBSDDB(GrampsDbGrdb, UpdateCallback):
return 1
def load_from(self, other_database, filename, callback):
self.load(filename, callback)
db_copy(other_database, self, callback)
return 1
def make_env_name(self, full_name):
if self.UseTXN:
# Environment name is now based on the filename
@@ -1125,11 +1120,7 @@ class GrampsBSDDB(GrampsDbGrdb, UpdateCallback):
self.metadata = None
self.env = None
self.db_is_open = False
raise FileVersionError(
"The database version is not supported by this "
"version of Gramps.\nPlease upgrade to the "
"corresponding version or use XML for porting"
"data between different database versions.")
raise GrampsDbVersionError()
def close(self):
if not self.db_is_open:

View File

@@ -390,15 +390,6 @@ class GrampsDbGrdb(Callback):
"""
raise NotImplementedError
def load_from(self, other_database, filename, callback):
"""
Load data from the other database into itself.
The filename is the name of the file for the newly created database.
The method needs to be overridden in the derived class.
"""
raise NotImplementedError
def close(self):
"""
Close the specified database.