[GRASS-SVN] r69778 - grass/branches/releasebranch_7_2/scripts/r.mask

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 5 20:09:16 PDT 2016


Author: annakrat
Date: 2016-11-05 20:09:16 -0700 (Sat, 05 Nov 2016)
New Revision: 69778

Modified:
   grass/branches/releasebranch_7_2/scripts/r.mask/r.mask.py
Log:
r.mask: ignore case when removing mask for Windows (merged from trunk, r69607)

Modified: grass/branches/releasebranch_7_2/scripts/r.mask/r.mask.py
===================================================================
--- grass/branches/releasebranch_7_2/scripts/r.mask/r.mask.py	2016-11-05 22:37:48 UTC (rev 69777)
+++ grass/branches/releasebranch_7_2/scripts/r.mask/r.mask.py	2016-11-06 03:09:16 UTC (rev 69778)
@@ -67,6 +67,7 @@
 #%end
 
 import os
+import sys
 import atexit
 
 import grass.script as grass
@@ -101,8 +102,12 @@
     if remove:
         # -> remove
         if exists:
-            grass.run_command('g.remove', flags='f', quiet=True,
-                              type='raster', name='MASK')
+            if sys.platform == 'win32':
+                grass.run_command('g.remove', flags='if', quiet=True,
+                                  type='raster', name='MASK')
+            else:
+                grass.run_command('g.remove', flags='f', quiet=True,
+                                  type='raster', name='MASK')
             grass.message(_("Raster MASK removed"))
         else:
             grass.fatal(_("No existing MASK to remove"))



More information about the grass-commit mailing list