[GRASS-SVN] r38220 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jul 5 05:04:53 EDT 2009


Author: martinl
Date: 2009-07-05 05:04:53 -0400 (Sun, 05 Jul 2009)
New Revision: 38220

Modified:
   grass/trunk/gui/wxpython/gui_modules/goutput.py
   grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: launch script with full path


Modified: grass/trunk/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/goutput.py	2009-07-05 08:42:41 UTC (rev 38219)
+++ grass/trunk/gui/wxpython/gui_modules/goutput.py	2009-07-05 09:04:53 UTC (rev 38220)
@@ -65,7 +65,7 @@
 
     def RunCmd(self, callable, onDone, *args, **kwds):
         CmdThread.requestId += 1
-
+        
         self.requestCmd = None
         self.requestQ.put((CmdThread.requestId, callable, onDone, args, kwds))
         
@@ -78,6 +78,7 @@
             requestTime = time.time()
             event = wxCmdRun(cmd=args[0],
                              pid=requestId)
+            
             wx.PostEvent(self.parent, event)
 
             time.sleep(.1)
@@ -411,12 +412,15 @@
             # console output window
 
             # if command is not a GRASS command, treat it like a shell command
-            try:
-                gcmd.Command(cmdlist,
-                             stdout=self.cmd_stdout,
-                             stderr=self.cmd_stderr)
-            except gcmd.CmdError, e:
-                print >> sys.stderr, e
+            # process GRASS command with argument
+            self.cmdThread.RunCmd(GrassCmd,
+                                  onDone,
+                                  cmdlist,
+                                  self.cmd_stdout, self.cmd_stderr)                                          
+            self.btn_abort.Enable()
+            self.cmd_output_timer.Start(50)
+            
+            return None
         
         return None
 

Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2009-07-05 08:42:41 UTC (rev 38219)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2009-07-05 09:04:53 UTC (rev 38220)
@@ -304,6 +304,7 @@
     for parsed filling.
     """
     def __init__(self, grassModule = None):
+        self.path = grassModule
         self.name = _('unknown')
         self.params = []
         self.description = ''
@@ -825,8 +826,9 @@
                 self.notebookpanel.notebook.SetSelection(self.notebookpanel.goutputId)
             
             try:
+                cmd[0] = self.task.path # full path
                 self.goutput.RunCmd(cmd)
-            except AttributeError,e:
+            except AttributeError, e:
                 print >> sys.stderr, "%s: Propably not running in wxgui.py session?" % (e)
                 print >> sys.stderr, "parent window is: %s" % (str(self.parent))
             # Send any other command to the shell.
@@ -1815,7 +1817,7 @@
         sys.exit()
     if sys.argv[1] != 'test':
         q=wx.LogNull()
-        GrassGUIApp( grassTask( sys.argv[1] ) ).MainLoop()
+        GrassGUIApp(grassTask(sys.argv[1])).MainLoop()
     else: #Test
         # Test grassTask from within a GRASS session
         if os.getenv("GISBASE") is not None:



More information about the grass-commit mailing list