Hi,
there are new troubles on Windows8, apparently grass.find_program() is failing.
Regularly ".py" application errors pop up, asking to assign a software to this
extension. The real problem may be different, example:
GRASS 7.0.svn> g.manual.py -i
D2/5: filename = C:/OSGeo4W/apps/grass/grass-7.0.svn/scripts/g.manual.py
D2/5: G_file_name(): path = C:\Users\neteler\Documents\GIS DataBase/nc_spm_08_gr
ass7/user1
D2/5: G_file_name(): path = C:\Users\neteler\Documents\GIS DataBase/nc_spm_08_gr
ass7/user1
FEHLER: Browser <explorer> not found
GRASS 7.0.svn>
GRASS 7.0.svn> which explorer.exe
/c/Windows/system32/explorer.exe
Unrelated or not, a recent commit where my test of finding a GRASS module
in order to not crash otherwise was commented out. Certainly I had tested
it and it used to work.
Related to the python version?
GRASS 7.0.svn> python
Python 2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] on win
32
...
GRASS 7.0.svn> which python
/osgeo4w/bin/python.exe
I thought we wanted to use the one from extrabin\ first?
GRASS 7.0.svn> g.version -g
version=7.0.svn
date=2013
revision=56788
build_date=2013-05-19
Markus
On Tue, Jun 18, 2013 at 10:47 AM, <svn_grass@osgeo.org> wrote:
Author: hamish
Date: 2013-06-18 01:47:37 -0700 (Tue, 18 Jun 2013)
New Revision: 56772Modified:
grass-addons/grass6/raster/r.hazard.flood/r.hazard.flood.py
Log:
commented out check for r.area, grass.messageifyModified: grass-addons/grass6/raster/r.hazard.flood/r.hazard.flood.py
--- grass-addons/grass6/raster/r.hazard.flood/r.hazard.flood.py 2013-06-18 08:11:22 UTC (rev 56771)
+++ grass-addons/grass6/raster/r.hazard.flood/r.hazard.flood.py 2013-06-18 08:47:37 UTC (rev 56772)
@@ -50,9 +50,9 @@
import grass.script as grass
except:
try:
- from grass.script import core as grass
+ from grass.script import core as grass
except:
- sys.exit( "grass.script can't be imported.")
+ sys.exit("grass.script can't be imported.")if not os.environ.has_key("GISBASE"):
print "You must be in GRASS GIS to run this program."
@@ -66,6 +66,11 @@
r_flood_map = options['flood']
r_mti = options['mti']+ #FIXME: find_program() not working for modules
+ ## check if we have the r.area addon
+ #if not grass.find_program('r.area'):
+ # grass.fatal(_("The r.area module is required, please install it from Addons first"))
+
# Detect cellsize of the DEM
info_region = grass.read_command('g.region', flags = 'p', rast = '%s' % (r_elevation))
dict_region = grass.parse_key_val(info_region, ':')
@@ -130,7 +135,7 @@
grass.run_command('g.remove', rast = 'r_flood_th')
grass.run_command('g.remove', rast = 'r_flood')- grass.run_command('g.message' , message = 'Done!')
+ grass.message(_('Done.'))if __name__ == "__main__":
options, flags = grass.parser()_______________________________________________
grass-commit mailing list
grass-commit@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-commit