orca.utils.commandline

Command-line execution utilities.

Provides wrappers around subprocess for executing external commands with improved error handling and logging.

Attributes

log

Functions

check_output(→ str)

Execute a command and return its stdout.

Module Contents

orca.utils.commandline.log[source]
orca.utils.commandline.check_output(cmd: List[str]) str[source]

Execute a command and return its stdout.

Wrapper around subprocess.check_output with logging on failure. Does not use shell=True for security.

Parameters:

cmd – Command and arguments as a list of strings.

Returns:

Decoded stdout from the command.

Raises:

subprocess.CalledProcessError – If the command returns non-zero.