Skip to content

Commit da38301

Browse files
authored
Run linterns, corrected some minor stuff. (#25)
Co-authored-by: Sebastian Majewski <[email protected]>
1 parent 8f89f28 commit da38301

File tree

17 files changed

+48
-27
lines changed

17 files changed

+48
-27
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PYTHON_VERSION := 3.10
1+
PYTHON_VERSION := 3.11
22
VENV := venv
33
ROOT_PATH:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
44
PYTCP_PATH := pytcp

examples/icmp_echo_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def stop(self) -> None:
9191
time.sleep(0.1)
9292

9393
def __thread_client(self) -> None:
94-
9594
assert self._local_ip_address is not None
9695

9796
flow_id = random.randint(0, 65535)

examples/tcp_echo_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# pylint: disable = too-many-instance-attributes
2828

2929
"""
30-
The example 'user space' client for TCP echo. It activelly connects to
30+
The example 'user space' client for TCP echo. It actively connects to
3131
TCP Echo service and sends messages.
3232
3333
examples/tcp_echo_client.py

examples/udp_echo_client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# pylint: disable = too-many-instance-attributes
2828

2929
"""
30-
The example 'user space' client for UDP echo. It activelly sends messages
30+
The example 'user space' client for UDP echo. It actively sends messages
3131
to the UDP Echo service.
3232
3333
examples/udp_echo_client.py
@@ -97,7 +97,6 @@ def stop(self) -> None:
9797
time.sleep(0.1)
9898

9999
def __thread_client(self) -> None:
100-
101100
version = ip_version(self._local_ip_address)
102101
if version == 6:
103102
client_socket = socket.socket(

pytcp/lib/ip4_address.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def network(self) -> Ip4Network:
444444
"""
445445
return self._network
446446

447-
@property # type: ignore[override]
447+
@property
448448
def gateway(self) -> Ip4Address | None:
449449
"""
450450
Getter for the '_gateway' attribute.

pytcp/lib/ip6_address.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def network(self) -> Ip6Network:
444444
"""
445445
return self._network
446446

447-
@property # type: ignore[override]
447+
@property
448448
def gateway(self) -> Ip6Address | None:
449449
"""
450450
Getter for the '_gateway' attribute.

pytcp/protocols/dhcp4/ps.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ def __init__(
223223
i = 0
224224

225225
while i < len(raw_options):
226-
227226
if raw_options[i] == DHCP4_OPT_END:
228227
self.dhcp_options.append(Dhcp4OptEnd())
229228
break

pytcp/protocols/icmp6/phrx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def _phrx_icmp6(self: PacketHandler, packet_rx: PacketRx) -> None:
140140
ip6_dst=Ip6Address("ff02::1")
141141
if ip6_nd_dad
142142
else packet_rx.ip6.src, # use ff02::1 destination addriess when
143-
# responding to DAD equest
143+
# responding to DAD request
144144
ip6_hop=255,
145145
icmp6_type=ICMP6_ND_NEIGHBOR_ADVERTISEMENT,
146146
icmp6_na_flag_s=not ip6_nd_dad, # no S flag when responding to

pytcp/protocols/ip4/fpa.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ def assemble(self, frame: memoryview) -> None:
375375
0,
376376
bytes(self._src),
377377
bytes(self._dst),
378-
bytes(self._raw_options), # memoryview: conversion to bytes requir
379-
bytes(self._data), # memoryview: conversion to bytes requir
378+
bytes(self._raw_options), # memoryview: conversion to bytes require
379+
bytes(self._data), # memoryview: conversion to bytes require
380380
)
381381
struct.pack_into("! H", frame, 10, inet_cksum(frame[: self._hlen]))
382382

pytcp/protocols/tcp/fpa.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def __init__(
137137
self._hlen: int = TCP_HEADER_LEN + sum(len(_) for _ in self._options)
138138

139139
assert self._hlen % 4 == 0, (
140-
f"TCP header len {self._hlen} is not multiplcation of 4 bytes, "
140+
f"TCP header len {self._hlen} is not multiplication of 4 bytes, "
141141
f"check options... {self._options}"
142142
)
143143

@@ -419,7 +419,7 @@ class TcpOptTimestamp:
419419

420420
def __init__(self, tsval: int, tsecr: int) -> None:
421421
"""
422-
Optiona constructor.
422+
Optional constructor.
423423
"""
424424
assert 0 <= tsval <= 0xFFFFFFFF, f"{tsval=}"
425425
assert 0 <= tsecr <= 0xFFFFFFFF, f"{tsecr=}"

0 commit comments

Comments
 (0)