mailr13571 - /branches/gui_testing/gui/wizard.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on July 13, 2011 - 10:07:
Author: bugman
Date: Wed Jul 13 10:07:59 2011
New Revision: 13571

URL: http://svn.gna.org/viewcvs/relax?rev=13571&view=rev
Log:
The wizard now uses the protected_exec() function for applying the 
on_execute() method.


Modified:
    branches/gui_testing/gui/wizard.py

Modified: branches/gui_testing/gui/wizard.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/wizard.py?rev=13571&r1=13570&r2=13571&view=diff
==============================================================================
--- branches/gui_testing/gui/wizard.py (original)
+++ branches/gui_testing/gui/wizard.py Wed Jul 13 10:07:59 2011
@@ -30,13 +30,13 @@
 # relax module imports.
 from data import Relax_data_store; ds = Relax_data_store()
 from generic_fns.mol_res_spin import id_string_doc
-from relax_errors import AllRelaxErrors, RelaxImplementError
+from relax_errors import RelaxImplementError
 
 # relax GUI module imports.
 from gui.controller import Redirect_text
 from gui.filedialog import openfile
 from gui.message import error_message
-from gui.misc import add_border, bool_to_gui, gui_to_int, int_to_gui, 
str_to_gui
+from gui.misc import add_border, bool_to_gui, gui_to_int, int_to_gui, 
protected_exec, str_to_gui
 from gui import paths
 
 
@@ -190,12 +190,14 @@
         """
 
         # Execute.
-        try:
-            self.on_execute()
-        except AllRelaxErrors, instance:
-            error_message(instance.text, instance.__class__.__name__)
-        finally:
-            self.on_completion()
+        status = protected_exec(self.on_execute)
+
+        # Finished.
+        self.on_completion()
+
+        # Execution failure.
+        if not status:
+            return
 
         # Execute the on_apply() method.
         self.on_apply()




Related Messages


Powered by MHonArc, Updated Wed Jul 13 10:40:01 2011