[prev in list] [next in list] [prev in thread] [next in thread]
List: grass-commit
Subject: [GRASS-SVN] r44105 - in grass/branches/releasebranch_6_4:
From: svn_grass () osgeo ! org
Date: 2010-10-30 16:01:17
Message-ID: 20101030160117.1F5BE3901F0 () trac ! osgeo ! org
[Download RAW message or body]
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
_______________________________________________
grass-commit mailing list
grass-commit@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-commit
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic