Do not print download progress in CI.

This commit is contained in:
Cheng Zhao 2014-02-17 17:50:25 +08:00
Родитель fde4c544b8
Коммит a76183c188
2 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -11,6 +11,8 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def main():
os.environ['CI'] = '1'
rm_rf(os.path.join(SOURCE_ROOT, 'out'))
rm_rf(os.path.join(SOURCE_ROOT, 'node_modules'))
rm_rf(os.path.join(SOURCE_ROOT, 'frameworks'))

Просмотреть файл

@ -36,6 +36,8 @@ def download(text, url, path):
downloaded_size = 0
block_size = 128
ci = os.environ.get('CI') == '1'
while True:
buf = web_file.read(block_size)
if not buf:
@ -44,11 +46,15 @@ def download(text, url, path):
downloaded_size += len(buf)
local_file.write(buf)
percent = downloaded_size * 100. / file_size
status = "\r%s %10d [%3.1f%%]" % (text, downloaded_size, percent)
print status,
if not ci:
percent = downloaded_size * 100. / file_size
status = "\r%s %10d [%3.1f%%]" % (text, downloaded_size, percent)
print status,
print
if ci:
print "%s done." % (text)
else:
print
def extract_tarball(tarball_path, member, destination):