[GRASS-SVN] r69779 - grass/branches/releasebranch_7_0/scripts/r.mask

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 5 20:11:39 PDT 2016


Author: annakrat
Date: 2016-11-05 20:11:39 -0700 (Sat, 05 Nov 2016)
New Revision: 69779

Modified:
   grass/branches/releasebranch_7_0/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_0/scripts/r.mask/r.mask.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/r.mask/r.mask.py	2016-11-06 03:09:16 UTC (rev 69778)
+++ grass/branches/releasebranch_7_0/scripts/r.mask/r.mask.py	2016-11-06 03:11:39 UTC (rev 69779)
@@ -67,6 +67,7 @@
 #%end
 
 import os
+import sys
 import atexit
 
 import grass.script as grass
@@ -100,8 +101,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