[GRASS-SVN] r73424 - grass/branches/releasebranch_7_6/scripts/i.colors.enhance

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 26 14:30:24 PDT 2018


Author: lucadelu
Date: 2018-09-26 14:30:24 -0700 (Wed, 26 Sep 2018)
New Revision: 73424

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

Modified: grass/branches/releasebranch_7_6/scripts/i.colors.enhance/i.colors.enhance.py
===================================================================
--- grass/branches/releasebranch_7_6/scripts/i.colors.enhance/i.colors.enhance.py	2018-09-26 21:15:11 UTC (rev 73423)
+++ grass/branches/releasebranch_7_6/scripts/i.colors.enhance/i.colors.enhance.py	2018-09-26 21:30:24 UTC (rev 73424)
@@ -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