aboutsummaryrefslogtreecommitdiff
path: root/codegen/lib
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-25 00:30:47 -0500
committermat <github@matdoes.dev>2022-05-25 00:30:47 -0500
commitdc5a9149a588f727f14f7d6d89908ba8fe87b642 (patch)
treec54d6c9e735c4d24631ad9c11141158680957ccc /codegen/lib
parent479c05474704a5a2f68b79468d2cde05c0ceec62 (diff)
downloadazalea-drasl-dc5a9149a588f727f14f7d6d89908ba8fe87b642.tar.xz
Fix migrate
Diffstat (limited to 'codegen/lib')
-rw-r--r--codegen/lib/utils.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/codegen/lib/utils.py b/codegen/lib/utils.py
index ff1a5d36..c185c0e5 100644
--- a/codegen/lib/utils.py
+++ b/codegen/lib/utils.py
@@ -18,7 +18,7 @@ def padded_hex(n: int):
class PacketIdentifier:
- def __init__(self, packet_id, direction, state):
+ def __init__(self, packet_id: int, direction: str, state: str):
self.packet_id = packet_id
self.direction = direction
self.state = state
@@ -29,6 +29,12 @@ class PacketIdentifier:
def __hash__(self):
return hash((self.packet_id, self.direction, self.state))
+ def __str__(self):
+ return f'{self.packet_id} {self.direction} {self.state}'
+
+ def __repr__(self):
+ return f'PacketIdentifier({self.packet_id}, {self.direction}, {self.state})'
+
def group_packets(packets: list[PacketIdentifier]):
packet_groups: dict[tuple[str, str], list[int]] = {}