datalad_next.shell.DownloadResponseGenerator

class datalad_next.shell.DownloadResponseGenerator(stdout: OutputFrom)[source]

Bases: ShellCommandResponseGenerator

Response generator interface for efficient download

This response generator is used to implement download in a single command call (instead of using one command to determine the length of a file and a subsequent fixed-length command to download the file). It assumes that the shell sends <length>\n, the content of the file, and <return code>\n. The response generator delegates the creation of the appropriate final command list to its subclasses.

send(_) bytes[source]

Deliver the next part of generated output

Whenever the response generator is iterated over, this method is called and should deliver the next part of the command output or raise StopIteration if the command has finished.