root/lib/term.py @ 10096
1 | 1629 | aaronmk | # Terminal output
|
---|---|---|---|
2 | 151 | aaronmk | |
3 | csi = '\x1B[' |
||
4 | |||
5 | 1629 | aaronmk | clear_line = csi+'0J' |
6 | |||
7 | 151 | aaronmk | 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 | 825 | aaronmk | |
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+' ') |