mirror of https://github.com/axmolengine/axmol.git
Merge pull request #6567 from dumganhar/v3
Adds download progress for download-deps.py and adds some missing files
This commit is contained in:
commit
b624fe5afb
Binary file not shown.
After Width: | Height: | Size: 801 B |
Binary file not shown.
After Width: | Height: | Size: 329 B |
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 429 B |
|
@ -27,21 +27,21 @@ def download_file(url, file_name):
|
|||
u = urllib2.urlopen(url)
|
||||
f = open(file_name, 'wb')
|
||||
meta = u.info()
|
||||
#file_size = int(meta.getheaders("Content-Length")[0])
|
||||
print("Downloading: %s , please wait ... " % (file_name))
|
||||
file_size = int(meta.getheaders("Content-Length")[0])
|
||||
print("Downloading: %s, file size: %dK, please wait ... " % (file_name, file_size / 1000))
|
||||
|
||||
# file_size_dl = 0
|
||||
file_size_dl = 0
|
||||
block_sz = 8192
|
||||
while True:
|
||||
buffer = u.read(block_sz)
|
||||
if not buffer:
|
||||
break
|
||||
|
||||
#file_size_dl += len(buffer)
|
||||
file_size_dl += len(buffer)
|
||||
f.write(buffer)
|
||||
#status = r"%10d [%3.2f%%]" % (file_size_dl, file_size_dl * 100. / file_size)
|
||||
#status = status + chr(8)*(len(status)+1)
|
||||
#print(status),
|
||||
status = r"%10dK [%3.2f%%]" % (file_size_dl / 1000, file_size_dl * 100. / file_size)
|
||||
status = status + chr(8)*(len(status)+1)
|
||||
print(status),
|
||||
f.close()
|
||||
|
||||
def default_filter(src,dst):
|
||||
|
@ -100,8 +100,8 @@ def main():
|
|||
if os.path.exists(extracted_folder_name):
|
||||
shutil.rmtree(extracted_folder_name)
|
||||
|
||||
if not os.path.isfile(filename + '.zip'):
|
||||
download_file(prefix+filename, filename+'.zip')
|
||||
# if not os.path.isfile(filename + '.zip'):
|
||||
download_file(prefix+filename, filename+'.zip')
|
||||
|
||||
print("Extracting files, please wait ...")
|
||||
unpack_zipfile(filename+'.zip', workpath)
|
||||
|
@ -109,8 +109,8 @@ def main():
|
|||
print("Copying files ...")
|
||||
distutils.dir_util.copy_tree(extracted_folder_name, workpath)
|
||||
print("Cleaning ...")
|
||||
# if os.path.isfile(filename+'.zip'):
|
||||
# os.remove(filename+'.zip')
|
||||
if os.path.isfile(filename+'.zip'):
|
||||
os.remove(filename+'.zip')
|
||||
if os.path.exists(extracted_folder_name):
|
||||
shutil.rmtree(extracted_folder_name)
|
||||
print("DONE! Cheers!")
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue