Author: bugman Date: Tue Sep 3 18:50:28 2013 New Revision: 20783 URL: http://svn.gna.org/viewcvs/relax?rev=20783&view=rev Log: Merged revisions 20780-20781 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r20780 | bugman | 2013-09-03 18:48:16 +0200 (Tue, 03 Sep 2013) | 7 lines Created Wiz_window.setup_page() for user function wizard pages to allow for simpler GUI tests. This method can be used to setup any user function wizard page with all its arguments set. It accepts all keyword arguments and sets these for the wizard page, translating to GUI strings as needed. This should save a lot of lines in the GUI tests. ........ r20781 | bugman | 2013-09-03 18:48:49 +0200 (Tue, 03 Sep 2013) | 3 lines Simplified the Noe.test_noe_analysis GUI test by using the new Wiz_window.setup_page() method. ........ Modified: branches/relax_disp/ (props changed) branches/relax_disp/gui/wizards/wiz_objects.py branches/relax_disp/test_suite/gui_tests/noe.py Propchange: branches/relax_disp/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Tue Sep 3 18:50:28 2013 @@ -1,1 +1,1 @@ -/trunk:1-20777 +/trunk:1-20782 Modified: branches/relax_disp/gui/wizards/wiz_objects.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/gui/wizards/wiz_objects.py?rev=20783&r1=20782&r2=20783&view=diff ============================================================================== --- branches/relax_disp/gui/wizards/wiz_objects.py (original) +++ branches/relax_disp/gui/wizards/wiz_objects.py Tue Sep 3 18:50:28 2013 @@ -33,6 +33,8 @@ from gui.icons import relax_icons from gui.interpreter import Interpreter; interpreter = Interpreter() from gui.misc import add_border, bitmap_setup +from gui.string_conv import float_to_gui, str_to_gui +from lib.check_types import is_float from lib.errors import RelaxImplementError from status import Status; status = Status() @@ -941,3 +943,26 @@ # Store the function. self._seq_fn_list[index] = fn + + + def setup_page(self, page=None, **kargs): + """Allow a specified user function page to be remotely set up. + + @keyword page: The page to setup. This is the page index key. + @type page: str + """ + + # Get the page. + page = self.get_page(self.page_indices[page]) + + # Loop over the keyword arguments and set them. + for arg in kargs: + # The value. + value = kargs[arg] + if isinstance(value, str): + value = str_to_gui(value) + elif is_float(value): + value = float_to_gui(value) + + # Set the argument. + page.uf_args[arg].SetValue(value) Modified: branches/relax_disp/test_suite/gui_tests/noe.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/gui_tests/noe.py?rev=20783&r1=20782&r2=20783&view=diff ============================================================================== --- branches/relax_disp/test_suite/gui_tests/noe.py (original) +++ branches/relax_disp/test_suite/gui_tests/noe.py Tue Sep 3 18:50:28 2013 @@ -100,33 +100,20 @@ wizard = analysis.peak_wizard # The spectrum. - page = wizard.get_page(wizard.page_indices['read']) - page.uf_args['file'].SetValue(str_to_gui(files[i])) - page.uf_args['spectrum_id'].SetValue(str_to_gui(ids[i])) + wizard.setup_page(page='read', file=files[i], spectrum_id=ids[i]) wizard._go_next(None) - interpreter.flush() # Move down one pages. wizard._go_next(None) # Set the errors. - page = wizard.get_page(wizard.page_indices['rmsd']) - page.uf_args['error'].SetValue(int_to_gui(errors[i])) - - # Apply, then set the individual spin errors. + wizard.setup_page(page='rmsd', error=errors[i]) wizard._apply(None) - interpreter.flush() - page.uf_args['error'].SetValue(int_to_gui(errors_5[i])) - page.uf_args['spin_id'].SetValue(str_to_gui(':5')) - - # Go to the next page. + wizard.setup_page(page='rmsd', error=errors_5[i], spin_id=':5') wizard._go_next(None) - # Set the type. - page = wizard.get_page(wizard.page_indices['spectrum_type']) - page.uf_args['spectrum_type'].SetValue(types[i]) - - # Go to the next page (i.e. finish). + # Set the type and finish. + wizard.setup_page(page='spectrum_type', spectrum_type=types[i]) wizard._go_next(None) # Execute relax.