tests/filtercr.py
author Thomas Arendsen Hein <thomas@intevation.de>
Mon, 24 Oct 2011 13:32:23 +0200
branchstable
changeset 15353 ab600a25dfc0
parent 13141 6cfe17c19ba2
permissions -rwxr-xr-x
posix: workaround for os.path.realpath bug in Python 2.4.1 and before os.path.realpath didn't resolve symlinks that were the first component of the path, see http://bugs.python.org/issue1213894

#!/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