proj_flow.base.cmd
The proj_flow.base.cmd defines environment for proj_flow.api.env.Runtime.
- proj_flow.base.cmd.which(cmd: str) str | None
Return executable path from
PATHenvironment variable, if it is present.- Parameters:
cmd – name of the tool to expand
- Returns:
the path to an executable which would be run if the given
cmdwas called. If nocmdwould be called, returnNone.
- proj_flow.base.cmd.is_tool(name: str) bool
- Parameters:
name – name of the tool to check
- Returns:
True, ifwhich()would return a string and False otherwise
- proj_flow.base.cmd.run(app: str, *args: str, capture_output=False)
Run command with arguments and return a
subprocess.CompletedProcessinstance. Internally, this function runssubprocess.run()with encoding set to “UTF-8” and check turned off.- Parameters:
app – name of the command to run
args – additional arguments of the command
capture_output – if True, both stdout and stderr are captured
- Returns:
The
CompletedProcessinstance if the command was successfully ran, orNone.