accessmod/grasshelper.py
def grass_execute(*args, **kwargs):
    """Execute a GRASS command and return stdout and stderr."""
    kwargs["stdout"] = subprocess.PIPE
    kwargs["stderr"] = subprocess.PIPE
    p = gscript.start_command(*args, **kwargs)
    stdout, stderr = p.communicate()
    name = p.args[0]  # GRASS command name, ex. r.in.gdal
    log_cmd_output(stdout, stderr, name)
    if p.returncode != 0:
        raise GrassError(f"{name}: {stderr.decode('UTF-8')}")
Execute a GRASS command and return stdout and stderr.
Execute a GRASS command and return stdout and stderr.
Execute a GRASS command and return stdout and stderr .
def grass_execute(*args, **kwargs):
    kwargs["stdout"] = subprocess.PIPE
    kwargs["stderr"] = subprocess.PIPE
    p = gscript.start_command(*args, **kwargs)
    stdout, stderr = p.communicate()
    name = p.args[0]  
    log_cmd_output(stdout, stderr, name)
    if p.returncode != 0:
        raise GrassError(f"{name}: {stderr.decode('UTF-8')}")
def grass_execute ( * args , ** kwargs ) : kwargs [ "stdout" ] = subprocess . PIPE kwargs [ "stderr" ] = subprocess . PIPE p = gscript . start_command ( * args , ** kwargs ) stdout , stderr = p . communicate ( ) name = p . args [ 0 ] log_cmd_output ( stdout , stderr , name ) if p . returncode != 0 : raise GrassError ( f"{name}: {stderr.decode('UTF-8')}" )
Execute a GRASS command and return stdout and stderr.
Execute a GRASS command and return stdout and stderr .
"""Execute a GRASS command and return stdout and stderr.""" # GRASS command name, ex. r.in.gdal