Author: bugman Date: Thu Jun 23 20:51:19 2011 New Revision: 13201 URL: http://svn.gna.org/viewcvs/relax?rev=13201&view=rev Log: Alphabetical ordering of methods. Modified: branches/gui_testing/gui/user_functions/molecule.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=13201&r1=13200&r2=13201&view=diff ============================================================================== --- branches/gui_testing/gui/user_functions/molecule.py (original) +++ branches/gui_testing/gui/user_functions/molecule.py Thu Jun 23 20:51:19 2011 @@ -153,6 +153,24 @@ 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 on_display(self): + """Update the pipe name lists.""" + + # Set the default pipe name. + if not gui_to_str(self.pipe_from.GetValue()): + self.pipe_from.SetValue(str_to_gui(cdp_name())) + if not gui_to_str(self.pipe_to.GetValue()): + self.pipe_to.SetValue(str_to_gui(cdp_name())) + + # The list of pipe names. + for name in pipe_names(): + self.pipe_from.Append(name) + self.pipe_to.Append(name) + + # Update the molecule list. + self.update_mol_list() + + def on_execute(self): """Execute the user function.""" @@ -170,24 +188,6 @@ self.interpreter.molecule.copy(pipe_from=pipe_from, mol_from=mol_from, pipe_to=pipe_to, mol_to=mol_to) - def on_display(self): - """Update the pipe name lists.""" - - # Set the default pipe name. - if not gui_to_str(self.pipe_from.GetValue()): - self.pipe_from.SetValue(str_to_gui(cdp_name())) - if not gui_to_str(self.pipe_to.GetValue()): - self.pipe_to.SetValue(str_to_gui(cdp_name())) - - # The list of pipe names. - for name in pipe_names(): - self.pipe_from.Append(name) - self.pipe_to.Append(name) - - # Update the molecule list. - self.update_mol_list() - - def update_mol_list(self, event=None): """Update the list of molecules. @@ -227,19 +227,6 @@ self.mol = self.combo_box(sizer, "The molecule:", []) - def on_execute(self): - """Execute the user function.""" - - # Get the name. - mol_name = str(self.mol.GetValue()) - - # The molecule ID. - id = generate_spin_id(mol_name=mol_name) - - # Delete the molecule. - self.interpreter.molecule.delete(mol_id=id) - - def on_display(self): """Clear and update the molecule list.""" @@ -250,3 +237,16 @@ if cdp_name(): for mol in molecule_loop(): self.mol.Append(mol.name) + + + def on_execute(self): + """Execute the user function.""" + + # Get the name. + mol_name = str(self.mol.GetValue()) + + # The molecule ID. + id = generate_spin_id(mol_name=mol_name) + + # Delete the molecule. + self.interpreter.molecule.delete(mol_id=id) 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=13201&r1=13200&r2=13201&view=diff ============================================================================== --- branches/gui_testing/gui/user_functions/residue.py (original) +++ branches/gui_testing/gui/user_functions/residue.py Thu Jun 23 20:51:19 2011 @@ -147,6 +147,24 @@ 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 on_display(self): + """Update the pipe name lists.""" + + # Set the default pipe name. + if not gui_to_str(self.pipe_from.GetValue()): + self.pipe_from.SetValue(str_to_gui(cdp_name())) + if not gui_to_str(self.pipe_to.GetValue()): + self.pipe_to.SetValue(str_to_gui(cdp_name())) + + # The list of pipe names. + for name in pipe_names(): + self.pipe_from.Append(name) + self.pipe_to.Append(name) + + # Update the molecule list. + self.update_mol_list() + + def on_execute(self): """Execute the user function.""" @@ -164,24 +182,6 @@ self.interpreter.residue.copy(pipe_from=pipe_from, res_from=res_from, pipe_to=pipe_to, res_to=res_to) - def on_display(self): - """Update the pipe name lists.""" - - # Set the default pipe name. - if not gui_to_str(self.pipe_from.GetValue()): - self.pipe_from.SetValue(str_to_gui(cdp_name())) - if not gui_to_str(self.pipe_to.GetValue()): - self.pipe_to.SetValue(str_to_gui(cdp_name())) - - # The list of pipe names. - for name in pipe_names(): - self.pipe_from.Append(name) - self.pipe_to.Append(name) - - # Update the molecule list. - self.update_mol_list() - - def update_mol_list(self, event=None): """Update the list of molecules. @@ -255,6 +255,18 @@ # The type selection. self.res_num = self.input_field(sizer, "The residue number:") + + + def on_display(self): + """Update the molecule list.""" + + # Clear the previous data. + self.mol.Clear() + + # The list of molecule names. + if cdp_name(): + for mol in molecule_loop(): + self.mol.Append(mol.name) def on_execute(self): @@ -281,11 +293,33 @@ self.interpreter.residue.create(res_name=res_name, res_num=res_num, mol_name=mol_name) + +class Delete_page(UF_page, Mol_res_spin): + """The residue.delete() user function page.""" + + # Some class variables. + image_path = WIZARD_IMAGE_PATH + 'residue.png' + main_text = 'This dialog allows you to delete residues from the relax data store. The residue will be deleted from the current data pipe.' + title = 'Residue deletion' + + def add_contents(self, sizer): + """Add the residue specific GUI elements. + + @param sizer: A sizer object. + @type sizer: wx.Sizer instance + """ + + # The residue selection. + self.mol = self.combo_box(sizer, "The molecule:", [], self._update_residues) + self.res = self.combo_box(sizer, "The residue:", []) + + def on_display(self): - """Update the molecule list.""" + """Clear and update the residue and molecule lists.""" # Clear the previous data. self.mol.Clear() + self.res.Clear() # The list of molecule names. if cdp_name(): @@ -293,27 +327,6 @@ self.mol.Append(mol.name) - -class Delete_page(UF_page, Mol_res_spin): - """The residue.delete() user function page.""" - - # Some class variables. - image_path = WIZARD_IMAGE_PATH + 'residue.png' - main_text = 'This dialog allows you to delete residues from the relax data store. The residue will be deleted from the current data pipe.' - title = 'Residue deletion' - - def add_contents(self, sizer): - """Add the residue specific GUI elements. - - @param sizer: A sizer object. - @type sizer: wx.Sizer instance - """ - - # The residue selection. - self.mol = self.combo_box(sizer, "The molecule:", [], self._update_residues) - self.res = self.combo_box(sizer, "The residue:", []) - - def on_execute(self): """Execute the user function.""" @@ -329,16 +342,3 @@ # Update. self._update_residues(None) - - - def on_display(self): - """Clear and update the residue and molecule lists.""" - - # Clear the previous data. - self.mol.Clear() - self.res.Clear() - - # The list of molecule names. - if cdp_name(): - for mol in molecule_loop(): - self.mol.Append(mol.name) 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=13201&r1=13200&r2=13201&view=diff ============================================================================== --- branches/gui_testing/gui/user_functions/spin.py (original) +++ branches/gui_testing/gui/user_functions/spin.py Thu Jun 23 20:51:19 2011 @@ -169,6 +169,28 @@ 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 on_display(self): + """Update the UI. + + @param event: The wx event. + @type event: wx event + """ + + # Set the default pipe name. + if not gui_to_str(self.pipe_from.GetValue()): + self.pipe_from.SetValue(str_to_gui(cdp_name())) + if not gui_to_str(self.pipe_to.GetValue()): + self.pipe_to.SetValue(str_to_gui(cdp_name())) + + # The list of pipe names. + for name in pipe_names(): + self.pipe_from.Append(name) + self.pipe_to.Append(name) + + # Update the molecule list. + self.update_mol_list() + + def on_execute(self): """Execute the user function.""" @@ -186,28 +208,6 @@ self.interpreter.spin.copy(pipe_from=pipe_from, spin_from=spin_from, pipe_to=pipe_to, spin_to=spin_to) - def on_display(self): - """Update the UI. - - @param event: The wx event. - @type event: wx event - """ - - # Set the default pipe name. - if not gui_to_str(self.pipe_from.GetValue()): - self.pipe_from.SetValue(str_to_gui(cdp_name())) - if not gui_to_str(self.pipe_to.GetValue()): - self.pipe_to.SetValue(str_to_gui(cdp_name())) - - # The list of pipe names. - for name in pipe_names(): - self.pipe_from.Append(name) - self.pipe_to.Append(name) - - # Update the molecule list. - self.update_mol_list() - - def update_mol_list(self, event=None): """Update the list of molecules. @@ -307,6 +307,19 @@ # The type selection. self.spin_num = self.input_field(sizer, "The spin number:") + + + def on_display(self): + """Clear all data and then update the list of molecule names.""" + + # Clear the previous data. + self.mol.Clear() + self.res.Clear() + + # The list of molecule names. + if cdp_name(): + for mol in molecule_loop(): + self.mol.Append(mol.name) def on_execute(self): @@ -336,12 +349,36 @@ self.interpreter.spin.create(spin_name=spin_name, spin_num=spin_num, res_name=res_name, res_num=res_num, mol_name=mol_name) + +class Delete_page(UF_page, Mol_res_spin): + """The spin.delete() user function page.""" + + # Some class variables. + image_path = WIZARD_IMAGE_PATH + 'spin.png' + main_text = 'This dialog allows you to delete spins from the relax data store. The spin will be deleted from the current data pipe.' + title = 'Spin deletion' + + + def add_contents(self, sizer): + """Add the spin specific GUI elements. + + @param sizer: A sizer object. + @type sizer: wx.Sizer instance + """ + + # Molecule, residue and spin selections. + self.mol = self.combo_box(sizer, "The molecule:", [], self._update_residues) + self.res = self.combo_box(sizer, "The residue:", [], self._update_spins) + self.spin = self.combo_box(sizer, "The spin:", []) + + def on_display(self): - """Clear all data and then update the list of molecule names.""" + """Clear the spin data and update the mol list.""" # Clear the previous data. self.mol.Clear() self.res.Clear() + self.spin.Clear() # The list of molecule names. if cdp_name(): @@ -349,29 +386,6 @@ self.mol.Append(mol.name) - -class Delete_page(UF_page, Mol_res_spin): - """The spin.delete() user function page.""" - - # Some class variables. - image_path = WIZARD_IMAGE_PATH + 'spin.png' - main_text = 'This dialog allows you to delete spins from the relax data store. The spin will be deleted from the current data pipe.' - title = 'Spin deletion' - - - def add_contents(self, sizer): - """Add the spin specific GUI elements. - - @param sizer: A sizer object. - @type sizer: wx.Sizer instance - """ - - # Molecule, residue and spin selections. - self.mol = self.combo_box(sizer, "The molecule:", [], self._update_residues) - self.res = self.combo_box(sizer, "The residue:", [], self._update_spins) - self.spin = self.combo_box(sizer, "The spin:", []) - - def on_execute(self): """Execute the user function.""" @@ -387,17 +401,3 @@ # Update the spin list. self._update_spins(None) - - - def on_display(self): - """Clear the spin data and update the mol list.""" - - # Clear the previous data. - self.mol.Clear() - self.res.Clear() - self.spin.Clear() - - # The list of molecule names. - if cdp_name(): - for mol in molecule_loop(): - self.mol.Append(mol.name) 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=13201&r1=13200&r2=13201&view=diff ============================================================================== --- branches/gui_testing/gui/user_functions/value.py (original) +++ branches/gui_testing/gui/user_functions/value.py Thu Jun 23 20:51:19 2011 @@ -82,20 +82,6 @@ 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 on_execute(self): - """Execute the user function.""" - - # The parameter and value. - param = gui_to_str(self.param.GetValue()) - value = gui_to_str(self.value.GetValue()) - - # The spin ID. - spin_id = gui_to_str(self.spin_id.GetValue()) - - # Set the value. - self.interpreter.value.set(val=value, param=param, spin_id=spin_id) - - def on_display(self): """Fill out the list of parameters and their descriptions.""" @@ -115,3 +101,16 @@ # # Append the description. # self.param.Append(str_to_gui(desc), name) + + def on_execute(self): + """Execute the user function.""" + + # The parameter and value. + param = gui_to_str(self.param.GetValue()) + value = gui_to_str(self.value.GetValue()) + + # The spin ID. + spin_id = gui_to_str(self.spin_id.GetValue()) + + # Set the value. + self.interpreter.value.set(val=value, param=param, spin_id=spin_id)