tazpanel rev 167

libtazpanel: align *any* status
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Apr 22 14:57:12 2011 +0200 (2011-04-22)
parents 17f82937866a
children a780dfcb73c4
files lib/libtazpanel
line diff
     1.1 --- a/lib/libtazpanel	Fri Apr 22 11:46:37 2011 +0200
     1.2 +++ b/lib/libtazpanel	Fri Apr 22 14:57:12 2011 +0200
     1.3 @@ -45,19 +45,10 @@
     1.4  
     1.5  # Remove status and ESC char from tazpkg/tazlito commands output
     1.6  filter_taztools_msgs() {
     1.7 -	grep ^[a-zA-Z0-9] | sed s'/\[^Gm]*.//g' | awk '{
     1.8 -    if (/\[ OK \]/) { 
     1.9 -	n=index($0,"[ OK ]")
    1.10 -	s=""; for (i = n; i < 70; i++) s = s " "
    1.11 -	printf "%s%s[ <span class=\"diff-add\">OK</span> ]\n",substr($0,1,n-1),s
    1.12 -    }
    1.13 -    else if (/\[ Failed \]/) { 
    1.14 -	n=index($0,"[ Failed ]")
    1.15 -	s=""; for (i = n; i < 70; i++) s = s " "
    1.16 -	printf "%s%s[ <span class=\"diff-rm\">Failed</span> ]\n",substr($0,1,n-1),s
    1.17 -    }
    1.18 -    else print
    1.19 -}'
    1.20 +	grep ^[a-zA-Z0-9] | sed -e s'/\[^Gm]*.//g' \
    1.21 +		-e ':a;s/^\(.\{1,68\}\)\(\[ [A-Za-z]* \]\)/\1 \2/;ta' \
    1.22 +		-e 's#\[ OK \]#[ <span class="diff-add">OK</span> ]#' \
    1.23 +		-e 's#\[ Failed \]#[ <span class="diff-rm">Failed</span> ]#'
    1.24  }
    1.25  
    1.26  # LOG activities