global var

This commit is contained in:
z4yx 2020-05-02 10:37:40 +08:00 committed by tuna
parent 6e27aae429
commit 4a472d98b8

View File

@ -38,6 +38,7 @@ REPOS = [
# connect and read timeout value # connect and read timeout value
TIMEOUT_OPTION = (7, 10) TIMEOUT_OPTION = (7, 10)
total_size = 0
def sizeof_fmt(num, suffix='iB'): def sizeof_fmt(num, suffix='iB'):
for unit in ['','K','M','G','T','P','E','Z']: for unit in ['','K','M','G','T','P','E','Z']:
@ -124,9 +125,9 @@ def main():
task_queue = create_workers(args.workers) task_queue = create_workers(args.workers)
remote_filelist = [] remote_filelist = []
cleaning = False cleaning = False
total_size = 0
def download(release, release_dir, tarball = False): def download(release, release_dir, tarball = False):
global total_size
if tarball: if tarball:
url = release['tarball_url'] url = release['tarball_url']