Author: bugman Date: Wed May 28 19:12:21 2014 New Revision: 23562 URL: http://svn.gna.org/viewcvs/relax?rev=23562&view=rev Log: Bug fixes for the Sequence GUI element used for lists in the user function windows. Invalid values input into the Sequence GUI window are now ignored rather than raising different types of error. And invalid input lists for fixed dimension arguments are also ignored. This allows the User_functions.test_structure_add_atom GUI test to pass. Modified: trunk/gui/input_elements/sequence.py Modified: trunk/gui/input_elements/sequence.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/input_elements/sequence.py?rev=23562&r1=23561&r2=23562&view=diff ============================================================================== --- trunk/gui/input_elements/sequence.py (original) +++ trunk/gui/input_elements/sequence.py Wed May 28 19:12:21 2014 @@ -32,6 +32,7 @@ from gui.fonts import font from gui.misc import add_border from gui.string_conv import float_to_gui, gui_to_float, gui_to_int, gui_to_list, gui_to_py, gui_to_str, gui_to_tuple, int_to_gui, list_to_gui, py_to_gui, str_to_gui, tuple_to_gui +from lib.check_types import is_list from lib.errors import RelaxError from status import Status; status = Status() @@ -547,7 +548,11 @@ text = item.GetText() # Store the text. - values.append(self.convert_from_gui(text)) + try: + value = self.convert_from_gui(text) + except: + value = None + values.append(value) # Sequence conversion. if self.seq_type == 'tuple': @@ -577,6 +582,10 @@ # No value. if values == None: + return + + # Invalid list, so do nothing. + if not self.variable_length and is_list(values) and len(values) != self.dim: return # Single values.