clean up unused Python imports (#454)
* Remove unused python imports These changes have been auto-generated with: pip3 install isort autoflake isort -rc -sl . autoflake --remove-all-unused-imports -i -r . isort -rc -m 3 . Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org> * python: remove redundant parenthesis Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
committed by
GitHub
parent
50f397b249
commit
d84179e42f
@@ -2,6 +2,7 @@
|
||||
|
||||
from probe_hdrs import *
|
||||
|
||||
|
||||
def expand(x):
|
||||
yield x
|
||||
while x.payload:
|
||||
@@ -14,11 +15,11 @@ def handle_pkt(pkt):
|
||||
print("")
|
||||
for sw in data_layers:
|
||||
utilization = 0 if sw.cur_time == sw.last_time else 8.0*sw.byte_cnt/(sw.cur_time - sw.last_time)
|
||||
print(("Switch {} - Port {}: {} Mbps".format(sw.swid, sw.port, utilization)))
|
||||
print("Switch {} - Port {}: {} Mbps".format(sw.swid, sw.port, utilization))
|
||||
|
||||
def main():
|
||||
iface = 'eth0'
|
||||
print(("sniffing on {}".format(iface)))
|
||||
print("sniffing on {}".format(iface))
|
||||
sniff(iface = iface,
|
||||
prn = lambda x: handle_pkt(x))
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import time
|
||||
|
||||
from probe_hdrs import *
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
probe_pkt = Ether(dst='ff:ff:ff:ff:ff:ff', src=get_if_hwaddr('eth0')) / \
|
||||
|
||||
Reference in New Issue
Block a user