Skip to content

Commit

Permalink
Merge pull request #1727 from mkg20001/feat-ci-mode
Browse files Browse the repository at this point in the history
Add CI environment variable to disable download progress
  • Loading branch information
AndreMiras authored Feb 25, 2019
2 parents 593aa1e + 1ea1982 commit 8ebea2e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
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

0 comments on commit 8ebea2e

Please sign in to comment.