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

Merge branch 'rework_meter_py' of https://github.com/lethliel/osc

Simplify code that uses meter.TextMeter (for the details, see the
discussion in https://github.com/openSUSE/osc/pull/502).
This commit is contained in:
Marcus Huewe
2019-01-16 12:57:51 +01:00
5 changed files with 35 additions and 23 deletions

View File

@@ -4617,15 +4617,11 @@ def get_binary_file(apiurl, prj, repo, arch,
progress_meter = False):
progress_obj = None
if progress_meter:
from .meter import TextMeter
if TextMeter:
progress_obj = TextMeter()
from .meter import create_text_meter
progress_obj = create_text_meter()
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)