[GRASS-SVN] r73423 - grass/trunk/scripts/i.colors.enhance

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 26 14:15:11 PDT 2018


Author: lucadelu
Date: 2018-09-26 14:15:11 -0700 (Wed, 26 Sep 2018)
New Revision: 73423

Modified:
   grass/trunk/scripts/i.colors.enhance/i.colors.enhance.py
Log:
i.colors.enhance: check for not existing maps, see #2984

Modified: grass/trunk/scripts/i.colors.enhance/i.colors.enhance.py
===================================================================
--- grass/trunk/scripts/i.colors.enhance/i.colors.enhance.py	2018-09-26 20:48:15 UTC (rev 73422)
+++ grass/trunk/scripts/i.colors.enhance/i.colors.enhance.py	2018-09-26 21:15:11 UTC (rev 73423)
@@ -70,6 +70,7 @@
 import sys
 
 import grass.script as gscript
+from grass.pygrass.raster import RasterRow
 
 # i18N
 import os
@@ -134,6 +135,13 @@
     if flags['s']:
         do_mp = False
 
+    check = True
+    for m in [red, green, blue]:
+        if not RasterRow(m).exist():
+            check = False
+            gscript.warning("Raster map <{}> not found ".format(m))
+    if not check:
+        gscript.fatal("At least one of the input raster map was not found")
     # 90 or 98? MAX value controls brightness
     # think of percent (0-100), must be positive or 0
     # must be more than "2" ?



More information about the grass-commit mailing list