2019-01-09 16:18:52 -05:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2020-06-03 18:40:05 -04:00
|
|
|
# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2019-01-09 16:18:52 -05:00
|
|
|
import sys
|
2021-03-15 09:57:36 -04:00
|
|
|
|
2019-01-09 16:18:52 -05:00
|
|
|
if len(sys.argv) != 2:
|
2021-03-15 09:57:36 -04:00
|
|
|
print(
|
|
|
|
"""\
|
2019-01-09 16:18:52 -05:00
|
|
|
Usage: print_status.py STATUS_FILENAME
|
|
|
|
STATUS_FILENAME contains one line with an integer status."""
|
|
|
|
)
|
|
|
|
sys.exit(1)
|
2021-03-15 09:57:36 -04:00
|
|
|
with open(sys.argv[1], "r") as status_in:
|
2019-01-09 16:18:52 -05:00
|
|
|
status = int(status_in.readline())
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
print(
|
|
|
|
"{} with status {}".format(
|
|
|
|
"\033[32msucceeded\033[0m" if status == 0 else "\033[31mfailed\033[0m", status
|
|
|
|
)
|
|
|
|
)
|