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:
Radostin Stoyanov
2022-02-24 16:31:53 +00:00
committed by GitHub
parent 50f397b249
commit d84179e42f
36 changed files with 176 additions and 170 deletions

View File

@@ -1,15 +1,11 @@
#!/usr/bin/env python3
import argparse
import sys
import socket
import random
import struct
import argparse
import socket
from scapy.all import sendp, send, get_if_list, get_if_hwaddr, hexdump
from scapy.all import Packet
from scapy.all import Ether, IP, UDP, TCP
from myTunnel_header import MyTunnel
from scapy.all import IP, TCP, Ether, get_if_hwaddr, get_if_list, sendp
def get_if():
ifs=get_if_list()
@@ -35,11 +31,11 @@ def main():
iface = get_if()
if (dst_id is not None):
print(("sending on interface {} to dst_id {}".format(iface, str(dst_id))))
print("sending on interface {} to dst_id {}".format(iface, str(dst_id)))
pkt = Ether(src=get_if_hwaddr(iface), dst='ff:ff:ff:ff:ff:ff')
pkt = pkt / MyTunnel(dst_id=dst_id) / IP(dst=addr) / args.message
else:
print(("sending on interface {} to IP addr {}".format(iface, str(addr))))
print("sending on interface {} to IP addr {}".format(iface, str(addr)))
pkt = Ether(src=get_if_hwaddr(iface), dst='ff:ff:ff:ff:ff:ff')
pkt = pkt / IP(dst=addr) / TCP(dport=1234, sport=random.randint(49152,65535)) / args.message