From 9ff3ef4521725bd0f3e2d6f11711f52d5b6e2e28 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Tue, 28 Jul 2026 05:02:15 +0200 Subject: [PATCH] working enum --- src/pwp.py | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/pwp.py b/src/pwp.py index eb5f4da..3305468 100644 --- a/src/pwp.py +++ b/src/pwp.py @@ -2,10 +2,11 @@ import struct import typing from typing import get_type_hints, get_origin, get_args - class PWPError(Exception): pass +class uint8: + pass def encode_value(value, typ) -> bytes: origin = get_origin(typ) @@ -61,7 +62,9 @@ def encode_value(value, typ) -> bytes: if typ is bool: return b"\x01" if value else b"\x00" - # nested PWP class + if typ is uint8: + return struct.pack("