Closed MattCatz closed 11 months ago
hmm yeah you just mean the delay/timeout args? or am I missing something else too :D
pr would be most welcome if you're up for it! (just plz do sync and async)
hmm yeah you just mean the delay/timeout args? or am I missing something else too :D
pr would be most welcome if you're up for it! (just plz do sync and async)
Yeah read_output, read_delay and read_timeout.
I can make a PR. I assume something simple like below would work for both? (I haven't looked at async)
if initial_input is not None:
self.channel.write(channel_input=f"{initial_input}{self.comms_return_char}")
return self.read_callback(callbacks=callbacks, read_output=read_output, read_delay=read_delay, read_timeout=read_timeout, initial_input=None)
yep, that looks good to me! much appreciated! if ya dont wanna/dont get to it I can sort it out this weekend prolly too!
thanks for raising it @MattCatz 🥳
sorted thanks to @MattCatz !
https://github.com/carlmontanari/scrapli/blob/d0eb38b56320acd054c5efc0455d3dde8e4011c5/scrapli/driver/generic/sync_driver.py#L534C32-L534C32
If
read_callback
is given aninitial_input
, thenread_callback
does a write and recursively calls itself. Only thecallback
parameter is passed to that recursive call, preventing any other parameter from having an effect.