[GRASS-SVN] r41397 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Mar 12 08:21:51 EST 2010


Author: martinl
Date: 2010-03-12 08:21:51 -0500 (Fri, 12 Mar 2010)
New Revision: 41397

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gcmd.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py
Log:
bugfix #995
(merge r41390, 41393, 41395, 41396 from relber64)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gcmd.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gcmd.py	2010-03-12 13:19:45 UTC (rev 41396)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gcmd.py	2010-03-12 13:21:51 UTC (rev 41397)
@@ -134,6 +134,18 @@
 
 class Popen(subprocess.Popen):
     """!Subclass subprocess.Popen"""
+    def __init__(self, *args, **kwargs):
+        if subprocess.mswindows:
+            try:
+                kwargs['args'] = map(utils.EncodeString, kwargs['args'])
+            except KeyError:
+                if len(args) > 0:
+                    targs = list(args)
+                    targs[0] = map(utils.EncodeString, args[0])
+                    args = tuple(targs)
+        
+        subprocess.Popen.__init__(self, *args, **kwargs)
+        
     def recv(self, maxsize=None):
         return self._recv('stdout', maxsize)
     

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py	2010-03-12 13:19:45 UTC (rev 41396)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py	2010-03-12 13:21:51 UTC (rev 41397)
@@ -1681,8 +1681,8 @@
         projdesc = self.parent.projpage.projdesc
         ellipsedesc = self.parent.ellipsepage.ellipsedesc
         datumdesc = self.parent.datumpage.datumdesc
-        self.ldatabase.SetLabel(str(database))
-        self.llocation.SetLabel(str(location))
+        self.ldatabase.SetLabel(database)
+        self.llocation.SetLabel(location)
         label = ''
         
         if coordsys == 'epsg':

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py	2010-03-12 13:19:45 UTC (rev 41396)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py	2010-03-12 13:21:51 UTC (rev 41397)
@@ -17,6 +17,7 @@
 import platform
 import string
 import glob
+import locale
 
 import globalvar
 grassPath = os.path.join(globalvar.ETCDIR, "python")
@@ -467,7 +468,7 @@
         return path[1].upper() + ':\\' + path[3:].replace('/', '\\')
     
     return path
-    
+
 def ReadEpsgCodes(path):
     """!Read EPSG code from the file
 
@@ -611,3 +612,16 @@
         return list()
     
     return ret.splitlines()
+
+def EncodeString(string):
+    """!Return encoded string
+
+    @param string string to be encoded
+
+    @return encoded string
+    """
+    enc = locale.getdefaultlocale()[1]
+    if enc:
+        return string.encode(enc)
+    
+    return string



More information about the grass-commit mailing list