root/trunk/lib/term.py @ 13310
1 |
# Terminal output
|
---|---|
2 |
|
3 |
csi = '\x1B[' |
4 |
|
5 |
clear_line = csi+'0J' |
6 |
|
7 |
def set_style(style): return csi+style+'m' |
8 |
|
9 |
reset_style = set_style('0') |
10 |
|
11 |
def as_style(style, text): return set_style(style)+text+reset_style |
12 |
|
13 |
def emph_multiline(text): return as_style('7', text) |
14 |
|
15 |
def emph(text): return emph_multiline(' '+text+' ') |
16 |
|
17 |
def error(text): return as_style('101;97', ' '+text+' ') |