Преглед изворни кода

wxGUI: attempt to fix trac https://trac.osgeo.org/grass/ticket/528 (wxGUI cmd: r.mapcalc fails (quoting + args with spaces)
based on ticket patch


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@37395 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa пре 16 година
родитељ
комит
a04a1cded7
1 измењених фајлова са 9 додато и 6 уклоњено
  1. 9 6
      gui/wxpython/gui_modules/prompt.py

+ 9 - 6
gui/wxpython/gui_modules/prompt.py

@@ -6,7 +6,7 @@
 Classes:
  - GPrompt
 
-(C) 2009 by the GRASS Development Team
+(C) 2008-2009 by the GRASS Development Team
 This program is free software under the GNU General Public
 License (>=v2). Read the file COPYING that comes with GRASS
 for details.
@@ -14,6 +14,8 @@ for details.
 @author Martin Landa <landa.martin gmail.com>
 """
 
+import shlex
+
 import wx
 
 class GPrompt:
@@ -70,15 +72,16 @@ class GPrompt:
         
     def OnRunCmd(self, event):
         """Run command"""
-        cmd = event.GetString()
+        cmdString = event.GetString()
         
         if self.parent.GetName() != "LayerManager":
             return
-
-        if cmd[:2] == 'd.' and not self.parent.curr_page:
+        
+        if cmdString[:2] == 'd.' and not self.parent.curr_page:
             self.parent.NewDisplay(show=True)
-            
-        if len(cmd.split(' ')) > 1:
+        
+        cmd = shlex.split(str(cmdString))
+        if len(cmd) > 1:
             self.parent.goutput.RunCmd(cmd, switchPage = True)
         else:
             self.parent.goutput.RunCmd(cmd, switchPage = False)