[GRASS-SVN] r44101 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Oct 30 08:44:23 EDT 2010


Author: martinl
Date: 2010-10-30 05:44:23 -0700 (Sat, 30 Oct 2010)
New Revision: 44101

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/prompt.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py
Log:
wxGUI: use platform specific shlex.split() in command prompt
(merge r44088 from trunk)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/prompt.py	2010-10-30 12:39:03 UTC (rev 44100)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/prompt.py	2010-10-30 12:44:23 UTC (rev 44101)
@@ -613,7 +613,7 @@
         if cmdString[:2] == 'd.' and not self.parent.curr_page:
             self.parent.NewDisplay(show=True)
         
-        cmd = shlex.split(str(cmdString))
+        cmd = utils.split(cmdString)
         if len(cmd) > 1:
             self.parent.RunCmd(cmd, switchPage = True)
         else:

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py	2010-10-30 12:39:03 UTC (rev 44100)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py	2010-10-30 12:44:23 UTC (rev 44101)
@@ -18,6 +18,7 @@
 import string
 import glob
 import locale
+import shlex
 
 import globalvar
 sys.path.append(os.path.join(globalvar.ETCDIR, "python"))
@@ -31,6 +32,10 @@
     """!Remove redundant whitespace from a string"""
     return string.join(string.split(text), ' ')
 
+def split(s):
+    """!Platform spefic shlex.split"""
+    return shlex.split(s, posix = (sys.platform != "win32"))
+
 def GetTempfile(pref=None):
     """
     Creates GRASS temporary file using defined prefix.



More information about the grass-commit mailing list