Commit 9c809f92 authored by Valentin Samir's avatar Valentin Samir
Browse files

[analyse] On n'affiche pas toujours l'upload total

parent f6fa910e
......@@ -126,13 +126,16 @@ def stats(ip_crans=[], ip_ext=[],
# on transforme tout en chaine
results = [ [ str(x) for x in line ] for line in results ]
upload = 0
download = 0
for line in results:
upload+=int(line[4])
download+=int(line[3])
print " upload: %sMo" % (upload/1024/1024)
print " download: %sMo" % (download/1024/1024)
try:
upload = 0
download = 0
for line in results:
upload+=int(line[4])
download+=int(line[3])
print " upload: %sMo" % (upload/1024/1024)
print " download: %sMo" % (download/1024/1024)
except IndexError:
pass
# on modifie les ip en noms de machine et les ports en noms
def nom_de_machine (ip) :
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment