[GRASS-SVN] r42375 - grass/branches/releasebranch_6_4/lib/python

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 29 07:55:17 EDT 2010


Author: martinl
Date: 2010-05-29 07:55:16 -0400 (Sat, 29 May 2010)
New Revision: 42375

Modified:
   grass/branches/releasebranch_6_4/lib/python/raster.py
Log:
pythonlib: don't ignore verbose/quiet/overwrite in mapcalc()


Modified: grass/branches/releasebranch_6_4/lib/python/raster.py
===================================================================
--- grass/branches/releasebranch_6_4/lib/python/raster.py	2010-05-29 11:42:59 UTC (rev 42374)
+++ grass/branches/releasebranch_6_4/lib/python/raster.py	2010-05-29 11:55:16 UTC (rev 42375)
@@ -84,5 +84,17 @@
     """
     t = string.Template(exp)
     e = t.substitute(**kwargs)
+    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