Explorar o código

test if mask map exists; fix appended messages

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38661 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler %!s(int64=16) %!d(string=hai) anos
pai
achega
fe8c6de302
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      scripts/r.mask/r.mask.py

+ 6 - 2
scripts/r.mask/r.mask.py

@@ -60,6 +60,10 @@ def main():
     if not remove and not input:
 	grass.fatal(_("Required parameter <input> not set"))
 
+    #check if input file exists
+    if not grass.find_file(input)['file'] and not remove:
+        grass.fatal(_("<%s> does not exist.") % input)
+
     mapset = grass.gisenv()['MAPSET']
     exists = bool(grass.find_file('MASK', element = 'cell', mapset = mapset)['file'])
 
@@ -88,8 +92,8 @@ def main():
 	else:
 	    grass.message(_("MASK created."))
 
-        grass.message(_("All subsequent raster operations will be limited to MASK area") +
-		      "Removing or renaming raster file named MASK will" +
+        grass.message(_("All subsequent raster operations will be limited to MASK area. ") +
+		      "Removing or renaming raster file named MASK will " +
 		      "restore raster operations to normal")
 
 if __name__ == "__main__":