[Spambayes-checkins] spambayes table.py,1.2,1.3

T. Alexander Popiel popiel@users.sourceforge.net
Sat Oct 26 03:07:09 2002


Update of /cvsroot/spambayes/spambayes
In directory usw-pr-cvs1:/tmp/cvs-serv29445

Modified Files:
	table.py 
Log Message:
Fixed table.py to stagger ham:spam ratios across two lines if the entries are
8 characters or longer.


Index: table.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/table.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** table.py	21 Oct 2002 21:18:55 -0000	1.2
--- table.py	26 Oct 2002 02:07:06 -0000	1.3
***************
*** 104,107 ****
--- 104,108 ----
  
  ratio = "ham:spam: "
+ rat2  = "          "
  fptot = "fp total: "
  fpper = "fp %:     "
***************
*** 124,128 ****
      (htest, stest, fp, fn, un, fpp, fnp, unp, cost, bestcost,
       hamdevall, spamdevall) = suck(file(filename))
!     ratio += "%8s"   % ("%d:%d" % (htest, stest))
      fptot += "%8d"   % fp
      fpper += "%8.2f" % fpp
--- 125,136 ----
      (htest, stest, fp, fn, un, fpp, fnp, unp, cost, bestcost,
       hamdevall, spamdevall) = suck(file(filename))
!     if len(ratio) > len(rat2):
!         ratio += "        "
!         ratio = ratio[0:(len(rat2) + 8)]
!         rat2  += " %7s" % ("%d:%d" % (htest, stest))
!     else:
!         rat2  += "        "
!         rat2  = rat2[0:(len(ratio) + 8)]
!         ratio += " %7s" % ("%d:%d" % (htest, stest))
      fptot += "%8d"   % fp
      fpper += "%8.2f" % fpp
***************
*** 142,145 ****
--- 150,155 ----
  
  print ratio
+ if ":"[0] in rat2:
+     print rat2
  print fptot
  print fpper