Skip to content

Commit

Permalink
grass.script: Fix ignored superquiet (--qq) parameter
Browse files Browse the repository at this point in the history
The superquiet (--qq) parameter was ignored by the core functions and not supported in others. This adds superquiet=False to all relevant functions.
  • Loading branch information
wenzeslaus committed Feb 9, 2023
1 parent d3541e0 commit 5e8f135
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
7 changes: 5 additions & 2 deletions python/grass/script/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ def make_command(
:param str flags: flags to be used (given as a string)
:param bool overwrite: True to enable overwriting the output (<tt>--o</tt>)
:param bool quiet: True to run quietly (<tt>--q</tt>)
:param bool superquiet: True to run extra quietly (<tt>--qq</tt>)
:param bool verbose: True to run verbosely (<tt>--v</tt>)
:param options: module's parameters
Expand Down Expand Up @@ -375,6 +376,7 @@ def start_command(
:param str flags: flags to be used (given as a string)
:param bool overwrite: True to enable overwriting the output (<tt>--o</tt>)
:param bool quiet: True to run quietly (<tt>--q</tt>)
:param bool superquiet: True to run extra quietly (<tt>--qq</tt>)
:param bool verbose: True to run verbosely (<tt>--v</tt>)
:param kwargs: module's parameters
Expand All @@ -388,7 +390,7 @@ def start_command(
else:
options[opt] = val

args = make_command(prog, flags, overwrite, quiet, verbose, **options)
args = make_command(prog, flags=flags, overwrite=overwrite, quiet=quiet, superquiet=superquiet, verbose=verbose, **options)

if debug_level() > 0:
sys.stderr.write(
Expand Down Expand Up @@ -627,12 +629,13 @@ def exec_command(
:param str flags: flags to be used (given as a string)
:param bool overwrite: True to enable overwriting the output (<tt>--o</tt>)
:param bool quiet: True to run quietly (<tt>--q</tt>)
:param bool superquiet: True to run quietly (<tt>--qq</tt>)
:param bool verbose: True to run verbosely (<tt>--v</tt>)
:param env: directory with environmental variables
:param list kwargs: module's parameters
"""
args = make_command(prog, flags, overwrite, quiet, verbose, **kwargs)
args = make_command(prog, flags, overwrite, quiet, superquiet, verbose, **kwargs)

if env is None:
env = os.environ
Expand Down
8 changes: 6 additions & 2 deletions python/grass/script/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,13 @@ def float_or_null(s):


def mapcalc(
exp, quiet=False, verbose=False, overwrite=False, seed=None, env=None, **kwargs
exp, quiet=False, superquiet=False, verbose=False, overwrite=False, seed=None, env=None, **kwargs
):
"""Interface to r.mapcalc.
:param str exp: expression
:param bool quiet: True to run quietly (<tt>--q</tt>)
:param bool superquiet: True to run extra quietly (<tt>--qq</tt>)
:param bool verbose: True to run verbosely (<tt>--v</tt>)
:param bool overwrite: True to enable overwriting the output (<tt>--o</tt>)
:param seed: an integer used to seed the random-number generator for the
Expand All @@ -137,6 +138,7 @@ def mapcalc(
env=env,
seed=seed,
quiet=quiet,
superquiet=superquiet,
verbose=verbose,
overwrite=overwrite,
)
Expand All @@ -145,7 +147,7 @@ def mapcalc(


def mapcalc_start(
exp, quiet=False, verbose=False, overwrite=False, seed=None, env=None, **kwargs
exp, quiet=False, superquiet=False, verbose=False, overwrite=False, seed=None, env=None, **kwargs
):
"""Interface to r.mapcalc, doesn't wait for it to finish, returns Popen object.
Expand All @@ -166,6 +168,7 @@ def mapcalc_start(
:param str exp: expression
:param bool quiet: True to run quietly (<tt>--q</tt>)
:param bool superquiet: True to run extra quietly (<tt>--qq</tt>)
:param bool verbose: True to run verbosely (<tt>--v</tt>)
:param bool overwrite: True to enable overwriting the output (<tt>--o</tt>)
:param seed: an integer used to seed the random-number generator for the
Expand All @@ -188,6 +191,7 @@ def mapcalc_start(
env=env,
seed=seed,
quiet=quiet,
superquiet=superquiet,
verbose=verbose,
overwrite=overwrite,
)
Expand Down
4 changes: 3 additions & 1 deletion python/grass/script/raster3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,13 @@ def float_or_null(s):


def mapcalc3d(
exp, quiet=False, verbose=False, overwrite=False, seed=None, env=None, **kwargs
exp, quiet=False, superquiet=False, verbose=False, overwrite=False, seed=None, env=None, **kwargs
):
"""Interface to r3.mapcalc.
:param str exp: expression
:param bool quiet: True to run quietly (<tt>--q</tt>)
:param bool superquiet: True to run extra quietly (<tt>--qq</tt>)
:param bool verbose: True to run verbosely (<tt>--v</tt>)
:param bool overwrite: True to enable overwriting the output (<tt>--o</tt>)
:param seed: an integer used to seed the random-number generator for the
Expand All @@ -97,6 +98,7 @@ def mapcalc3d(
env=env,
seed=seed,
quiet=quiet,
superquiet=superquiet,
verbose=verbose,
overwrite=overwrite,
)
Expand Down

0 comments on commit 5e8f135

Please sign in to comment.