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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Oct 30 08:38:20 EDT 2010


Author: martinl
Date: 2010-10-30 05:38:20 -0700 (Sat, 30 Oct 2010)
New Revision: 44099

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


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py	2010-10-30 12:22:38 UTC (rev 44098)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py	2010-10-30 12:38:20 UTC (rev 44099)
@@ -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:
@@ -888,9 +888,9 @@
             
             # parse command into list
             try:
-                cmd = shlex.split(str(line))
+                cmd = utils.split(str(line))
             except UnicodeError:
-                cmd = shlex.split(utils.EncodeString((line)))
+                cmd = utils.split(utils.EncodeString((line)))
             
             #  send the command list to the processor 
             self.parent.RunCmd(cmd)

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py	2010-10-30 12:22:38 UTC (rev 44098)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py	2010-10-30 12:38:20 UTC (rev 44099)
@@ -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