datalad_next.shell.ShellCommandResponseGenerator
- class datalad_next.shell.ShellCommandResponseGenerator(stdout_gen: Generator, stderr_deque: deque)[source]
Bases:
Generator
An abstract class the specifies the minimal functionality of a response generator
Subclasses of this class can be used to implement operation-specific, shell-specific or OS-specific details of the command execution and the command output parsing.
The return code is available in the
returncode
-attribute, the stderr-output is available in thestderr_deque
-attribute (adeque
-instance), of instances of this class.- abstract get_final_command(command: bytes) bytes [source]
Return a final command list that executes
command
This method should return a "final" command-pipeline that executes
command
and generates the output structure that the response generator expects. This structure will typically be parsed in the implementation ofsend()
.This method is usually only called by
ShellCommandExecutor.__call__()
.