cernopendata / cernopendata-client

CERN Open Data command-line client
http://cernopendata-client.readthedocs.io/
GNU General Public License v3.0
10 stars 9 forks source link

download-files: prettify progress bar display #46

Closed tiborsimko closed 4 years ago

tiborsimko commented 4 years ago

Observation: the progress bar, once a file is downloaded, makes the display broken a bit, see:

$ cernopendata-client download-files --recid 1 --filter-range 1-2
==> Downloading file 1 of 2
==> Downloading file: ./1/0248915F-EE71-E011-8894-0025902009E8.root
==> Downloading file 2 of 2kiB (100%)
==> Downloading file: ./1/0268F635-B671-E011-9090-002481E14E00.root
Downloading: 842237/842237 kiB (100%)
Download completed!

Note the Downloading file 2 of 2kiB (100%) part where some bits remained from the previous progress bar.

Mentioning just for completeness; if you don't have a quick solution, we can also address this cosmetics issues later via another separate issue...

_Originally posted by @tiborsimko in https://github.com/cernopendata/cernopendata-client/pull/44#discussion_r488713708_

tiborsimko commented 4 years ago

Here's easier/faster use case:

$ cernopendata-client download-files --recid 5500 --filter-regexp '\.cc$'
==> Downloading file 1 of 3
==> Downloading file: ./5500/HiggsDemoAnalyzer.cc
==> Downloading file 2 of 3%)
==> Downloading file: ./5500/M4Lnormdatall.cc
==> Downloading file 3 of 3%)
==> Downloading file: ./5500/M4Lnormdatall_lvl3.cc
Downloading: 15/15 kiB (100%)
Download completed!

Note "2 of 3%", "3 of 3%" with artefacts remaining from the progress bar report.

ParthS007 commented 4 years ago

Will look into it. 👍