mailr15755 - /1.3/gui/user_functions/residue.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on April 17, 2012 - 15:50:
Author: bugman
Date: Tue Apr 17 15:50:47 2012
New Revision: 15755

URL: http://svn.gna.org/viewcvs/relax?rev=15755&view=rev
Log:
Fix for the residue.create user function GUI front end along the same lines 
as the spin.create fn.

The unnamed molecules are now properly handled, and the gui_to_*() methods 
are now used for data
conversion.


Modified:
    1.3/gui/user_functions/residue.py

Modified: 1.3/gui/user_functions/residue.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/user_functions/residue.py?rev=15755&r1=15754&r2=15755&view=diff
==============================================================================
--- 1.3/gui/user_functions/residue.py (original)
+++ 1.3/gui/user_functions/residue.py Tue Apr 17 15:50:47 2012
@@ -32,7 +32,7 @@
 
 # GUI module imports.
 from base import UF_base, UF_page
-from gui.misc import gui_to_str, str_to_gui
+from gui.misc import gui_to_int, gui_to_str, str_to_gui
 from gui.paths import WIZARD_IMAGE_PATH
 from gui.user_functions.mol_res_spin import Mol_res_spin
 
@@ -254,7 +254,8 @@
         # The list of molecule names.
         if cdp_name():
             for mol in molecule_loop():
-                self.mol_name.Append(str_to_gui(mol.name))
+                if mol.name != None:
+                    self.mol_name.Append(str_to_gui(mol.name))
 
         # The default molecule.
         if self.defaults.has_key('mol_name') and self.defaults['mol_name']:
@@ -264,22 +265,10 @@
     def on_execute(self):
         """Execute the user function."""
 
-        # The molecule name.
-        mol_name = str(self.mol_name.GetValue())
-        if mol_name == '':
-            mol_name = None
-
-        # The residue number.
-        res_num = str(self.res_num.GetValue())
-        if res_num == '':
-            res_num = None
-        else:
-            res_num = int(res_num)
-
-        # The residue name.
-        res_name = str(self.res_name.GetValue())
-        if res_num == '':
-            res_num = None
+        # Get the spin info.
+        mol_name = gui_to_str(self.mol_name.GetValue())
+        res_num = gui_to_int(self.res_num.GetValue())
+        res_name = gui_to_str(self.res_name.GetValue())
 
         # Set the name.
         self.execute('residue.create', res_name=res_name, res_num=res_num, 
mol_name=mol_name)




Related Messages


Powered by MHonArc, Updated Tue Apr 17 16:40:02 2012