mailr14136 - in /branches/gui_testing/gui: errors.py user_functions/grace.py user_functions/value.py wizard.py


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

Header


Content

Posted by edward on August 04, 2011 - 16:13:
Author: bugman
Date: Thu Aug  4 16:13:25 2011
New Revision: 14136

URL: http://svn.gna.org/viewcvs/relax?rev=14136&view=rev
Log:
Another attempt at error handling.

This should now provide the correct behaviour by not showing tracebacks in 
standard mode.


Modified:
    branches/gui_testing/gui/errors.py
    branches/gui_testing/gui/user_functions/grace.py
    branches/gui_testing/gui/user_functions/value.py
    branches/gui_testing/gui/wizard.py

Modified: branches/gui_testing/gui/errors.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/errors.py?rev=14136&r1=14135&r2=14136&view=diff
==============================================================================
--- branches/gui_testing/gui/errors.py (original)
+++ branches/gui_testing/gui/errors.py Thu Aug  4 16:13:25 2011
@@ -31,7 +31,7 @@
 from status import Status; status = Status()
 
 
-def gui_raise(relax_error, raise_flag=True):
+def gui_raise(relax_error, raise_flag=False):
     """Handle errors in the GUI to be reported to the user.
 
     @param relax_error:     The error object.

Modified: branches/gui_testing/gui/user_functions/grace.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/user_functions/grace.py?rev=14136&r1=14135&r2=14136&view=diff
==============================================================================
--- branches/gui_testing/gui/user_functions/grace.py (original)
+++ branches/gui_testing/gui/user_functions/grace.py Thu Aug  4 16:13:25 2011
@@ -141,6 +141,10 @@
         self.x_data_type = self.combo_box(sizer, "The X-axis data type:", 
tooltip=self.uf._doc_args_dict['x_data_type'])
         self.update_parameters(self.x_data_type)
 
+        # Failure.
+        if self.setup_fail:
+            return
+
         # The Y-axis data.
         self.y_data_type = self.combo_box(sizer, "The Y-axis data type:", 
tooltip=self.uf._doc_args_dict['y_data_type'])
         self.update_parameters(self.y_data_type)
@@ -196,6 +200,8 @@
         # Check the current data pipe.
         if cdp == None:
             gui_raise(RelaxNoPipeError())
+            self.setup_fail = True
+            return
 
         # Get the specific functions.
         data_names = specific_fns.setup.get_specific_fn('data_names', 
cdp.pipe_type, raise_error=False)
@@ -207,6 +213,8 @@
             names = data_names(set='params')
         except RelaxImplementError:
             gui_raise(RelaxImplementError())
+            self.setup_fail = True
+            return
 
         # First add the sequence data.
         combo_box.Append(str_to_gui("Spin sequence"), 'spin')

Modified: branches/gui_testing/gui/user_functions/value.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/user_functions/value.py?rev=14136&r1=14135&r2=14136&view=diff
==============================================================================
--- branches/gui_testing/gui/user_functions/value.py (original)
+++ branches/gui_testing/gui/user_functions/value.py Thu Aug  4 16:13:25 2011
@@ -173,6 +173,8 @@
         # Check the current data pipe.
         if cdp == None:
             gui_raise(RelaxNoPipeError())
+            self.setup_fail = True
+            return
 
         # Get the specific functions.
         data_names = specific_fns.setup.get_specific_fn('data_names', 
cdp.pipe_type, raise_error=False)
@@ -184,6 +186,8 @@
             names = data_names(set='params')
         except RelaxImplementError:
             gui_raise(RelaxImplementError())
+            self.setup_fail = True
+            return
 
         # Loop over the parameters.
         for name in (data_names(set='params') + data_names(set='generic')):

Modified: branches/gui_testing/gui/wizard.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/wizard.py?rev=14136&r1=14135&r2=14136&view=diff
==============================================================================
--- branches/gui_testing/gui/wizard.py (original)
+++ branches/gui_testing/gui/wizard.py Thu Aug  4 16:13:25 2011
@@ -73,6 +73,7 @@
     height_element = 27
     image_path = paths.IMAGE_PATH + "relax.gif"
     main_text = ''
+    setup_fail = False
     size_button = (100, 33)
     size_square_button = (33, 33)
     title = ''
@@ -1411,6 +1412,11 @@
         @rtype:         bool or None
         """
 
+        # Check that all pages have been set up correctly, returning without 
doing anything if not.
+        for i in range(self._num_pages):
+            if self._pages[i].setup_fail:
+                return
+
         # Build the buttons for the entire wizard.
         self._build_buttons()
 




Related Messages


Powered by MHonArc, Updated Thu Aug 04 16:40:02 2011