[GRASS-SVN] r42376 - grass/branches/develbranch_6/lib/python

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 29 07:57:45 EDT 2010


Author: martinl
Date: 2010-05-29 07:57:45 -0400 (Sat, 29 May 2010)
New Revision: 42376

Modified:
   grass/branches/develbranch_6/lib/python/raster.py
Log:
fix r42373


Modified: grass/branches/develbranch_6/lib/python/raster.py
===================================================================
--- grass/branches/develbranch_6/lib/python/raster.py	2010-05-29 11:55:16 UTC (rev 42375)
+++ grass/branches/develbranch_6/lib/python/raster.py	2010-05-29 11:57:45 UTC (rev 42376)
@@ -83,10 +83,17 @@
     """
     t = string.Template(exp)
     e = t.substitute(**kwargs)
-    for key in kwargs.keys():
-        if key in ['overwrite', 'quiet', 'verbose']:
-            continue
-        del kwargs[key]
+    verbose = os.getenv('GRASS_VERBOSE')
+    if kwargs.has_key('quiet') and kwargs['quiet']:
+        os.environ['GRASS_VERBOSE'] = '0'
+    if kwargs.has_key('verbose') and kwargs['verbose']:
+        os.environ['GRASS_VERBOSE'] = '3'
     
     if write_command('r.mapcalc', stdin = e) != 0:
 	fatal("An error occurred while running r.mapcalc")
+    
+    if verbose:
+        os.environ['GRASS_VERBOSE'] = verbose
+    elif os.getenv('GRASS_VERBOSE'):
+        del os.environ['GRASS_VERBOSE']
+    



More information about the grass-commit mailing list