Skip to content

Add ci_mode to disable download progress #1727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ before_script:

script:
- docker build --tag=p4a --file Dockerfile.py3 .
- docker run p4a /bin/sh -c "$COMMAND"
- docker run -e CI p4a /bin/sh -c "$COMMAND"
11 changes: 6 additions & 5 deletions pythonforandroid/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,12 @@ def shprint(command, *args, **kwargs):
'\t', ' ').replace(
'\b', ' ').rstrip()
if msg:
stdout.write(u'{}\r{}{:<{width}}'.format(
Err_Style.RESET_ALL, msg_hdr,
shorten_string(msg, msg_width), width=msg_width))
stdout.flush()
need_closing_newline = True
if "CI" not in os.environ:
stdout.write(u'{}\r{}{:<{width}}'.format(
Err_Style.RESET_ALL, msg_hdr,
shorten_string(msg, msg_width), width=msg_width))
stdout.flush()
need_closing_newline = True
else:
logger.debug(''.join(['\t', line.rstrip()]))
if need_closing_newline:
Expand Down
5 changes: 3 additions & 2 deletions pythonforandroid/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ def report_hook(index, blksize, size):
else:
progression = '{0:.2f}%'.format(
index * blksize * 100. / float(size))
stdout.write('- Download {}\r'.format(progression))
stdout.flush()
if "CI" not in environ:
stdout.write('- Download {}\r'.format(progression))
stdout.flush()

if exists(target):
unlink(target)
Expand Down