From 36b634aea7df8351b4fa82bc382a64a59d483616 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Thu, 12 Dec 2013 11:56:04 +0100 Subject: [PATCH] [entropy.output] _print_prio: use nice unicode header chars :-) --- lib/entropy/output.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/entropy/output.py b/lib/entropy/output.py index 7c54fd2e0..638b0a898 100644 --- a/lib/entropy/output.py +++ b/lib/entropy/output.py @@ -497,6 +497,8 @@ def _std_write(msg, stderr = False): else: obj.write(msg) +_PRINT_PRIO_HEADER = const_convert_to_unicode("\u2560 ") + def _print_prio(msg, color_func, back = False, flush = True, end = '\n', stderr = False): if is_mute(): @@ -507,12 +509,14 @@ def _print_prio(msg, color_func, back = False, flush = True, end = '\n', is_tty = is_stdout_a_tty() if is_tty: writechar("\r", stderr = stderr) - if back: - msg = color_func(">>") + " " + msg - else: - msg = color_func(">>") + " " + msg + end + header = color_func(_PRINT_PRIO_HEADER) + + _std_write(header, stderr = stderr) _std_write(msg, stderr = stderr) + if not back: + _std_write(end, stderr = stderr) + if back and (not is_tty): # in this way files are properly written writechar("\n", stderr = stderr)