Dont update the bar without size
This commit is contained in:
parent
9108301772
commit
88ad1fd6a5
1 changed files with 2 additions and 1 deletions
|
@ -26,7 +26,8 @@ def download_csl():
|
||||||
remove_dir(CSL_DIR)
|
remove_dir(CSL_DIR)
|
||||||
|
|
||||||
def download_handle(count, block_size, total_size):
|
def download_handle(count, block_size, total_size):
|
||||||
print(count, block_size, total_size, int(count * block_size * 100 / total_size))
|
if total_size < 1: # only update the bar if we have a size
|
||||||
|
return
|
||||||
bar.update(int(count * block_size * 100 / total_size))
|
bar.update(int(count * block_size * 100 / total_size))
|
||||||
|
|
||||||
_, download_location = tempfile.mkstemp()
|
_, download_location = tempfile.mkstemp()
|
||||||
|
|
Reference in a new issue