Ver código fonte

i.colors.enhance: check for not existing maps, see https://trac.osgeo.org/grass/ticket/2984

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73423 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi 6 anos atrás
pai
commit
e2301fd7f0
1 arquivos alterados com 8 adições e 0 exclusões
  1. 8 0
      scripts/i.colors.enhance/i.colors.enhance.py

+ 8 - 0
scripts/i.colors.enhance/i.colors.enhance.py

@@ -70,6 +70,7 @@
 import sys
 
 import grass.script as gscript
+from grass.pygrass.raster import RasterRow
 
 # i18N
 import os
@@ -134,6 +135,13 @@ def main():
     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" ?