amnong / easywebdav

A WebDAV Client in Python
http://pypi.python.org/pypi/easywebdav/
ISC License
207 stars 113 forks source link

Added Callback for Downloading #29

Open m42e opened 9 years ago

m42e commented 9 years ago

Added a optional callback for downloading. There is one parameter in the callback containing the size of the recently loaded chunk. The download initiator has to take care of the file size itself.

chross commented 6 years ago

When trying the following code, the callback is executed immediately and not only after the whole file is downloaded. Is this intended behaviour?

   webdav.download(remote_path, local_path, unzip(local_path))
m42e commented 6 years ago

The callback is intended to give you an update while downloading so you can get the size of the downloaded chunk. So it is for progress, rather than completion. Just call unzip after the download call.

webdav.download(remote_path, local_path)
unzip(local_path)
chross commented 6 years ago

Thanks. Somehow I thought the download was threaded and working in the background (must have mixed that up with another webdav client I was testing).