Browse Source

wxGUI: eliminate globalvar.grassCmd['scripts']

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50412 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 years ago
parent
commit
158af6a5ec
2 changed files with 3 additions and 8 deletions
  1. 3 6
      gui/wxpython/core/gcmd.py
  2. 0 2
      gui/wxpython/gui_core/prompt.py

+ 3 - 6
gui/wxpython/core/gcmd.py

@@ -47,6 +47,7 @@ from grass.script import core as grass
 
 from core       import globalvar
 from core.debug import Debug
+from core.utils import GetRealCmd
 
 def DecodeString(string):
     """!Decode string using system encoding
@@ -505,7 +506,7 @@ class CommandThread(Thread):
         args = self.cmd
         if sys.platform == 'win32':
             ext = os.path.splitext(self.cmd[0])[1] == '.py'
-            if ext or self.cmd[0] in globalvar.grassCmd['script']:
+            if ext or self.cmd[0] in globalvar.grassScripts['.py']:
                 os.chdir(os.path.join(os.getenv('GISBASE'), 'scripts'))
                 if not ext:
                     args = [sys.executable, self.cmd[0] + '.py'] + self.cmd[1:]
@@ -632,11 +633,7 @@ def RunCommand(prog, flags = "", overwrite = False, quiet = False, verbose = Fal
     Debug.msg(2, "gcmd.RunCommand(): command started")
     start = time.time()
     
-    if sys.platform == "win32":
-        if prog in globalvar.grassCmd['script']:
-            prog += globalvar.EXT_SCT
-    
-    ps = grass.start_command(prog, flags, overwrite, quiet, verbose, **kwargs)
+    ps = grass.start_command(GetRealCmd(prog), flags, overwrite, quiet, verbose, **kwargs)
     
     if stdin:
         ps.stdin.write(stdin)

+ 0 - 2
gui/wxpython/gui_core/prompt.py

@@ -791,8 +791,6 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
         self.SetCurrentPos(pos)
         
         cmd = text.strip().split(' ')[0]
-        if sys.platform == "win32" and cmd in globalvar.grassCmd['script']:
-            cmd += globalvar.EXT_SCT
         
         if not self.cmdDesc or cmd != self.cmdDesc.get_name():
             if cmd in ('r.mapcalc', 'r3.mapcalc') and \