From d4ac5f7b10cdd184fcd47bdc42e2bd61eb1a7815 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Fri, 17 Jul 2015 08:25:26 +0400 Subject: [PATCH] modifier l'affichage des fonction e* --- lib/pyulib/src/ulib/base/output.py | 22 ++++++++--------- lib/ulib/base | 22 ++++++++--------- lib/ulib/pretty | 38 +++++++++++++++--------------- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/lib/pyulib/src/ulib/base/output.py b/lib/pyulib/src/ulib/base/output.py index e3ab2be..b373293 100644 --- a/lib/pyulib/src/ulib/base/output.py +++ b/lib/pyulib/src/ulib/base/output.py @@ -210,15 +210,15 @@ def eerror(msg=None, flush=None, show_tb=False): if msg is None or show_tb: cls, obj, tb = sys.exc_info() msg, nl = __add_suffix(msg, cls, obj, tb, show_tb) - eprint((('error: ', 'r,@'), msg), V_ERROR, nl, flush, ERR) -def ewarn(msg, flush=None): eprint((('warning: ', 'y,@'), msg), V_WARNING, True, flush, ERR) -def enote(msg, flush=None): eprint((('note: ', 'g,@'), msg), V_INFO, True, flush, ERR) -def eimportant(msg, flush=None): eprint((('important: ', 'r,@'), msg), V_ERROR, True, flush, ERR) -def eattention(msg, flush=None): eprint((('attention: ', 'y,@'), msg), V_WARNING, True, flush, ERR) -def einfo(msg, flush=None): eprint((('info: ', 'b,@'), msg), V_INFO, True, flush, ERR) + eprint((('E ', 'r,@'), msg), V_ERROR, nl, flush, ERR) +def ewarn(msg, flush=None): eprint((('W ', 'y,@'), msg), V_WARNING, True, flush, ERR) +def enote(msg, flush=None): eprint((('N ', 'g,@'), msg), V_INFO, True, flush, ERR) +def eimportant(msg, flush=None): eprint((('! ', 'r,@'), msg), V_ERROR, True, flush, ERR) +def eattention(msg, flush=None): eprint((('* ', 'y,@'), msg), V_WARNING, True, flush, ERR) +def einfo(msg, flush=None): eprint((('I ', 'b,@'), msg), V_INFO, True, flush, ERR) def eecho(msg, flush=None): eprint(msg, V_INFO, True, flush, ERR) def eecho_(msg, flush=None): eprint(msg, V_INFO, False, flush, ERR) -def edebug(msg, flush=None): eprint((('debug: ', 'w,@'), msg), V_DEBUG, True, flush, ERR) +def edebug(msg, flush=None): eprint((('D ', 'w,@'), msg), V_DEBUG, True, flush, ERR) def get_ntlevel(): return len(get_tlevel()) / 4 def set_ntlevel(l): set_tlevel(l * ' ') @@ -262,19 +262,19 @@ def etitle(title, func_or_result=None, *args, **kw): estack = get_estack() inc_ntlevel() add_estack('t') - eprint((('+++ ', 'b,@'), (title, 'b,@,_')), V_INFO, True, True, ERR) + eprint((('T ', 'b,@'), (title, 'b,@,_')), V_INFO, True, True, ERR) if func_or_result is not None: eend(func_or_result, *args, **kw) def estep(msg, func_or_result=None, flush=None): r, msg, exc_info = _result(msg, func_or_result) - eprint((('* ', 'w,@'), msg), V_INFO, True, flush, ERR) + eprint((('. ', 'w,@'), msg), V_INFO, True, flush, ERR) _raise(exc_info) def estep_(msg, func_or_result=None, flush=None): r, msg, exc_info = _result(msg, func_or_result) - eprint((('* ', 'w,@'), msg), V_INFO, False, flush, ERR) + eprint((('. ', 'w,@'), msg), V_INFO, False, flush, ERR) _raise(exc_info) def ebegin(title, func_or_result=None, *args, **kw): add_estack('b') - eprint((('* ', 'w,@'), title + ': '), V_INFO, False, True, ERR) + eprint((('. ', 'w,@'), title + ': '), V_INFO, False, True, ERR) if func_or_result is not None: eend(func_or_result, *args, **kw) def _edoto(): eprint('.', V_INFO, False, True, ERR) def _edotx(): eprint((('x', 'r,@'),), V_INFO, False, True, ERR) diff --git a/lib/ulib/base b/lib/ulib/base index c6218ef..a81b3c2 100644 --- a/lib/ulib/base +++ b/lib/ulib/base @@ -2966,9 +2966,9 @@ function __indent() { fi } # fonctions à surcharger pour modifier la façon dont les messages sont affichés -function __eerror() { tooenc "$(__edate)${__tlevel}* error: $(__indent "$1")"; } -function __ewarn() { tooenc "$(__edate)${__tlevel}* warning: $(__indent "$1")"; } -function __enote() { tooenc "$(__edate)${__tlevel}* note: $(__indent "$1")"; } +function __eerror() { tooenc "$(__edate)${__tlevel}E $(__indent "$1")"; } +function __ewarn() { tooenc "$(__edate)${__tlevel}W $(__indent "$1")"; } +function __enote() { tooenc "$(__edate)${__tlevel}N $(__indent "$1")"; } function __ebanner() { local maxi="${COLUMNS:-80}" local -a lines @@ -2990,24 +2990,24 @@ function __ebanner() { done tooenc "$psfix" } -function __eimportant() { tooenc "$(__edate)${__tlevel}* important: $(__indent "$1")"; } -function __eattention() { tooenc "$(__edate)${__tlevel}* attention: $(__indent "$1")"; } -function __einfo() { tooenc "$(__edate)${__tlevel}* info: $(__indent "$1")"; } +function __eimportant() { tooenc "$(__edate)${__tlevel}! $(__indent "$1")"; } +function __eattention() { tooenc "$(__edate)${__tlevel}* $(__indent "$1")"; } +function __einfo() { tooenc "$(__edate)${__tlevel}I $(__indent "$1")"; } function __eecho() { tooenc "$(__edate)${__tlevel}$(__indent "$1")"; } function __eecho_() { tooenc_ "$(__edate)${__tlevel}$(__indent "$1")"; } -function __edebug() { tooenc "$(__edate)${__tlevel}* debug: $(__indent "$1")"; } -function __estep() { tooenc "$(__edate)${__tlevel}* $(__indent "$1")"; } +function __edebug() { tooenc "$(__edate)${__tlevel}D $(__indent "$1")"; } +function __estep() { tooenc "$(__edate)${__tlevel}. $(__indent "$1")"; } function __estepe() { __estep "$@"; } function __estepw() { __estep "$@"; } function __estepn() { __estep "$@"; } function __estepi() { __estep "$@"; } -function __estep_() { tooenc_ "$(__edate)${__tlevel}* $(__indent "$1")"; } +function __estep_() { tooenc_ "$(__edate)${__tlevel}. $(__indent "$1")"; } function __estepe_() { __estep_ "$@"; } function __estepw_() { __estep_ "$@"; } function __estepn_() { __estep_ "$@"; } function __estepi_() { __estep_ "$@"; } -function __etitle() { tooenc "$(__edate)${__tlevel}+++ $(__indent "$1")"; } -function __ebegin() { tooenc_ "$(__edate)${__tlevel}* $(__indent "$1"): "; } +function __etitle() { tooenc "$(__edate)${__tlevel}T $(__indent "$1")"; } +function __ebegin() { tooenc_ "$(__edate)${__tlevel}. $(__indent "$1"): "; } function __edoto() { echo_ "."; } function __edotw() { echo_ "w"; } function __edotx() { echo_ "x"; } diff --git a/lib/ulib/pretty b/lib/ulib/pretty index 75acb9e..31f962b 100644 --- a/lib/ulib/pretty +++ b/lib/ulib/pretty @@ -67,9 +67,9 @@ function __set_no_colors() { } __set_no_colors -function __eerror() { tooenc "$(__edate)${__tlevel}${COULEUR_ROUGE}* error:${COULEUR_NORMALE} $(__indent "$1")"; } -function __ewarn() { tooenc "$(__edate)${__tlevel}${COULEUR_JAUNE}* warning:${COULEUR_NORMALE} $(__indent "$1")"; } -function __enote() { tooenc "$(__edate)${__tlevel}${COULEUR_VERTE}* note:${COULEUR_NORMALE} $(__indent "$1")"; } +function __eerror() { tooenc "$(__edate)${__tlevel}${COULEUR_ROUGE}E${COULEUR_NORMALE} $(__indent "$1")"; } +function __ewarn() { tooenc "$(__edate)${__tlevel}${COULEUR_JAUNE}W${COULEUR_NORMALE} $(__indent "$1")"; } +function __enote() { tooenc "$(__edate)${__tlevel}${COULEUR_VERTE}N${COULEUR_NORMALE} $(__indent "$1")"; } function __ebanner() { local maxi="${COLUMNS:-80}" local -a lines @@ -91,22 +91,22 @@ function __ebanner() { done tooenc "$psfix$COULEUR_NORMALE" } -function __eimportant() { tooenc "$(__edate)${__tlevel}${COULEUR_ROUGE}* important:${COULEUR_NORMALE} $(__indent "$1")"; } -function __eattention() { tooenc "$(__edate)${__tlevel}${COULEUR_JAUNE}* attention:${COULEUR_NORMALE} $(__indent "$1")"; } -function __einfo() { tooenc "$(__edate)${__tlevel}${COULEUR_BLEUE}* info:${COULEUR_NORMALE} $(__indent "$1")"; } -function __edebug() { tooenc "$(__edate)${__tlevel}${COULEUR_BLANCHE}* debug:${COULEUR_NORMALE} $(__indent "$1")"; } -function __estep() { tooenc "$(__edate)${__tlevel}${COULEUR_BLANCHE}*${COULEUR_NORMALE} $(__indent "$1")"; } -function __estepe() { tooenc "$(__edate)${__tlevel}${COULEUR_ROUGE}*${COULEUR_NORMALE} $(__indent "$1")"; } -function __estepw() { tooenc "$(__edate)${__tlevel}${COULEUR_JAUNE}*${COULEUR_NORMALE} $(__indent "$1")"; } -function __estepn() { tooenc "$(__edate)${__tlevel}${COULEUR_VERTE}*${COULEUR_NORMALE} $(__indent "$1")"; } -function __estepi() { tooenc "$(__edate)${__tlevel}${COULEUR_BLEUE}*${COULEUR_NORMALE} $(__indent "$1")"; } -function __estep_() { tooenc_ "$(__edate)${__tlevel}${COULEUR_BLANCHE}*${COULEUR_NORMALE} $(__indent "$1")"; } -function __estepe_() { tooenc_ "$(__edate)${__tlevel}${COULEUR_ROUGE}*${COULEUR_NORMALE} $(__indent "$1")"; } -function __estepw_() { tooenc_ "$(__edate)${__tlevel}${COULEUR_JAUNE}*${COULEUR_NORMALE} $(__indent "$1")"; } -function __estepn_() { tooenc_ "$(__edate)${__tlevel}${COULEUR_VERTE}*${COULEUR_NORMALE} $(__indent "$1")"; } -function __estepi_() { tooenc_ "$(__edate)${__tlevel}${COULEUR_BLEUE}*${COULEUR_NORMALE} $(__indent "$1")"; } -function __etitle() { tooenc "$(__edate)${__tlevel}${COULEUR_BLEUE}+++ $(get_color _)$(__indent "$1")${COULEUR_NORMALE}"; } -function __ebegin() { tooenc_ "$(__edate)${__tlevel}${COULEUR_BLANCHE}*${COULEUR_NORMALE} $(__indent "$1"): "; } +function __eimportant() { tooenc "$(__edate)${__tlevel}${COULEUR_ROUGE}!${COULEUR_NORMALE} $(__indent "$1")"; } +function __eattention() { tooenc "$(__edate)${__tlevel}${COULEUR_JAUNE}*${COULEUR_NORMALE} $(__indent "$1")"; } +function __einfo() { tooenc "$(__edate)${__tlevel}${COULEUR_BLEUE}I${COULEUR_NORMALE} $(__indent "$1")"; } +function __edebug() { tooenc "$(__edate)${__tlevel}${COULEUR_BLANCHE}D${COULEUR_NORMALE} $(__indent "$1")"; } +function __estep() { tooenc "$(__edate)${__tlevel}${COULEUR_BLANCHE}.${COULEUR_NORMALE} $(__indent "$1")"; } +function __estepe() { tooenc "$(__edate)${__tlevel}${COULEUR_ROUGE}.${COULEUR_NORMALE} $(__indent "$1")"; } +function __estepw() { tooenc "$(__edate)${__tlevel}${COULEUR_JAUNE}.${COULEUR_NORMALE} $(__indent "$1")"; } +function __estepn() { tooenc "$(__edate)${__tlevel}${COULEUR_VERTE}.${COULEUR_NORMALE} $(__indent "$1")"; } +function __estepi() { tooenc "$(__edate)${__tlevel}${COULEUR_BLEUE}.${COULEUR_NORMALE} $(__indent "$1")"; } +function __estep_() { tooenc_ "$(__edate)${__tlevel}${COULEUR_BLANCHE}.${COULEUR_NORMALE} $(__indent "$1")"; } +function __estepe_() { tooenc_ "$(__edate)${__tlevel}${COULEUR_ROUGE}.${COULEUR_NORMALE} $(__indent "$1")"; } +function __estepw_() { tooenc_ "$(__edate)${__tlevel}${COULEUR_JAUNE}.${COULEUR_NORMALE} $(__indent "$1")"; } +function __estepn_() { tooenc_ "$(__edate)${__tlevel}${COULEUR_VERTE}.${COULEUR_NORMALE} $(__indent "$1")"; } +function __estepi_() { tooenc_ "$(__edate)${__tlevel}${COULEUR_BLEUE}.${COULEUR_NORMALE} $(__indent "$1")"; } +function __etitle() { tooenc "$(__edate)${__tlevel}${COULEUR_BLEUE}T $(get_color _)$(__indent "$1")${COULEUR_NORMALE}"; } +function __ebegin() { tooenc_ "$(__edate)${__tlevel}${COULEUR_BLANCHE}.${COULEUR_NORMALE} $(__indent "$1"): "; } function __edoto() { echo_ "."; } function __edotw() { echo_ "${COULEUR_JAUNE}w${COULEUR_NORMALE}"; } function __edotx() { echo_ "${COULEUR_ROUGE}x${COULEUR_NORMALE}"; }