SVN: toys/stbr/stbr.tcl

shadzik shadzik at pld-linux.org
Mon May 14 17:18:07 CEST 2007


Author: shadzik
Date: Mon May 14 17:18:06 2007
New Revision: 8523

Modified:
   toys/stbr/stbr.tcl
Log:
- add html colors to logfile


Modified: toys/stbr/stbr.tcl
==============================================================================
--- toys/stbr/stbr.tcl	(original)
+++ toys/stbr/stbr.tcl	Mon May 14 17:18:06 2007
@@ -6,32 +6,39 @@
 set back &
 set cntr 0
 set towho "./scripts/sent.txt"
+set green "<font color='green'>"
+set red "<font color='red'>"
+set endc "</font>"
+set bold "<b>"
+set endb "</b>"
 
 bind pub * !stbr pub:stbr
 bind pub * stbr: pub:stbr
 bind pub * stbr, pub:stbr
 
 proc pub:stbr {nick host hand chan arg} {
-global file back cntr logfile towho
+global file back cntr logfile towho red green endc bold endb
 putcmdlog "#$hand# Noticed Send To Build Request Mail command";
 if {$cntr<1} {incr cntr} {utimer 30 "set cntr 0"; putserv "privmsg $chan :$nick: I reached my STBR time limit (30sec). Please try later."; return 0}
 set first [lindex $arg 0]
 set second [lindex $arg 1]
 set specs ""; append specs $second; append specs " "; append specs [lrange $arg 2 end]
 set rspecs ""
+set logspecs ""
 if {!([string match th-ready $first] || [string match th-test $first])} {putserv "privmsg $chan :$nick: Usage: !stbr th-{ready|test} spec1 spec2 ..."; return 0}
 if {([string length $second]<2)} {putserv "privmsg $chan :$nick: Usage: !stbr th-{ready|test} spec1 spec2 ..."; return 0}
 foreach spec $specs {
 if {!([string match *.spec $spec])} { append spec ".spec"}
 lappend rspecs $spec
+append logspecs "$red"; lappend logspecs $spec ; append logspecs "$endc"
 if {[exec $file $nick $first $spec]==0} {putserv "privmsg $chan :$nick: An error occured. Couldn't send STBR Mail for $spec."; return 1}
 set tfile [open $towho r]
-gets $tfile person; append rspecs " (to $person)"
+gets $tfile person; append rspecs " (to $person)"; append logspecs " (to $green$person$endc)"
 close $tfile
 }
 set lfile [open $logfile a]
 set time [clock seconds]
-set log [clock format $time -format "%d.%m.%Y %H:%M"]; lappend log "$nick requested build for $rspecs to $first"; append log "<br>";
+set log [clock format $time -format "%d.%m.%Y %H:%M"]; lappend log "$nick requested build for $logspecs to $bold$first$endb"; append log "<br>";
 puts $lfile $log
 close $lfile
 putserv "privmsg $chan :$nick: Sent STBR Mail to $first for $rspecs."


More information about the pld-cvs-commit mailing list