bernd-wechner / Degoo

CLI tool(s) for working with Degoo cloud storage
Other
143 stars 41 forks source link

Bring download and upload toolbars into conformance #17

Open bernd-wechner opened 3 years ago

bernd-wechner commented 3 years ago

It's awesome that we now have progress bars on download and upload but they have distinct styles and it would be nice to bring them into conformance. The differences are presently as follows:

  1. Style:

    Get: 100% [########################################################################] 82M / 82M

    Put: [##########          ] 80044032/234490033 - 00:00:58

    Get is nicer. But Put has an ETA which is awesome.

    Both are lacking the filename.

    They apply file by file when doing directory puts and gets but don't show the current filename. This should be fixed.

  2. History:

    Get shows the history in that every new file starts a new line and you see a load of 100% progress bars above the current one running. Put overwrites each progress bar and is only ever displaying the currently running one so no history is kept on screen.

    The two use different packages to achieve their result, and eitehr one may be more or less configurable.

    The get progress bar is delivered by the wget package:

    https://github.com/bernd-wechner/python3-wget/blob/e38979ffdf462a5cec05c5a92ff35a7630c6435b/wget.py#L286

    and the put progress bar is delivered by the clint package:

    https://github.com/kennethreitz-archive/clint/blob/9d3693d644b8587d985972b6075d970096f6439e/clint/textui/progress.py#L33

I suspect the best approach is to:

  1. Generalise the wget progress bar extracting it from the wget library and including it as a degoo cli function: https://github.com/bernd-wechner/python3-wget/blob/e38979ffdf462a5cec05c5a92ff35a7630c6435b/wget.py#L166
  2. Extend it to accept a filename
  3. plug this bar in to the wget call: wget.download(bar= ...) and the MultipartEncoderMonitor(callback=...)

We'd then have consistent bars and behaviour and the best look (I am thinking the wget adaptive bar plus an ETA added and a filename).

bernd-wechner commented 3 years ago

This has been partly implemented in: https://github.com/bernd-wechner/Degoo/commit/bb014b1c869a1bff20899d12ff1635b76f235595

Remaining todo are to add an ETA and add the filename/path as an option to progress bar.