Skip to content

Commit 800358c

Browse files
committed
Update get.py
1 parent 0d53a72 commit 800358c

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

tools/get.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def report_progress(count, blockSize, totalSize):
6060

6161
def unpack(filename, destination):
6262
dirname = ''
63-
print('Extracting {0}'.format(os.path.basename(filename)))
63+
print('Extracting {0} ...'.format(os.path.basename(filename)))
6464
sys.stdout.flush()
6565
if filename.endswith('tar.gz'):
6666
tfile = tarfile.open(filename, 'r:gz')
@@ -76,7 +76,7 @@ def unpack(filename, destination):
7676
# a little trick to rename tool directories so they don't contain version number
7777
rename_to = re.match(r'^([a-z][^\-]*\-*)+', dirname).group(0).strip('-')
7878
if rename_to != dirname:
79-
print('Renaming {0} to {1}'.format(dirname, rename_to))
79+
print('Renaming {0} to {1} ...'.format(dirname, rename_to))
8080
if os.path.isdir(rename_to):
8181
shutil.rmtree(rename_to)
8282
shutil.move(dirname, rename_to)
@@ -106,9 +106,8 @@ def get_tool(tool):
106106
archive_name = tool['archiveFileName']
107107
local_path = dist_dir + archive_name
108108
url = tool['url']
109-
#real_hash = tool['checksum'].split(':')[1]
110109
if not os.path.isfile(local_path):
111-
print('Downloading ' + archive_name)
110+
print('Downloading ' + archive_name + ' ...')
112111
sys.stdout.flush()
113112
if 'CYGWIN_NT' in sys_name:
114113
import ssl
@@ -127,15 +126,11 @@ def get_tool(tool):
127126
download_file(url, local_path)
128127
else:
129128
urlretrieve(url, local_path, report_progress)
130-
sys.stdout.write("\rDone\n")
131-
sys.stdout.flush()
129+
sys.stdout.write("\rDone\n")
130+
sys.stdout.flush()
132131
else:
133132
print('Tool {0} already downloaded'.format(archive_name))
134133
sys.stdout.flush()
135-
#local_hash = sha256sum(local_path)
136-
#if local_hash != real_hash:
137-
# print('Hash mismatch for {0}, delete the file and try again'.format(local_path))
138-
# raise RuntimeError()
139134
unpack(local_path, '.')
140135

141136
def load_tools_list(filename, platform):

0 commit comments

Comments
 (0)