From cfd162ec852b2b46c31fa1db2b491862ee2e464e Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Fri, 29 Mar 2013 13:18:53 +0000 Subject: [PATCH] 6346: If a exporter plugin crashes, the Export Assistant can't be closed svn: r21806 --- gramps/gui/plug/export/_exportassistant.py | 32 +++++++++++++--------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/gramps/gui/plug/export/_exportassistant.py b/gramps/gui/plug/export/_exportassistant.py index c867eef6d..92e283a41 100644 --- a/gramps/gui/plug/export/_exportassistant.py +++ b/gramps/gui/plug/export/_exportassistant.py @@ -579,19 +579,25 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) : Depending on the success status, set the text for the final page. """ - if (self.option_box_instance and - hasattr(self.option_box_instance, "no_fileselect")): - filename = "" - else: - filename = get_unicode_path_from_file_chooser(self.chooser.get_filename()) - config.set('paths.recent-export-dir', os.path.split(filename)[0]) - ix = self.get_selected_format_index() - config.set('behavior.recent-export-type', ix) - export_function = self.map_exporters[ix].get_export_function() - success = export_function(self.dbstate.db, - filename, - User(error=ErrorDialog, callback=self.callback), - self.option_box_instance) + success = False + try: + if (self.option_box_instance and + hasattr(self.option_box_instance, "no_fileselect")): + filename = "" + else: + filename = get_unicode_path_from_file_chooser(self.chooser.get_filename()) + config.set('paths.recent-export-dir', os.path.split(filename)[0]) + ix = self.get_selected_format_index() + config.set('behavior.recent-export-type', ix) + export_function = self.map_exporters[ix].get_export_function() + success = export_function(self.dbstate.db, + filename, + User(error=ErrorDialog, callback=self.callback), + self.option_box_instance) + except: + #an error not catched in the export_function itself + success = False + log.error(_("Error exporting your family tree"), exc_info=True) return success def pre_save(self,page):