提交 28e0b786 编写于 作者: Y Yang Zhang 提交者: qingqing01

Revert user prompt before downloading files (#2521)

May be problematic for unattended runs.
上级 6c209533
...@@ -16,10 +16,8 @@ from __future__ import absolute_import ...@@ -16,10 +16,8 @@ from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
import six
import os import os
import sys
import shutil import shutil
import requests import requests
import tqdm import tqdm
...@@ -27,8 +25,6 @@ import hashlib ...@@ -27,8 +25,6 @@ import hashlib
import tarfile import tarfile
import zipfile import zipfile
from .cli import ColorTTY
import logging import logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -142,17 +138,6 @@ def _download(url, path, md5sum=None): ...@@ -142,17 +138,6 @@ def _download(url, path, md5sum=None):
fullname = os.path.join(path, fname) fullname = os.path.join(path, fname)
retry_cnt = 0 retry_cnt = 0
print("will download file to {}, proceed? {}".format(
fullname, ColorTTY().green("[Y/n]")))
yes = {'yes', 'y', ''}
if six.PY2:
choice = raw_input().lower()
else:
choice = input().lower()
if choice not in yes:
print('download aborted....')
sys.exit(0)
while not (os.path.exists(fullname) and _md5check(fullname, md5sum)): while not (os.path.exists(fullname) and _md5check(fullname, md5sum)):
if retry_cnt < DOWNLOAD_RETRY_LIMIT: if retry_cnt < DOWNLOAD_RETRY_LIMIT:
retry_cnt += 1 retry_cnt += 1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册