Author: bugman Date: Fri May 18 09:48:22 2012 New Revision: 16326 URL: http://svn.gna.org/viewcvs/relax?rev=16326&view=rev Log: The free file format object can now be remotely controlled in the auto-generated user functions. This allows the test suite to set these values. For this, a special Free_file_format.SetValue() method was created, and the user function SetValue() method will call this when needed. Modified: branches/uf_redesign/gui/components/free_file_format.py branches/uf_redesign/gui/uf_objects.py Modified: branches/uf_redesign/gui/components/free_file_format.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/components/free_file_format.py?rev=16326&r1=16325&r2=16326&view=diff ============================================================================== --- branches/uf_redesign/gui/components/free_file_format.py (original) +++ branches/uf_redesign/gui/components/free_file_format.py Fri May 18 09:48:22 2012 @@ -182,6 +182,28 @@ return settings + def SetValue(self, key, value): + """Special method for setting the value of the GUI element corresponding to the key. + + @param key: The key corresponding to the desired GUI element. This can be one of ['spin_id_col', 'mol_name_col', 'res_num_col', 'res_name_col', 'spin_num_col', 'spin_name_col', 'data_col', 'error_col', 'sep']. + @type key: str + @param value: The value that the specific GUI element's SetValue() method expects. + @type value: unknown + """ + + # Get the element. + obj = getattr(self, key) + + # Convert the data. + if key == 'sep': + value = str_to_gui(value) + else: + value = int_to_gui(value) + + # Set the value. + obj.SetValue(value) + + def reset(self, event): """Reset the free file format widget contents to the original values. Modified: branches/uf_redesign/gui/uf_objects.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/uf_objects.py?rev=16326&r1=16325&r2=16326&view=diff ============================================================================== --- branches/uf_redesign/gui/uf_objects.py (original) +++ branches/uf_redesign/gui/uf_objects.py Fri May 18 09:48:22 2012 @@ -351,8 +351,13 @@ @type value: unknown """ + # Handle the free file format args (for external control, i.e. via the test suite). + if key in ['spin_id_col', 'mol_name_col', 'res_num_col', 'res_name_col', 'spin_num_col', 'spin_name_col', 'data_col', 'error_col', 'sep']: + self.uf_args['free_file_format'].SetValue(key, value) + # Call the argument element's method. - self.uf_args[key].SetValue(value) + else: + self.uf_args[key].SetValue(value) def add_contents(self, sizer):