Author: bugman Date: Tue Sep 3 18:48:16 2013 New Revision: 20780 URL: http://svn.gna.org/viewcvs/relax?rev=20780&view=rev Log: 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. Modified: trunk/gui/wizards/wiz_objects.py Modified: trunk/gui/wizards/wiz_objects.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/wizards/wiz_objects.py?rev=20780&r1=20779&r2=20780&view=diff ============================================================================== --- trunk/gui/wizards/wiz_objects.py (original) +++ trunk/gui/wizards/wiz_objects.py Tue Sep 3 18:48:16 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)