subproc#
- showyourwork.subproc.get_stdout(args, shell=False, cwd=None, secrets=[], callback=<function process_run_result>)#
A thin wrapper around
subprocess.runthat hides secrets and decodesstdoutandstderroutput intoutf-8.- Parameters:
args (list or str) – Arguments passed to
subprocess.runshell (bool, optional) – Passed directly to
subprocess.runcwd (str, optional) – Directory to run the command in, if different from current working directory.
secrets (list, optional) – Secrets to be masked in the output.
callback (callable, optional) – Callback to process the result.
- showyourwork.subproc.parse_request(r)#
Parse a requests return object
rand raise a custom exception for a >200-level status code.
- showyourwork.subproc.process_run_result(code, stdout, stderr)#
Default callback function for
get_stdout.