Pārlūkot izejas kodu

Fix handling of quiet, verbose, overwrite

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@42688 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 15 gadi atpakaļ
vecāks
revīzija
9b86326890
1 mainītis faili ar 6 papildinājumiem un 7 dzēšanām
  1. 6 7
      lib/python/raster.py

+ 6 - 7
lib/python/raster.py

@@ -75,7 +75,7 @@ def raster_info(map):
 
 # 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 @@ def mapcalc(exp, **kwargs):
     """
     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")