[GRASS-SVN] r42688 - grass/trunk/lib/python
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jul 1 07:49:10 EDT 2010
Author: glynn
Date: 2010-07-01 11:49:10 +0000 (Thu, 01 Jul 2010)
New Revision: 42688
Modified:
grass/trunk/lib/python/raster.py
Log:
Fix handling of quiet, verbose, overwrite
Modified: grass/trunk/lib/python/raster.py
===================================================================
--- grass/trunk/lib/python/raster.py 2010-07-01 11:48:40 UTC (rev 42687)
+++ grass/trunk/lib/python/raster.py 2010-07-01 11:49:10 UTC (rev 42688)
@@ -75,7 +75,7 @@
# interface to r.mapcalc
-def mapcalc(exp, **kwargs):
+def mapcalc(exp, quiet = False, verbose = False, overwrite = False, **kwargs):
"""!Interface to r.mapcalc.
@param exp expression
@@ -83,11 +83,10 @@
"""
t = string.Template(exp)
e = t.substitute(**kwargs)
- for key in kwargs.keys():
- if key in ['overwrite', 'quiet', 'verbose']:
- continue
- del kwargs[key]
-
- if run_command('r.mapcalc', expression = e, **kwargs) != 0:
+
+ if run_command('r.mapcalc', expression = e,
+ quiet = quiet,
+ verbose = verbose,
+ overwrite = overwrite) != 0:
fatal("An error occurred while running r.mapcalc")
More information about the grass-commit
mailing list