diff options
author | Rob Austein <sra@hactrn.net> | 2012-05-21 21:54:29 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2012-05-21 21:54:29 +0000 |
commit | 8b2aa2272a8c4a65594c215da2638b0c9b0633f3 (patch) | |
tree | 01a6fd44d76dafbd3548e8e621b58951ccf2ab2c /rcynic/rcynic-text.py | |
parent | 8296c4db9f512435fb2daa9a51299df0074f95be (diff) |
Cleanup
svn path=/trunk/; revision=4504
Diffstat (limited to 'rcynic/rcynic-text.py')
-rw-r--r-- | rcynic/rcynic-text.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/rcynic/rcynic-text.py b/rcynic/rcynic-text.py index 6af6e7b0..f99c0792 100644 --- a/rcynic/rcynic-text.py +++ b/rcynic/rcynic-text.py @@ -85,19 +85,23 @@ class Session(object): visible = [label for label in self.labels if label.visible] hostnames = sorted(self.hosts) hostwidth = max(len(hostname) for hostname in hostnames) - separator = ("+-" + "-" * hostwidth + "-+-" + - "-+-".join("-" * (label.width) for label in visible) + "-+") + separator = "+-%s-+-%s-+" % ( + "-" * hostwidth, + "-+-".join("-" * label.width for label in visible)) print separator for i in xrange(max(len(label.lines) for label in visible)): - print ("|" + " " * (hostwidth + 2) + "|" + - "|".join(label.line(i) for label in visible) + "|") + print "| %s |%s|" % ( + ("Hostname" if i == 0 else "").ljust(hostwidth), + "|".join(label.line(i) for label in visible)) print separator for hostname in hostnames: - print ("| " + hostname.ljust(hostwidth + 1) + "|" + - "|".join(self.hosts[hostname].total(label) for label in visible) + "|") + print "| %s |%s|" % ( + hostname.ljust(hostwidth), + "|".join(self.hosts[hostname].total(label) for label in visible)) print separator - print ("| " + "Total".ljust(hostwidth) + " |" + - "|".join(label.total for label in visible) + "|") + print "| %s |%s|" % ( + "Total".ljust(hostwidth), + "|".join(label.total for label in visible)) print separator |