tests/filtercr.py
author Simon Heimberg <simohe@besonet.ch>
Sat, 12 Nov 2011 02:07:55 +0100
changeset 15492 36f076d03b34
parent 13141 6cfe17c19ba2
permissions -rwxr-xr-x
setup: make script executable with python3 Replace the incompatible print statement. Writing a warning to stderr is a good idea anyway.

#!/usr/bin/env python

# Filter output by the progress extension to make it readable in tests

import sys, re

for line in sys.stdin:
    line = re.sub(r'\r+[^\n]', lambda m: '\n' + m.group()[-1:], line)
    sys.stdout.write(line)
print