utilities.py: Avoid extra printing in non-TUI enviroments

This commit is contained in:
Mykola Grymalyuk
2022-04-30 08:29:21 -06:00
parent 93a2eeb8b5
commit 218529afe2
+2
View File
@@ -359,6 +359,7 @@ def download_file(link, location, is_gui=None, verify_checksum=False):
box_string = "#" * box_length box_string = "#" * box_length
dl = 0 dl = 0
total_downloaded_string = "" total_downloaded_string = ""
global clear
with location.open("wb") as file: with location.open("wb") as file:
count = 0 count = 0
start = time.perf_counter() start = time.perf_counter()
@@ -367,6 +368,7 @@ def download_file(link, location, is_gui=None, verify_checksum=False):
file.write(chunk) file.write(chunk)
count += len(chunk) count += len(chunk)
if is_gui is None: if is_gui is None:
if clear:
cls() cls()
print(box_string) print(box_string)
print(header) print(header)