diff --git a/hbdclass.py b/hbdclass.py index 50da640..dff4cb1 100644 --- a/hbdclass.py +++ b/hbdclass.py @@ -17,7 +17,7 @@ DEBUG=1 def log(host, m): if DEBUG: - print "class log: %s %s" % (host, m) + print("class log: %s %s" % (host, m)) class Connection: @@ -268,7 +268,7 @@ class Host: state = "%s" % self.state elif self.state in ["up", "UP"]: state = "" - for x in self.connections.keys(): + for x in list(self.connections.keys()): try: state += " %5.1f" % (self.connections[x].rtts[-1]) except: @@ -285,7 +285,7 @@ class Host: if self.upcount > 0: # return "(%0.1f%%) %s %s %s " % ((self.doesack * 100.0) / self.upcount, self.doesack, self.upcount, self.hdwcounts) r = "" - for v in xrange(3): + for v in range(3): a,u = self.hdwcounts[v] if (self.upcount - u) != 0: vs = "%0.0f" % (100.0 - (((self.doesack - a) * 100.0) / (self.upcount - u))) @@ -338,7 +338,7 @@ class Host: res = [] res.append('') res.append(ubHost.htmltable('th', ubHost.headerdict(), short)) - hosts_sorted = Host.hosts.keys() + hosts_sorted = list(Host.hosts.keys()) if len(hosts_sorted): hosts_sorted.sort() for h in hosts_sorted: