mailr12033 - /branches/bieri_gui/gui_bieri/misc.py


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

Header


Content

Posted by edward on December 30, 2010 - 12:56:
Author: bugman
Date: Thu Dec 30 12:56:53 2010
New Revision: 12033

URL: http://svn.gna.org/viewcvs/relax?rev=12033&view=rev
Log:
Added the gui_to_str() and str_to_gui() functions to the misc module.


Modified:
    branches/bieri_gui/gui_bieri/misc.py

Modified: branches/bieri_gui/gui_bieri/misc.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/misc.py?rev=12033&r1=12032&r2=12033&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/misc.py (original)
+++ branches/bieri_gui/gui_bieri/misc.py Thu Dec 30 12:56:53 2010
@@ -84,7 +84,37 @@
 
     # No input.
     if num == None:
-        return ''
+        num = ''
 
     # Convert.
-    return str(num)
+    return unicode(num)
+
+
+def gui_to_str(string):
+    """Convert the GUI obtained string to a string.
+
+    @param string:  The number in string form.
+    @type string:   str
+    @return:        The string.
+    @rtype:         str
+    """
+
+    # Convert.
+    return str(string)
+
+
+def str_to_gui(string):
+    """Convert the string into the GUI string.
+
+    @param num:     The number in int or None form.
+    @type num:      int or None
+    @return:        The GUI string.
+    @rtype:         str
+    """
+
+    # No input.
+    if string == None:
+        string = ''
+
+    # Convert.
+    return unicode(string)




Related Messages


Powered by MHonArc, Updated Thu Dec 30 13:00:02 2010