From 9a59537daf920fedd1939fa88b3bb328dcf4cb90 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 15 Jul 2006 03:56:13 +0000 Subject: [PATCH] 2006-07-14 Don Allingham * src/DbLoader.py (DbLoader.read_file): handle DBAccessError svn: r7027 --- gramps2/ChangeLog | 3 +++ gramps2/src/DbLoader.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 442db1a8c..514069117 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2006-07-14 Don Allingham + * src/DbLoader.py (DbLoader.read_file): handle DBAccessError + 2006-07-12 Brian Matherly * src/ReportBase/_CommandLineReport.py: missing import - CustomFilters * src/plugins/NarrativeWeb.py: HTML validation fixes diff --git a/gramps2/src/DbLoader.py b/gramps2/src/DbLoader.py index b17a20704..19f879c0f 100644 --- a/gramps2/src/DbLoader.py +++ b/gramps2/src/DbLoader.py @@ -30,6 +30,7 @@ Handling of loading new/existing databases. # #------------------------------------------------------------------------- import os +from bsddb.db import DBAccessError from gettext import gettext as _ import logging log = logging.getLogger(".") @@ -397,6 +398,10 @@ class DbLoader: os.chdir(os.path.dirname(filename)) except: print "could not change directory" + except DBAccessError, msg: + QuestionDialog.ErrorDialog( + _("Could not open file: %s") % filename, + str(msg[1])) except Exception: log.error("Failed to open database.", exc_info=True)