9 if not hasattr(stream,
"isatty"):
11 if not stream.isatty():
16 return curses.tigetnum(
"colors" ) > 2
21 _have_color =
'--color' in sys.argv
23 sys.argv.remove(
'--color' )
35 def out( *args, sep = ' ', end = '\n' ):
37 clear_to_eol = end
and end[-1] ==
'\n' and len(_progress) > 0
39 print( *args, sep = sep, end = clear_eol + end )
42 print( *args, sep = sep, end = end )
45 sys.stdout.write(
'\0337' )
46 print( *args, end = clear_eol )
47 sys.stdout.write(
'\0338' )
50 red = yellow = gray = reset = cr = clear_eos =
'' 51 def out( *args, sep = ' ', end = '\n' ):
52 print( *args, sep = sep, end = end )
74 out( gray +
'-V-', *args, reset )
87 global d, _debug_on, _debug_indent
90 out( gray,
'-D- ', _debug_indent, sep =
'', end =
'' )
91 out( *args, end = reset +
'\n' )
97 if '--debug' in sys.argv:
98 sys.argv.remove(
'--debug' )
102 _debug_indent += n * indentation
105 _debug_indent = _debug_indent[:-n * len(indentation)]
121 out( red +
'-E-' + reset, *args )
123 _n_errors = _n_errors + 1
138 out( yellow +
'-W-' + reset, *args )
140 _n_warnings = _n_warnings + 1
def debug_indent(n=1, indentation=' ')
def _stream_has_color(stream)
def out(args, sep=' ', end='\n')
static std::string print(const transformation &tf)
def debug_unindent(n=1, indentation=' ')