Open G-Pereira opened 6 years ago
A callback how so? Make the upload function, asynchronous?
@G-Pereira not sure about making it asynchronous. I mostly thought the callback could be called within the loop that copies the bytes. It also means that whatever you do in the callback will block further copy. If it's only about updating progress info and continuing that should be enough.
@PVince81 Só you mean I can do that in the chunked versions?
You could add this to both chunked and non-chunked variants. Make sure the callback returns the correct number of current and total bytes then.
I second this, having access to upload progress would be very useful. Download is fine as bytes received can be counted locally but upload is not as the file will simply appear in the server upon upload completion.
Maybe this could be realized through incorporating something like https://gist.github.com/tyhoff/b757e6af83c1fd2b7b83057adf02c139 into here https://github.com/owncloud/pyocclient/blob/fe5c11edc92e1dc80d9683c3a16ec929749a5343/owncloud/owncloud.py#L589 for non chunked upload. For chunked upload one could simply show the chunks uploaded (use e.g. tqdm in this loop: https://github.com/owncloud/pyocclient/blob/fe5c11edc92e1dc80d9683c3a16ec929749a5343/owncloud/owncloud.py#L674)
hi, has this been added?
Maybe you can add a callback that is triggered from within the loop that copies the bytes in all the upload functions ?