Author: bugman Date: Fri Oct 17 14:58:52 2014 New Revision: 26305 URL: http://svn.gna.org/viewcvs/relax?rev=26305&view=rev Log: Changed the logic for how the new analysis wizard in the GUI is destroyed. This relates to bug #22818 (https://gna.org/bugs/?22818), the GUI test suite failures in MS Windows - PyAssertionError: C++ assertion "Assert failure". The Destroy() method has been added to the Analysis_wizard class to properly close all elements of the wizard. This is now called from the menu_new() method of the Analysis_controller class, which is the target of the menu item and toolbar button. To allow the test suite to use this, the menu_new() method now accepts the destroy boolean argument. The test suite can set this to False and then access the GUI elements after calling the method (however the Destroy() method must be called by the test suite). Modified: trunk/gui/analyses/__init__.py trunk/gui/analyses/wizard.py Modified: trunk/gui/analyses/__init__.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/__init__.py?rev=26305&r1=26304&r2=26305&view=diff ============================================================================== --- trunk/gui/analyses/__init__.py (original) +++ trunk/gui/analyses/__init__.py Fri Oct 17 14:58:52 2014 @@ -418,11 +418,13 @@ reset() - def menu_new(self, event): + def menu_new(self, event, destroy=True): """Launch a wizard to select the new analysis. - @param event: The wx event. - @type event: wx event + @param event: The wx event. + @type event: wx event + @keyword destroy: A flag which if True will cause the analysis wizard to be destroyed. This is used for the test suite. + @type destroy: bool """ # Execution lock. @@ -433,6 +435,10 @@ self.new_wizard = Analysis_wizard() data = self.new_wizard.run() + # Delete the wizard GUI element. + if destroy: + self.new_wizard.Destroy() + # Failure, so do nothing. if data == None: return @@ -442,9 +448,6 @@ # Initialise the new analysis. self.new_analysis(analysis_type, analysis_name, pipe_name, pipe_bundle, uf_exec) - - # Delete the wizard data. - del self.new_wizard def new_analysis(self, analysis_type=None, analysis_name=None, pipe_name=None, pipe_bundle=None, uf_exec=[], index=None): Modified: trunk/gui/analyses/wizard.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/wizard.py?rev=26305&r1=26304&r2=26305&view=diff ============================================================================== --- trunk/gui/analyses/wizard.py (original) +++ trunk/gui/analyses/wizard.py Fri Oct 17 14:58:52 2014 @@ -41,6 +41,14 @@ class Analysis_wizard: """The analysis selection wizard.""" + def Destroy(self): + """Properly delete the wizard and all its elements.""" + + self.new_page.Destroy() + self.pipe_page.Destroy() + self.wizard.Destroy() + + def run(self): """Run through the analysis selection wizard, returning the results.