Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring download and upload toolbars into conformance #17

Open
bernd-wechner opened this issue Mar 1, 2021 · 1 comment
Open

Bring download and upload toolbars into conformance #17

bernd-wechner opened this issue Mar 1, 2021 · 1 comment

Comments

@bernd-wechner
Copy link
Owner

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
Copy link
Owner Author

This has been partly implemented in: bb014b1

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant