소스 검색

wxGUI: use platform specific shlex.split() in command prompt

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44088 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 년 전
부모
커밋
c1e1fbee19
2개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      gui/wxpython/gui_modules/prompt.py
  2. 5 0
      gui/wxpython/gui_modules/utils.py

+ 1 - 1
gui/wxpython/gui_modules/prompt.py

@@ -613,7 +613,7 @@ class GPrompt(object):
         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:

+ 5 - 0
gui/wxpython/gui_modules/utils.py

@@ -18,6 +18,7 @@ import platform
 import string
 import glob
 import locale
+import shlex
 
 import globalvar
 sys.path.append(os.path.join(globalvar.ETCDIR, "python"))
@@ -31,6 +32,10 @@ def normalize_whitespace(text):
     """!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.