[GRASS-SVN] r44105 - in grass/branches/releasebranch_6_4:
gui/wxpython/gui_modules lib/python
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Oct 30 12:01:17 EDT 2010
Author: martinl
Date: 2010-10-30 09:01:17 -0700 (Sat, 30 Oct 2010)
New Revision: 44105
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py
grass/branches/releasebranch_6_4/lib/python/core.py
Log:
grass.find_program(): Windows-related fix
(merge r44102 devbr6)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py 2010-10-30 16:00:18 UTC (rev 44104)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py 2010-10-30 16:01:17 UTC (rev 44105)
@@ -700,7 +700,8 @@
self.cmd_output_timer.Stop()
# set focus on prompt
- if self.parent.GetName() == "LayerManager":
+ if self.parent.GetName() == "LayerManager" and \
+ event.cmd[0] in globalvar.grassCmd['all']:
self.btn_abort.Enable(False)
display = self.parent.GetLayerTree().GetMapDisplay()
if display and display.IsAutoRendered():
Modified: grass/branches/releasebranch_6_4/lib/python/core.py
===================================================================
--- grass/branches/releasebranch_6_4/lib/python/core.py 2010-10-30 16:00:18 UTC (rev 44104)
+++ grass/branches/releasebranch_6_4/lib/python/core.py 2010-10-30 16:01:17 UTC (rev 44105)
@@ -767,19 +767,25 @@
# find a program (replacement for "which")
def find_program(pgm, args = []):
- """!Attempt to run a program, with optional arguments. Return False
- if the attempt failed due to a missing executable, True otherwise
+ """!Attempt to run a program, with optional arguments.
@param pgm program name
@param args list of arguments
+
+ @return False if the attempt failed due to a missing executable
+ @return True otherwise
"""
nuldev = file(os.devnull, 'w+')
try:
- call([pgm] + args, stdin = nuldev, stdout = nuldev, stderr = nuldev)
- found = True
+ ret = call([pgm] + args, stdin = nuldev, stdout = nuldev, stderr = nuldev)
+ if ret == 0:
+ found = True
+ else:
+ found = False
except:
found = False
nuldev.close()
+
return found
# try to remove a file, without complaints
More information about the grass-commit
mailing list