mailr13653 - /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 15, 2011 - 16:18:
Author: bugman
Date: Fri Jul 15 16:18:40 2011
New Revision: 13653

URL: http://svn.gna.org/viewcvs/relax?rev=13653&view=rev
Log:
Created the gui_to_list() function for converting the GUI string to a list.


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=13653&r1=13652&r2=13653&view=diff
==============================================================================
--- branches/gui_testing/gui/misc.py (original)
+++ branches/gui_testing/gui/misc.py Fri Jul 15 16:18:40 2011
@@ -199,6 +199,28 @@
     return bool(string)
 
 
+def gui_to_list(string):
+    """Convert the GUI obtained string to a list.
+
+    @param string:  The list in string form.
+    @type string:   str
+    @return:        The list.
+    @rtype:         list
+    """
+
+    # No value.
+    if string == '':
+        return []
+
+    # Convert.
+    val = eval(string)
+    if type(val) != list:
+        val = [val]
+
+    # Return the list.
+    return val
+
+
 def gui_to_str(string):
     """Convert the GUI obtained string to a string.
 




Related Messages


Powered by MHonArc, Updated Fri Jul 15 16:40:02 2011