Blob Blame History Raw
From 3c497cb48c647e935ce598d3f26643fed9d0b47e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
Date: Sun, 23 Dec 2018 00:15:04 +0100
Subject: [PATCH] Fix libtaskotron when used with progressbar2

Replace dropped max_val with max_value
---
 libtaskotron/file_utils.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libtaskotron/file_utils.py b/libtaskotron/file_utils.py
index 7f9ea00..2449f91 100644
--- a/libtaskotron/file_utils.py
+++ b/libtaskotron/file_utils.py
@@ -185,7 +185,7 @@ def _download(url, dest, timeout=REQUESTS_TIMEOUT, chunk_size=REQUESTS_CHUNK_SIZ
         else:
             widgets = [progressbar.Percentage(), progressbar.Bar(), progressbar.ETA(),
                        progressbar.FileTransferSpeed()]
-            pbar = progressbar.ProgressBar(widgets=widgets, maxval=int(total_len)).start()
+            pbar = progressbar.ProgressBar(widgets=widgets, max_value=int(total_len)).start()
 
             read = 0
             for chunk in r.iter_content(chunk_size):
@@ -195,9 +195,9 @@ def _download(url, dest, timeout=REQUESTS_TIMEOUT, chunk_size=REQUESTS_CHUNK_SIZ
                     # chunk can be smaller than chunk_size (end of file) or larger than it (content
                     # decompression)
                     read += min(len(chunk), chunk_size)
-                    # don't exceed pbar.maxval, which can happen due to content decompression (see
+                    # don't exceed pbar.max_value, which can happen due to content decompression (see
                     # T755). This should not occur except for the last chunk.
-                    pbar.update(min(read, pbar.maxval))
+                    pbar.update(min(read, pbar.max_value))
 
 
 # http://stackoverflow.com/questions/11325019
-- 
2.20.1