7 n_cols
= curses
.tigetnum('cols') or 80
20 set_fg
= curses
.tigetstr('setf') or ''
21 normal
= curses
.tigetstr('sgr0') or ''
31 def result(msg
, colour
= 'GREEN'):
33 result_col
= n_cols
- max(10, len(msg
)) - 1
34 if cursor_pos
> result_col
:
38 msg
= highlight(msg
, colour
)
39 print " " * (result_col
- cursor_pos
), "[ %s ]" % msg
45 def highlight(msg
, colour
):
46 return curses
.tparm(set_fg
, COLOURS
[colour
]) + msg
+ curses
.tparm(normal
)