# HG changeset patch
# User Pascal Volk <user@localhost.localdomain.org>
# Date 1244493238 0
# Node ID 6b0d09cdfbdb9e8a05602c493d8392188dde0b26
# Parent  a72ea07394cc01114f10b56c48b030a7d33154c8
buildTable(): small cosmetics/enhancements

diff -r a72ea07394cc -r 6b0d09cdfbdb nixspamsum
--- a/nixspamsum	Mon Jun 08 16:10:07 2009 +0000
+++ b/nixspamsum	Mon Jun 08 20:33:58 2009 +0000
@@ -93,14 +93,18 @@
     clen = len(str(max(domains.values())))
     total = sum(domains.values())
     if percent:
-        format = '%%%ds  %%%dd  %%5.2f %%%%\n' % (dlen, clen)
+        format = ' %%%ds  %%%dd  %%6.2f %%%%\n' % (-dlen, clen)
         for d, c in doms:
             dfrac = 100./total*c
             output.write(format % (d, c, dfrac))
+        output.write('%s\n' % ((clen+dlen+14)*'-'))
+        output.write(format % ('total', total, 100))
     else:
-        format = '%%%ds  %%%dd\n' % (dlen, clen)
+        format = ' %%%ds  %%%dd\n' % (-dlen, clen)
         for d in doms:
             output.write(format % d)
+        output.write('%s\n' % ((clen+dlen+4)*'-'))
+        output.write(format % ('total', total))
 
 def showResult(nixspamsum, options):
     from cStringIO import StringIO