Author: bugman Date: Thu Jun 23 20:41:34 2011 New Revision: 13197 URL: http://svn.gna.org/viewcvs/relax?rev=13197&view=rev Log: Renamed all execute() methods to on_execute() and update() to on_display(). The calls to update() from execute() have been eliminated. Modified: branches/gui_testing/gui/user_functions/molecule.py branches/gui_testing/gui/user_functions/pipes.py branches/gui_testing/gui/user_functions/relax_data.py branches/gui_testing/gui/user_functions/residue.py branches/gui_testing/gui/user_functions/spin.py branches/gui_testing/gui/user_functions/value.py Modified: branches/gui_testing/gui/user_functions/molecule.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/user_functions/molecule.py?rev=13197&r1=13196&r2=13197&view=diff ============================================================================== --- branches/gui_testing/gui/user_functions/molecule.py (original) +++ branches/gui_testing/gui/user_functions/molecule.py Thu Jun 23 20:41:34 2011 @@ -112,7 +112,7 @@ self.mol_type = self.combo_box(sizer, "The type of molecule:", ALLOWED_MOL_TYPES) - def execute(self): + def on_execute(self): """Execute the user function.""" # Get the name and type. @@ -153,7 +153,7 @@ self.mol_to = self.input_field(sizer, "The new molecule name:", tooltip='If left blank, the new molecule will have the same name as the old.') - def execute(self): + def on_execute(self): """Execute the user function.""" # Get the pipe names. @@ -169,16 +169,9 @@ # Copy the molecule. self.interpreter.molecule.copy(pipe_from=pipe_from, mol_from=mol_from, pipe_to=pipe_to, mol_to=mol_to) - # Update. - self.update(None) - - - def update(self, event): - """Update the UI. - - @param event: The wx event. - @type event: wx event - """ + + def on_display(self): + """Update the pipe name lists.""" # Set the default pipe name. if not gui_to_str(self.pipe_from.GetValue()): @@ -234,7 +227,7 @@ self.mol = self.combo_box(sizer, "The molecule:", []) - def execute(self): + def on_execute(self): """Execute the user function.""" # Get the name. @@ -246,16 +239,9 @@ # Delete the molecule. self.interpreter.molecule.delete(mol_id=id) - # Update. - self.update(None) - - - def update(self, event): - """Update the UI. - - @param event: The wx event. - @type event: wx event - """ + + def on_display(self): + """Clear and update the molecule list.""" # Clear the previous data. self.mol.Clear() Modified: branches/gui_testing/gui/user_functions/pipes.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/user_functions/pipes.py?rev=13197&r1=13196&r2=13197&view=diff ============================================================================== --- branches/gui_testing/gui/user_functions/pipes.py (original) +++ branches/gui_testing/gui/user_functions/pipes.py Thu Jun 23 20:41:34 2011 @@ -119,7 +119,7 @@ self.pipe_type = self.combo_box(sizer, "The type of data pipe:", VALID_TYPES) - def execute(self): + def on_execute(self): """Execute the user function.""" # Get the name and type. @@ -154,7 +154,25 @@ self.pipe_to = self.input_field(sizer, "The destination pipe name:") - def execute(self): + def on_apply(self, event): + """Clear the data is apply was hit. + + @param event: The wx event. + @type event: wx event + """ + + # Clear the previous data. + self.pipe_from.Clear() + + # Clear the pipe name. + self.pipe_from.SetValue('') + + # The list of pipe names. + for name in pipe_names(): + self.pipe_from.Append(name) + + + def on_exit(self): """Execute the user function.""" # Get the pipe names. @@ -164,27 +182,6 @@ # Copy the data pipe. self.interpreter.pipe.copy(pipe_from, pipe_to) - # Update. - self.update(None) - - - def update(self, event): - """Update the UI. - - @param event: The wx event. - @type event: wx event - """ - - # Clear the previous data. - self.pipe_from.Clear() - - # Clear the pipe name. - self.pipe_from.SetValue('') - - # The list of pipe names. - for name in pipe_names(): - self.pipe_from.Append(name) - class Delete_page(UF_page): @@ -207,7 +204,7 @@ self.pipe_name = self.combo_box(sizer, "The pipe:", []) - def execute(self): + def on_execute(self): """Execute the user function.""" # Get the name. @@ -216,16 +213,9 @@ # Delete the data pipe. self.interpreter.pipe.delete(pipe_name) - # Update. - self.update(None) - - - def update(self, event): - """Update the UI. - - @param event: The wx event. - @type event: wx event - """ + + def on_display(self): + """Clear and update the pipe name list.""" # Clear the previous data. self.pipe_name.Clear() @@ -262,7 +252,7 @@ self.pipe_name = self.combo_box(sizer, "The pipe:", []) - def execute(self): + def on_execute(self): """Execute the user function.""" # Get the name. @@ -272,12 +262,8 @@ self.interpreter.pipe.switch(pipe_name) - def update(self, event): - """Update the UI. - - @param event: The wx event. - @type event: wx event - """ + def on_display(self): + """Clear and update the pipe name list and cdp.""" # Clear the previous data. self.pipe_name.Clear() Modified: branches/gui_testing/gui/user_functions/relax_data.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/user_functions/relax_data.py?rev=13197&r1=13196&r2=13197&view=diff ============================================================================== --- branches/gui_testing/gui/user_functions/relax_data.py (original) +++ branches/gui_testing/gui/user_functions/relax_data.py Thu Jun 23 20:41:34 2011 @@ -90,7 +90,7 @@ self.frq_label = self.combo_box(sizer, "The frequency label in MHz:", choices=[]) - def execute(self): + def on_execute(self): """Execute the user function.""" # The labels and frq. @@ -101,12 +101,8 @@ self.interpreter.relax_data.delete(ri_label=ri_label, frq_label=frq_label) - def update(self, event): - """Update the UI. - - @param event: The wx event. - @type event: wx event - """ + def on_display(self): + """Clear previous data and update the label lists.""" # Clear the previous data. self.ri_label.Clear() @@ -159,7 +155,7 @@ self.spin_id = self.input_field(sizer, "Restrict data loading to certain spins:", tooltip="This must be a valid spin ID. Multiple spins can be selected using ranges, the '|' operator, residue ranges, etc.") - def execute(self): + def on_execute(self): """Execute the user function.""" # The labels and frq. Modified: branches/gui_testing/gui/user_functions/residue.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/user_functions/residue.py?rev=13197&r1=13196&r2=13197&view=diff ============================================================================== --- branches/gui_testing/gui/user_functions/residue.py (original) +++ branches/gui_testing/gui/user_functions/residue.py Thu Jun 23 20:41:34 2011 @@ -147,7 +147,7 @@ self.res_name_to = self.input_field(sizer, "The new residue name:", tooltip='If left blank, the new residue will have the same name as the old.') - def execute(self): + def on_execute(self): """Execute the user function.""" # Get the pipe names. @@ -163,16 +163,9 @@ # Copy the molecule. self.interpreter.residue.copy(pipe_from=pipe_from, res_from=res_from, pipe_to=pipe_to, res_to=res_to) - # Update. - self.update(None) - - - def update(self, event): - """Update the UI. - - @param event: The wx event. - @type event: wx event - """ + + def on_display(self): + """Update the pipe name lists.""" # Set the default pipe name. if not gui_to_str(self.pipe_from.GetValue()): @@ -264,7 +257,7 @@ self.res_num = self.input_field(sizer, "The residue number:") - def execute(self): + def on_execute(self): """Execute the user function.""" # The molecule name. @@ -288,12 +281,8 @@ self.interpreter.residue.create(res_name=res_name, res_num=res_num, mol_name=mol_name) - def update(self, event): - """Update the UI. - - @param event: The wx event. - @type event: wx event - """ + def on_display(self): + """Update the molecule list.""" # Clear the previous data. self.mol.Clear() @@ -325,7 +314,7 @@ self.res = self.combo_box(sizer, "The residue:", []) - def execute(self): + def on_execute(self): """Execute the user function.""" # The residue ID. @@ -342,12 +331,8 @@ self._update_residues(None) - def update(self, event): - """Update the UI. - - @param event: The wx event. - @type event: wx event - """ + def on_display(self): + """Clear and update the residue and molecule lists.""" # Clear the previous data. self.mol.Clear() Modified: branches/gui_testing/gui/user_functions/spin.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/user_functions/spin.py?rev=13197&r1=13196&r2=13197&view=diff ============================================================================== --- branches/gui_testing/gui/user_functions/spin.py (original) +++ branches/gui_testing/gui/user_functions/spin.py Thu Jun 23 20:41:34 2011 @@ -169,7 +169,7 @@ self.spin_name_to = self.input_field(sizer, "The new spin name:", tooltip='If left blank, the new spin will have the same name as the old.') - def execute(self): + def on_execute(self): """Execute the user function.""" # Get the pipe names. @@ -185,11 +185,8 @@ # Copy the spin. self.interpreter.spin.copy(pipe_from=pipe_from, spin_from=spin_from, pipe_to=pipe_to, spin_to=spin_to) - # Update. - self.update(None) - - - def update(self, event): + + def on_display(self): """Update the UI. @param event: The wx event. @@ -312,7 +309,7 @@ self.spin_num = self.input_field(sizer, "The spin number:") - def execute(self): + def on_execute(self): """Execute the user function.""" # Get the molecule info. @@ -339,12 +336,8 @@ self.interpreter.spin.create(spin_name=spin_name, spin_num=spin_num, res_name=res_name, res_num=res_num, mol_name=mol_name) - def update(self, event): - """Update the UI. - - @param event: The wx event. - @type event: wx event - """ + def on_display(self): + """Clear all data and then update the list of molecule names.""" # Clear the previous data. self.mol.Clear() @@ -379,7 +372,7 @@ self.spin = self.combo_box(sizer, "The spin:", []) - def execute(self): + def on_execute(self): """Execute the user function.""" # Get the spin ID. @@ -396,12 +389,8 @@ self._update_spins(None) - def update(self, event): - """Update the UI. - - @param event: The wx event. - @type event: wx event - """ + def on_display(self): + """Clear the spin data and update the mol list.""" # Clear the previous data. self.mol.Clear() Modified: branches/gui_testing/gui/user_functions/value.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/user_functions/value.py?rev=13197&r1=13196&r2=13197&view=diff ============================================================================== --- branches/gui_testing/gui/user_functions/value.py (original) +++ branches/gui_testing/gui/user_functions/value.py Thu Jun 23 20:41:34 2011 @@ -82,7 +82,7 @@ self.spin_id = self.input_field(sizer, "Restrict data loading to certain spins:", tooltip="This must be a valid spin ID. Multiple spins can be selected using ranges, the '|' operator, residue ranges, etc.") - def execute(self): + def on_execute(self): """Execute the user function.""" # The parameter and value. @@ -96,12 +96,8 @@ self.interpreter.value.set(val=value, param=param, spin_id=spin_id) - def update(self, event): - """Update the UI. - - @param event: The wx event. - @type event: wx event - """ + def on_display(self): + """Fill out the list of parameters and their descriptions.""" # Get the specific functions. data_names = specific_fns.setup.get_specific_fn('data_names', pipes.get_type(), raise_error=False)