Colourize redo's output.

This commit is contained in:
Avery Pennarun 2010-11-12 23:54:57 -08:00
commit 903793ecd9
2 changed files with 13 additions and 3 deletions

15
redo.py
View file

@ -39,15 +39,24 @@ def sname(typ, t):
return REDO_BASE + ('/.redo/%s^%s' % (typ, tnew.replace('/', '^')))
def log(s):
def _log(s):
sys.stdout.flush()
sys.stderr.write('redo: %s%s' % (REDO_DEPTH, s))
sys.stderr.write(s)
sys.stderr.flush()
def _clog(s):
_log('\x1b[32mredo: %s\x1b[1m%s\x1b[m' % (REDO_DEPTH, s))
def _bwlog(s):
_log('redo: %s%s' % (REDO_DEPTH, s))
if os.isatty(2):
log = _clog
else:
log = _bwlog
def debug(s):
if REDO_DEBUG:
log(s)
_log('redo: %s%s' % (REDO_DEPTH, s))
def add_dep(t, mode, dep):

View file

@ -1,4 +1,5 @@
. wvtest.sh
redo t/it
WVSTART "t/runtests"
WVPASS redo t/runtests