[GRASS-SVN] r42294 - grass/trunk/scripts/r.buffer

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 18 08:31:08 EDT 2010


Author: martinl
Date: 2010-05-18 08:31:08 -0400 (Tue, 18 May 2010)
New Revision: 42294

Modified:
   grass/trunk/scripts/r.buffer/r.buffer.py
Log:
r.buffer: fix cleanup() - remove only existing files


Modified: grass/trunk/scripts/r.buffer/r.buffer.py
===================================================================
--- grass/trunk/scripts/r.buffer/r.buffer.py	2010-05-18 12:19:14 UTC (rev 42293)
+++ grass/trunk/scripts/r.buffer/r.buffer.py	2010-05-18 12:31:08 UTC (rev 42294)
@@ -74,8 +74,10 @@
 
 # what to do in case of user break:
 def cleanup():
-    grass.run_command('g.remove', quiet = True, flags = 'f', rast = temp_src)
-    grass.run_command('g.remove', quiet = True, flags = 'f', rast = temp_dist)
+    if grass.find_file(temp_src)['file']:
+        grass.run_command('g.remove', quiet = True, flags = 'f', rast = temp_src)
+    if grass.find_file(temp_dist)['file']:
+        grass.run_command('g.remove', quiet = True, flags = 'f', rast = temp_dist)
 
 def main():
     global temp_dist, temp_src



More information about the grass-commit mailing list