8000 feat: add ci_mode to disable download progress · lstwzd/python-for-android@9035287 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9035287

Browse files
committed
feat: add ci_mode to disable download progress
Otherwise Travis CI complains about log size
1 parent 6ca419e commit 9035287

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

pythonforandroid/logger.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,12 @@ def shprint(command, *args, **kwargs):
188188
'\t', ' ').replace(
189189
'\b', ' ').rstrip()
190190
if msg:
191-
stdout.write(u'{}\r{}{:<{width}}'.format(
192-
Err_Style.RESET_ALL, msg_hdr,
193-
shorten_string(msg, msg_width), width=msg_width))
194-
stdout.flush()
195-
need_closing_newline = True
191+
if "CI" not in os.environ:
192+
stdout.write(u'{}\r{}{:<{width}}'.format(
193+
Err_Style.RESET_ALL, msg_hdr,
194+
shorten_string(msg, msg_width), width=msg_width))
195+
stdout.flush()
196+
need_closing_newline = True
196197
else:
197198
logger.debug(''.join(['\t', line.rstrip()]))
198199
if need_closing_newline:

pythonforandroid/recipe.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ def report_hook(index, blksize, size):
140140
else:
141141
progression = '{0:.2f}%'.format(
142142
index * blksize * 100. / float(size))
143-
stdout.write('- Download {}\r'.format(progression))
144-
stdout.flush()
143+
if "CI" not in environ:
144+
stdout.write('- Download {}\r'.format(progression))
145+
stdout.flush()
145146

146147
if exists(target):
147148
unlink(target)

0 commit comments

Comments
 (0)
0