[GRASS-SVN] r66054 - grass-addons/grass7/raster/r.green/libgreen

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Aug 28 07:31:54 PDT 2015


Author: Giulia
Date: 2015-08-28 07:31:54 -0700 (Fri, 28 Aug 2015)
New Revision: 66054

Modified:
   grass-addons/grass7/raster/r.green/libgreen/utils.py
Log:
r.green: change the clean-up function

Modified: grass-addons/grass7/raster/r.green/libgreen/utils.py
===================================================================
--- grass-addons/grass7/raster/r.green/libgreen/utils.py	2015-08-28 14:31:20 UTC (rev 66053)
+++ grass-addons/grass7/raster/r.green/libgreen/utils.py	2015-08-28 14:31:54 UTC (rev 66054)
@@ -16,13 +16,18 @@
                   'pip install scipy')
 
 
-def cleanup(raster=None, vector=None, debug=False):
+def cleanup(raster=None, vector=None, pattern=None, debug=False):
     """Delete temporary maps"""
     if not debug:
         if raster:
-            gcore.run_command("g.remove", flags="f", type='raster', name=raster)
+            gcore.run_command("g.remove", flags="f", type='raster',
+                              name=raster)
         if vector:
-            gcore.run_command("g.remove", flags="f", type='vector', name=vector)
+            gcore.run_command("g.remove", flags="f", type='vector',
+                              name=vector)
+        if pattern:
+            gcore.run_command("g.remove", flags="f", type='raster,vector',
+                              pattern=pattern)
 
 
 def check_overlay_rv(raster, vector):



More information about the grass-commit mailing list