1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-28 09:00:46 +02:00

improve handling of missing progressbar module

With the NoPBTextMeter class the build view gets broken.
Old view:
1/11 (repo) filename

new view:
Please install the progressbar module...
Please install the progressbar module...
Please install the progressbar module...

With this commit the old behavior is restored.

The getbinaries call now lists the file he downloads instead of just
stating "Please install the progressbar module..." several times.
(but only if not called with the option quiet)
This commit is contained in:
lethliel
2019-01-10 14:02:20 +01:00
committed by Marco Strigl
parent a3ab245893
commit 8b3c2bd61a
4 changed files with 10 additions and 12 deletions

View File

@@ -4618,10 +4618,14 @@ def get_binary_file(apiurl, prj, repo, arch,
progress_obj = None
if progress_meter:
from .meter import TextMeter
progress_obj = TextMeter()
if TextMeter:
progress_obj = TextMeter()
target_filename = target_filename or filename
if progress_meter and not progress_obj:
print('Downloading %s' % target_filename)
where = package or '_repository'
u = makeurl(apiurl, ['build', prj, repo, arch, where, filename])
download(u, target_filename, progress_obj, target_mtime)