move to python 3
This commit is contained in:
+4
-4
@@ -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 = "<b>%s</b>" % 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('<table id="ntable" class="sortable">')
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user