modifier l'affichage des fonction e*

This commit is contained in:
Jephté Clain 2015-07-17 08:25:26 +04:00
parent 7685cae1c4
commit d4ac5f7b10
3 changed files with 41 additions and 41 deletions

View File

@ -210,15 +210,15 @@ def eerror(msg=None, flush=None, show_tb=False):
if msg is None or show_tb: if msg is None or show_tb:
cls, obj, tb = sys.exc_info() cls, obj, tb = sys.exc_info()
msg, nl = __add_suffix(msg, cls, obj, tb, show_tb) msg, nl = __add_suffix(msg, cls, obj, tb, show_tb)
eprint((('error: ', 'r,@'), msg), V_ERROR, nl, flush, ERR) eprint((('E ', 'r,@'), msg), V_ERROR, nl, flush, ERR)
def ewarn(msg, flush=None): eprint((('warning: ', 'y,@'), msg), V_WARNING, True, flush, ERR) def ewarn(msg, flush=None): eprint((('W ', 'y,@'), msg), V_WARNING, True, flush, ERR)
def enote(msg, flush=None): eprint((('note: ', 'g,@'), msg), V_INFO, True, flush, ERR) def enote(msg, flush=None): eprint((('N ', 'g,@'), msg), V_INFO, True, flush, ERR)
def eimportant(msg, flush=None): eprint((('important: ', 'r,@'), msg), V_ERROR, True, flush, ERR) def eimportant(msg, flush=None): eprint((('! ', 'r,@'), msg), V_ERROR, True, flush, ERR)
def eattention(msg, flush=None): eprint((('attention: ', 'y,@'), msg), V_WARNING, True, flush, ERR) def eattention(msg, flush=None): eprint((('* ', 'y,@'), msg), V_WARNING, True, flush, ERR)
def einfo(msg, flush=None): eprint((('info: ', 'b,@'), msg), V_INFO, 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, True, flush, ERR)
def eecho_(msg, flush=None): eprint(msg, V_INFO, False, 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 get_ntlevel(): return len(get_tlevel()) / 4
def set_ntlevel(l): set_tlevel(l * ' ') def set_ntlevel(l): set_tlevel(l * ' ')
@ -262,19 +262,19 @@ def etitle(title, func_or_result=None, *args, **kw):
estack = get_estack() estack = get_estack()
inc_ntlevel() inc_ntlevel()
add_estack('t') 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) if func_or_result is not None: eend(func_or_result, *args, **kw)
def estep(msg, func_or_result=None, flush=None): def estep(msg, func_or_result=None, flush=None):
r, msg, exc_info = _result(msg, func_or_result) 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) _raise(exc_info)
def estep_(msg, func_or_result=None, flush=None): def estep_(msg, func_or_result=None, flush=None):
r, msg, exc_info = _result(msg, func_or_result) 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) _raise(exc_info)
def ebegin(title, func_or_result=None, *args, **kw): def ebegin(title, func_or_result=None, *args, **kw):
add_estack('b') 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) if func_or_result is not None: eend(func_or_result, *args, **kw)
def _edoto(): eprint('.', V_INFO, False, True, ERR) def _edoto(): eprint('.', V_INFO, False, True, ERR)
def _edotx(): eprint((('x', 'r,@'),), V_INFO, False, True, ERR) def _edotx(): eprint((('x', 'r,@'),), V_INFO, False, True, ERR)

View File

