* src/DbPrompter.py: handle runtime errors issued by

gnomevfs.get_mime_type


svn: r4394
This commit is contained in:
Don Allingham 2005-04-21 00:27:42 +00:00
parent 5664d7ad50
commit 3aebc669e3
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2005-04-20 Don Allingham <don@gramps-project.org>
* src/DbPrompter.py: handle runtime errors issued by
gnomevfs.get_mime_type
2005-04-21 Eero Tamminen <eerot@sf>
* src/po/fi.po: Translation updated, but not yet tested & fixed

View File

@ -297,8 +297,14 @@ class ImportDbPrompter:
filename = choose.get_filename()
filetype = type_selector.get_value()
if filetype == 'auto':
filetype = get_mime_type(filename)
try:
filetype = get_mime_type(filename)
except RuntimeError,msg:
QuestionDialog.ErrorDialog(
_("Could not open file: %s") % filename,
str(msg))
return False
if filetype == const.app_gramps:
choose.destroy()
ReadGrdb.importData(self.parent.db,filename)