[GRASS-SVN] r56856 - grass-addons/grass7/raster/r.hazard.flood

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 20 19:55:40 PDT 2013


Author: hamish
Date: 2013-06-20 19:55:40 -0700 (Thu, 20 Jun 2013)
New Revision: 56856

Modified:
   grass-addons/grass7/raster/r.hazard.flood/r.hazard.flood.py
Log:
sync with grass6 version

Modified: grass-addons/grass7/raster/r.hazard.flood/r.hazard.flood.py
===================================================================
--- grass-addons/grass7/raster/r.hazard.flood/r.hazard.flood.py	2013-06-21 02:55:25 UTC (rev 56855)
+++ grass-addons/grass7/raster/r.hazard.flood/r.hazard.flood.py	2013-06-21 02:55:40 UTC (rev 56856)
@@ -51,9 +51,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."
@@ -61,9 +61,9 @@
 
 def main():
 
-    #### check for r.area
-    if not grass.find_program('r.area'):
-        grass.fatal(_("'r.area' program not found, install it first:") +
+    #### check if we have the r.area addon
+    if not grass.find_program('r.area', ['help']):
+        grass.fatal(_("The 'r.area' module was not found, install it first:") +
                     "\n" +
                     "g.extension r.area")
 
@@ -138,7 +138,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()



More information about the grass-commit mailing list