[GRASS-SVN] r44413 - grass/trunk/scripts/r.mask
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Nov 25 04:01:10 EST 2010
Author: martinl
Date: 2010-11-25 01:01:09 -0800 (Thu, 25 Nov 2010)
New Revision: 44413
Modified:
grass/trunk/scripts/r.mask/r.mask.py
Log:
fix #1224
Modified: grass/trunk/scripts/r.mask/r.mask.py
===================================================================
--- grass/trunk/scripts/r.mask/r.mask.py 2010-11-25 08:32:04 UTC (rev 44412)
+++ grass/trunk/scripts/r.mask/r.mask.py 2010-11-25 09:01:09 UTC (rev 44413)
@@ -76,12 +76,15 @@
grass.run_command('g.remove', rast = 'MASK')
grass.message(_("Raster MASK removed"))
else:
- grass.warning(_("No existing MASK to remove"))
+ grass.fatal(_("No existing MASK to remove"))
else:
- if exists and not grass.overwrite():
- grass.fatal(_("MASK already found in current mapset. Delete first or overwrite"))
+ if exists:
+ if not grass.overwrite():
+ grass.fatal(_("MASK already found in current mapset. Delete first or overwrite."))
+ else:
+ grass.warning(_("MASK already exists and will be overwritten"))
- p = grass.feed_command('r.reclass', input = input, output = 'MASK', overwrite = True)
+ p = grass.feed_command('r.reclass', input = input, output = 'MASK', overwrite = True, rules = '-')
p.stdin.write("%s = 1" % maskcats)
p.stdin.close()
p.wait()
More information about the grass-commit
mailing list