From b451a9da5eedbacd9216409cf8e21b19a0d848c6 Mon Sep 17 00:00:00 2001 From: shnavid Date: Fri, 10 Aug 2007 13:36:41 +0000 Subject: more fixes. git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@348 ef72aa8b-4018-0410-8976-d6e080ef94d8 --- src/extras/htmlog | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/extras/htmlog b/src/extras/htmlog index 1fbab8bb..d4680eea 100755 --- a/src/extras/htmlog +++ b/src/extras/htmlog @@ -54,7 +54,6 @@ class host_class: def eof(self): if self.tell() >= self.size(): - sys.exit("HOST IS EOF") return True return False @@ -123,7 +122,12 @@ class logfile_class: self.events = [] self.fname = fname self.fp = open(fname) - self.hostname = self.fp.readline()[16:].split(" ")[0] + + def hostname(self): + pos = self.fp.tell() + toret = self.fp.readline()[16:].split(" ")[0] + self.fp.seek(pos) + return toret def time_begin(self): pos = self.fp.tell() @@ -201,9 +205,10 @@ hosts = {} for logname in __cmdLineOpts__.logfiles: log = logfile_class(logname) - if not hosts.has_key(log.hostname): - hosts[log.hostname] = host_class() - hosts[log.hostname].add_log(log) + hostname = log.hostname() + if not hosts.has_key(hostname): + hosts[hostname] = host_class() + hosts[hostname].add_log(log) #print hosts["moka"].readline() #print hosts["moka"].readline() @@ -351,19 +356,19 @@ while True: break if inc == 0 or inc % 200 == 0: - print """Time of Eventnode-1node-2node-3""" + print """Timenode-1node-2node-3""" if not previous_date or time.strftime("%b %d", previous_date) != time.strftime("%b %d", lowest_date): print """%s""" % time.strftime("%A, %B %d", lowest_date) if inc % 2 == 0: row_class = "spec" - else: row_class = "altspec" + else: row_class = "specalt" # FIXME: if this tick has an event, add if not previous_date or previous_date != lowest_date: - print """""" + time.strftime("%H:%M:%S", lowest_date) + """""" + print """%s""" % (row_class, time.strftime("%H:%M:%S", lowest_date) ) else: - print """""" + time.strftime("%H:%M:%S", lowest_date) + """""" + print """%s""" % (row_class, time.strftime("%H:%M:%S", lowest_date) ) for host in hosts: if hosts[host].time() == lowest_date: -- cgit