blob: ed563fd68bd9fcb34854fe615335ca8309df9c6b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/usr/bin/env python3
import sys
if len(sys.argv) != 2:
print("""\
Usage: print_status.py STATUS_FILENAME
STATUS_FILENAME contains one line with an integer status."""
)
sys.exit(1)
with open(sys.argv[1], 'r') as status_in:
status = int(status_in.readline())
print('{} with status {}'.format(
"\033[32msucceeded\033[0m" if status == 0 else "\033[31mfailed\033[0m",
status))
|