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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user