mailr14058 - /branches/gui_testing/gui/misc.py


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

Header


Content

Posted by edward on August 02, 2011 - 11:50:
Author: bugman
Date: Tue Aug  2 11:50:34 2011
New Revision: 14058

URL: http://svn.gna.org/viewcvs/relax?rev=14058&view=rev
Log:
The gui_to_float() and gui_to_int() functions can now handle float or int 
inputs.


Modified:
    branches/gui_testing/gui/misc.py

Modified: branches/gui_testing/gui/misc.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/misc.py?rev=14058&r1=14057&r2=14058&view=diff
==============================================================================
--- branches/gui_testing/gui/misc.py (original)
+++ branches/gui_testing/gui/misc.py Tue Aug  2 11:50:34 2011
@@ -165,6 +165,10 @@
     if string in ['', u'']:
         return None
 
+    # Already a float.
+    if type(string) == float:
+        return string
+
     # Convert.
     val = eval(string)
 
@@ -188,6 +192,10 @@
     # No input.
     if string in ['', u'']:
         return None
+
+    # Already an int.
+    if type(string) == int:
+        return string
 
     # Convert.
     val = eval(string)




Related Messages


Powered by MHonArc, Updated Tue Aug 02 14:00:01 2011