Colourize redo's output.
This commit is contained in:
parent
2e71e20ce2
commit
903793ecd9
2 changed files with 13 additions and 3 deletions
15
redo.py
15
redo.py
|
|
@ -39,15 +39,24 @@ def sname(typ, t):
|
||||||
return REDO_BASE + ('/.redo/%s^%s' % (typ, tnew.replace('/', '^')))
|
return REDO_BASE + ('/.redo/%s^%s' % (typ, tnew.replace('/', '^')))
|
||||||
|
|
||||||
|
|
||||||
def log(s):
|
def _log(s):
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
sys.stderr.write('redo: %s%s' % (REDO_DEPTH, s))
|
sys.stderr.write(s)
|
||||||
sys.stderr.flush()
|
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):
|
def debug(s):
|
||||||
if REDO_DEBUG:
|
if REDO_DEBUG:
|
||||||
log(s)
|
_log('redo: %s%s' % (REDO_DEPTH, s))
|
||||||
|
|
||||||
|
|
||||||
def add_dep(t, mode, dep):
|
def add_dep(t, mode, dep):
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
. wvtest.sh
|
. wvtest.sh
|
||||||
|
|
||||||
|
redo t/it
|
||||||
WVSTART "t/runtests"
|
WVSTART "t/runtests"
|
||||||
WVPASS redo t/runtests
|
WVPASS redo t/runtests
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue