Dont update the bar without size

This commit is contained in:
Jake Howard 2017-05-04 08:39:38 +01:00
parent 9108301772
commit 88ad1fd6a5

View file

@ -26,7 +26,8 @@ def download_csl():
remove_dir(CSL_DIR)
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))
_, download_location = tempfile.mkstemp()