scp.py
scp.py copied to clipboard
Give enough information to the progress callback to display a progress bar
When downloading/uploading a single file, the progress and progress4 tell us how many bytes are involved in the transfer and how many were already transferred, so that works great and a progress bar can be displayed.
When downloading/uploading a directory, those callbacks tell us which file is being transferred and the individual progress of that file, but nothing of the overall transfer.
I don't know what's doable, but it would be nice to have a callback reporting the progress of the overall transfer, as in "3 of 10 files transferred" and "1857 bytes transferred of 656832 total"
You should be able to compute that yourself. I am not sure it makes sense to build this into the client, though I would be open to adding a common recipe to the docs.
What do you mean? It's easy to compute how many files and bytes were received, but how do you know how many you are still expecting? I get that when sending a directory you can look up its contents ahead of time, but that's not really an option when receiving
I don't think there is a way for this library to know that either.