Skip to content

Commit d1dd6df

Browse files
committed
simpler RawData.hexdump
1 parent 98c525d commit d1dd6df

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/pms/core/reader.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from contextlib import contextmanager
1616
from csv import DictReader
1717
from pathlib import Path
18-
from textwrap import wrap
1918
from typing import Literal, NamedTuple, overload
2019

2120
from loguru import logger
@@ -46,9 +45,9 @@ class RawData(NamedTuple):
4645
def hex(self) -> str:
4746
return self.data.hex()
4847

49-
def hexdump(self, line: int | None = None) -> str:
50-
offset = time if line is None else line * len(self.data)
51-
hex = " ".join(wrap(self.data.hex(), 2)) # raw.hex(" ") in python3.8+
48+
def hexdump(self, line: int) -> str:
49+
offset = line * len(self.data)
50+
hex = self.data.hex(" ")
5251
dump = self.data.translate(HEXDUMP_TABLE).decode()
5352
return f"{offset:08x}: {hex} {dump}"
5453

0 commit comments

Comments
 (0)