[GRASS-SVN] r73426 - grass/branches/releasebranch_7_2/scripts/i.colors.enhance
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Sep 26 14:31:27 PDT 2018
Author: lucadelu
Date: 2018-09-26 14:31:27 -0700 (Wed, 26 Sep 2018)
New Revision: 73426
Modified:
grass/branches/releasebranch_7_2/scripts/i.colors.enhance/i.colors.enhance.py
Log:
i.colors.enhance: check for not existing maps, see #2984
Modified: grass/branches/releasebranch_7_2/scripts/i.colors.enhance/i.colors.enhance.py
===================================================================
--- grass/branches/releasebranch_7_2/scripts/i.colors.enhance/i.colors.enhance.py 2018-09-26 21:30:36 UTC (rev 73425)
+++ grass/branches/releasebranch_7_2/scripts/i.colors.enhance/i.colors.enhance.py 2018-09-26 21:31:27 UTC (rev 73426)
@@ -70,6 +70,7 @@
import sys
import grass.script as gscript
+from grass.pygrass.raster import RasterRow
try:
# new for python 2.6, in 2.5 it may be easy_install'd.
@@ -129,6 +130,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