[GRASS-SVN] r47371 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 3 08:51:06 EDT 2011


Author: martinl
Date: 2011-08-03 05:51:06 -0700 (Wed, 03 Aug 2011)
New Revision: 47371

Modified:
   grass/trunk/gui/wxpython/gui_modules/ghelp.py
   grass/trunk/gui/wxpython/gui_modules/utils.py
Log:
wxGUI: replace UnicodeString by DecodeString


Modified: grass/trunk/gui/wxpython/gui_modules/ghelp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/ghelp.py	2011-08-03 12:48:08 UTC (rev 47370)
+++ grass/trunk/gui/wxpython/gui_modules/ghelp.py	2011-08-03 12:51:06 UTC (rev 47371)
@@ -684,7 +684,7 @@
                 gcmd.GError(parent = self,
                             message = _("Error when reading file '%s'.") % translatorsfile + \
                                 "\n\n" + _("Lines:") + " %s" % \
-                                os.linesep.join(map(utils.UnicodeString, errLines)))
+                                os.linesep.join(map(utils.DecodeString, errLines)))
         else:
             contribs = None
         
@@ -740,7 +740,7 @@
                 gcmd.GError(parent = self,
                             message = _("Error when reading file '%s'.") % translatorsfile + \
                                 "\n\n" + _("Lines:") + " %s" % \
-                                os.linesep.join(map(utils.UnicodeString, errLines)))
+                                os.linesep.join(map(utils.DecodeString, errLines)))
         else:
             translators = None
         

Modified: grass/trunk/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/utils.py	2011-08-03 12:48:08 UTC (rev 47370)
+++ grass/trunk/gui/wxpython/gui_modules/utils.py	2011-08-03 12:51:06 UTC (rev 47371)
@@ -683,22 +683,6 @@
     
     return string
 
-def UnicodeString(string):
-    """!Return unicode string
-    
-    @param string string to be converted
-    
-    @return unicode string
-    """
-    if isinstance(string, unicode):
-        return string
-    
-    enc = locale.getdefaultlocale()[1]
-    if enc:
-        return unicode(string, enc)
-    
-    return string
-
 def _getGDALFormats():
     """!Get dictionary of avaialble GDAL drivers"""
     ret = grass.read_command('r.in.gdal',



More information about the grass-commit mailing list