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

@ -20,7 +20,7 @@
# $Id:exceptions.py 9912 2008-01-22 09:17:46Z acraphae $
"""Exceptions generated by the GrampsDb package."""
"""Exceptions generated by the Db package."""
#-------------------------------------------------------------------------
#
@ -30,7 +30,7 @@
from gettext import gettext as _
class GrampsDbException(Exception):
class DbException(Exception):
def __init__(self, value):
Exception.__init__(self)
@ -39,7 +39,7 @@ class GrampsDbException(Exception):
def __str__(self):
return self.value
class GrampsDbWriteFailure(Exception):
class DbWriteFailure(Exception):
"""
Error used to indicate that a write to a database has failed.
"""
@ -54,7 +54,7 @@ class GrampsDbWriteFailure(Exception):
def messages(self):
return self.value, self.value2
class GrampsDbVersionError(Exception):
class DbVersionError(Exception):
"""
Error used to report that a file could not be read because it is written
in an unsupported version of the file format.
@ -67,7 +67,7 @@ class GrampsDbVersionError(Exception):
"Gramps.\nPlease upgrade to the corresponding version or use "
"XML for porting data between different database versions.")
class GrampsDbUpgradeRequiredError(Exception):
class DbUpgradeRequiredError(Exception):
"""
Error used to report that a database needs to be upgraded before it can be
used.