mailr13382 - /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 July 01, 2011 - 17:41:
Author: bugman
Date: Fri Jul  1 17:41:40 2011
New Revision: 13382

URL: http://svn.gna.org/viewcvs/relax?rev=13382&view=rev
Log:
Created the gui_to_bool() function for converting GUI strings to bools.


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=13382&r1=13381&r2=13382&view=diff
==============================================================================
--- branches/gui_testing/gui/misc.py (original)
+++ branches/gui_testing/gui/misc.py Fri Jul  1 17:41:40 2011
@@ -163,6 +163,23 @@
     return unicode(num)
 
 
+def gui_to_bool(string):
+    """Convert the GUI obtained string to a bool.
+
+    @param string:  The bool in string form.
+    @type string:   str
+    @return:        The bool.
+    @rtype:         bool
+    """
+
+    # No value.
+    if string == '':
+        return None
+
+    # Convert.
+    return bool(string)
+
+
 def gui_to_str(string):
     """Convert the GUI obtained string to a string.
 




Related Messages


Powered by MHonArc, Updated Fri Jul 01 18:00:02 2011