From 94fc96718f8a20133626f22d9d71ad94707a7457 Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Mon, 22 Jan 2007 09:19:57 +0000 Subject: [PATCH] * src/ArgHandler.py, src/DbLoader.py: Print out more precise error messages when trying to open gpkg or geneweb files. svn: r7953 --- ChangeLog | 5 +++++ src/ArgHandler.py | 5 +++++ src/DbLoader.py | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 35b03744f..cea867903 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-01-22 Martin Hawlisch + * src/ArgHandler.py, + * src/DbLoader.py: Print out more precise error messages when trying + to open gpkg or geneweb files. + 2007-01-21 Don Allingham * src/GrampsDb/_GrampsDBCallback.py: sys.getfilesystemencoding() * src/GrampsDb/_GrampsBSDDB.py: sys.getfilesystemencoding() diff --git a/src/ArgHandler.py b/src/ArgHandler.py index 100f0d708..b2eb9429a 100644 --- a/src/ArgHandler.py +++ b/src/ArgHandler.py @@ -153,6 +153,11 @@ class ArgHandler: format = 'gramps-xml' elif ftype == const.app_gramps: format = 'grdb' + elif ftype in [const.app_gramps_package,const.app_geneweb]: + print 'Unsupported type: "%s" for input file: %s' \ + % (ftype,fname) + print 'Please create a new GRAMPS database and import the file.' + continue else: print 'Unrecognized type: "%s" for input file: %s' \ % (ftype,fname) diff --git a/src/DbLoader.py b/src/DbLoader.py index 1829bd0f6..c32089ddf 100644 --- a/src/DbLoader.py +++ b/src/DbLoader.py @@ -118,6 +118,13 @@ class DbLoader: except: return ('','') return (filename,filetype) + elif filetype in [const.app_gramps_package,const.app_geneweb]: + QuestionDialog.ErrorDialog( + _("Could not open file: %s") % filename, + _('Files of type "%s" cannot be opened directly.\n\n' + 'Please create a new GRAMPS database and import ' + 'the file.') % filetype) + return ('','') else: QuestionDialog.ErrorDialog( _("Could not open file: %s") % filename,