@ -2966,9 +2966,9 @@ function __indent() {
fi fi
} }
# fonctions à surcharger pour modifier la façon dont les messages sont affichés # fonctions à surcharger pour modifier la façon dont les messages sont affichés
function __eerror() { tooenc "$(__edate)${__tlevel}* error: $(__indent "$1")"; } function __eerror() { tooenc "$(__edate)${__tlevel}E $(__indent "$1")"; }
function __ewarn() { tooenc "$(__edate)${__tlevel}* warning: $(__indent "$1")"; } function __ewarn() { tooenc "$(__edate)${__tlevel}W $(__indent "$1")"; }
function __enote() { tooenc "$(__edate)${__tlevel}* note: $(__indent "$1")"; } function __enote() { tooenc "$(__edate)${__tlevel}N $(__indent "$1")"; }
function __ebanner() { function __ebanner() {
local maxi="${COLUMNS:-80}" local maxi="${COLUMNS:-80}"
local -a lines local -a lines
@ -2990,24 +2990,24 @@ function __ebanner() {
done done
tooenc "$psfix" tooenc "$psfix"
} }
function __eimportant() { tooenc "$(__edate)${__tlevel}* important: $(__indent "$1")"; } function __eimportant() { tooenc "$(__edate)${__tlevel}! $(__indent "$1")"; }
function __eattention() { tooenc "$(__edate)${__tlevel}* attention: $(__indent "$1")"; } function __eattention() { tooenc "$(__edate)${__tlevel}* $(__indent "$1")"; }
function __einfo() { tooenc "$(__edate)${__tlevel}* info: $(__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 __eecho_() { tooenc_ "$(__edate)${__tlevel}$(__indent "$1")"; } function __eecho_() { tooenc_ "$(__edate)${__tlevel}$(__indent "$1")"; }
function __edebug() { tooenc "$(__edate)${__tlevel}* debug: $(__indent "$1")"; } function __edebug() { tooenc "$(__edate)${__tlevel}D $(__indent "$1")"; }
function __estep() { tooenc "$(__edate)${__tlevel}* $(__indent "$1")"; } function __estep() { tooenc "$(__edate)${__tlevel}. $(__indent "$1")"; }
function __estepe() { __estep "$@"; } function __estepe() { __estep "$@"; }
function __estepw() { __estep "$@"; } function __estepw() { __estep "$@"; }
function __estepn() { __estep "$@"; } function __estepn() { __estep "$@"; }
function __estepi() { __estep "$@"; } function __estepi() { __estep "$@"; }
function __estep_() { tooenc_ "$(__edate)${__tlevel}* $(__indent "$1")"; } function __estep_() { tooenc_ "$(__edate)${__tlevel}. $(__indent "$1")"; }
function __estepe_() { __estep_ "$@"; } function __estepe_() { __estep_ "$@"; }
function __estepw_() { __estep_ "$@"; } function __estepw_() { __estep_ "$@"; }
function __estepn_() { __estep_ "$@"; } function __estepn_() { __estep_ "$@"; }
function __estepi_() { __estep_ "$@"; } function __estepi_() { __estep_ "$@"; }
function __etitle() { tooenc "$(__edate)${__tlevel}+++ $(__indent "$1")"; } function __etitle() { tooenc "$(__edate)${__tlevel}T $(__indent "$1")"; }
function __ebegin() { tooenc_ "$(__edate)${__tlevel}* $(__indent "$1"): "; } function __ebegin() { tooenc_ "$(__edate)${__tlevel}. $(__indent "$1"): "; }
function __edoto() { echo_ "."; } function __edoto() { echo_ "."; }
function __edotw() { echo_ "w"; } function __edotw() { echo_ "w"; }
function __edotx() { echo_ "x"; } function __edotx() { echo_ "x"; }

View File

@ -67,9 +67,9 @@ function __set_no_colors() {
} }
__set_no_colors __set_no_colors
function __eerror() { tooenc "$(__edate)${__tlevel}${COULEUR_ROUGE}* error:${COULEUR_NORMALE} $(__indent "$1")"; } function __eerror() { tooenc "$(__edate)${__tlevel}${COULEUR_ROUGE}E${COULEUR_NORMALE} $(__indent "$1")"; }
function __ewarn() { tooenc "$(__edate)${__tlevel}${COULEUR_JAUNE}* warning:${COULEUR_NORMALE} $(__indent "$1")"; } function __ewarn() { tooenc "$(__edate)${__tlevel}${COULEUR_JAUNE}W${COULEUR_NORMALE} $(__indent "$1")"; }
function __enote() { tooenc "$(__edate)${__tlevel}${COULEUR_VERTE}* note:${COULEUR_NORMALE} $(__indent "$1")"; } function __enote() { tooenc "$(__edate)${__tlevel}${COULEUR_VERTE}N${COULEUR_NORMALE} $(__indent "$1")"; }
function __ebanner() { function __ebanner() {
local maxi="${COLUMNS:-80}" local maxi="${COLUMNS:-80}"
local -a lines local -a lines
@ -91,22 +91,22 @@ function __ebanner() {
done done
tooenc "$psfix$COULEUR_NORMALE" tooenc "$psfix$COULEUR_NORMALE"
} }
function __eimportant() { tooenc "$(__edate)${__tlevel}${COULEUR_ROUGE}* important:${COULEUR_NORMALE} $(__indent "$1")"; } function __eimportant() { tooenc "$(__edate)${__tlevel}${COULEUR_ROUGE}!${COULEUR_NORMALE} $(__indent "$1")"; }
function __eattention() { tooenc "$(__edate)${__tlevel}${COULEUR_JAUNE}* attention:${COULEUR_NORMALE} $(__indent "$1")"; } function __eattention() { tooenc "$(__edate)${__tlevel}${COULEUR_JAUNE}*${COULEUR_NORMALE} $(__indent "$1")"; }
function __einfo() { tooenc "$(__edate)${__tlevel}${COULEUR_BLEUE}* info:${COULEUR_NORMALE} $(__indent "$1")"; } function __einfo() { tooenc "$(__edate)${__tlevel}${COULEUR_BLEUE}I${COULEUR_NORMALE} $(__indent "$1")"; }
function __edebug() { tooenc "$(__edate)${__tlevel}${COULEUR_BLANCHE}* debug:${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 __estep() { tooenc "$(__edate)${__tlevel}${COULEUR_BLANCHE}.${COULEUR_NORMALE} $(__indent "$1")"; }
function __estepe() { tooenc "$(__edate)${__tlevel}${COULEUR_ROUGE}*${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 __estepw() { tooenc "$(__edate)${__tlevel}${COULEUR_JAUNE}.${COULEUR_NORMALE} $(__indent "$1")"; }
function __estepn() { tooenc "$(__edate)${__tlevel}${COULEUR_VERTE}*${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 __estepi() { tooenc "$(__edate)${__tlevel}${COULEUR_BLEUE}.${COULEUR_NORMALE} $(__indent "$1")"; }
function __estep_() { tooenc_ "$(__edate)${__tlevel}${COULEUR_BLANCHE}*${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 __estepe_() { tooenc_ "$(__edate)${__tlevel}${COULEUR_ROUGE}.${COULEUR_NORMALE} $(__indent "$1")"; }
function __estepw_() { tooenc_ "$(__edate)${__tlevel}${COULEUR_JAUNE}*${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 __estepn_() { tooenc_ "$(__edate)${__tlevel}${COULEUR_VERTE}.${COULEUR_NORMALE} $(__indent "$1")"; }
function __estepi_() { tooenc_ "$(__edate)${__tlevel}${COULEUR_BLEUE}*${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 __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 __ebegin() { tooenc_ "$(__edate)${__tlevel}${COULEUR_BLANCHE}.${COULEUR_NORMALE} $(__indent "$1"): "; }
function __edoto() { echo_ "."; } function __edoto() { echo_ "."; }
function __edotw() { echo_ "${COULEUR_JAUNE}w${COULEUR_NORMALE}"; } function __edotw() { echo_ "${COULEUR_JAUNE}w${COULEUR_NORMALE}"; }
function __edotx() { echo_ "${COULEUR_ROUGE}x${COULEUR_NORMALE}"; } function __edotx() { echo_ "${COULEUR_ROUGE}x${COULEUR_NORMALE}"; }