2006-07-14 Don Allingham <don@gramps-project.org>

* src/DbLoader.py (DbLoader.read_file): handle DBAccessError



svn: r7027
This commit is contained in:
Don Allingham 2006-07-15 03:56:13 +00:00
parent 8df0605b3b
commit 0b3c635f89
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,6 @@
2006-07-14 Don Allingham <don@gramps-project.org>
* src/DbLoader.py (DbLoader.read_file): handle DBAccessError
2006-07-12 Brian Matherly <brian@gramps-project.org> 2006-07-12 Brian Matherly <brian@gramps-project.org>
* src/ReportBase/_CommandLineReport.py: missing import - CustomFilters * src/ReportBase/_CommandLineReport.py: missing import - CustomFilters
* src/plugins/NarrativeWeb.py: HTML validation fixes * src/plugins/NarrativeWeb.py: HTML validation fixes

View File

@ -30,6 +30,7 @@ Handling of loading new/existing databases.
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import os import os
from bsddb.db import DBAccessError
from gettext import gettext as _ from gettext import gettext as _
import logging import logging
log = logging.getLogger(".") log = logging.getLogger(".")
@ -397,6 +398,10 @@ class DbLoader:
os.chdir(os.path.dirname(filename)) os.chdir(os.path.dirname(filename))
except: except:
print "could not change directory" print "could not change directory"
except DBAccessError, msg:
QuestionDialog.ErrorDialog(
_("Could not open file: %s") % filename,
str(msg[1]))
except Exception: except Exception:
log.error("Failed to open database.", exc_info=True) log.error("Failed to open database.", exc_info=True)