Remove hexdump package (#33155)

* remove hexdump

* uv lock

* cleanup
old-commit-hash: 1dd8bdc791
This commit is contained in:
Maxime Desroches 2024-07-31 13:34:14 -07:00 committed by GitHub
parent 3e12f385d5
commit 80e23d1593
3 changed files with 652 additions and 637 deletions

View File

@ -111,7 +111,6 @@ dev = [
"tabulate", "tabulate",
"types-requests", "types-requests",
"types-tabulate", "types-tabulate",
"hexdump",
# this is only pinned since 5.15.11 is broken # this is only pinned since 5.15.11 is broken
"pyqt5 ==5.15.2; platform_machine == 'x86_64'", # no aarch64 wheels for macOS/linux "pyqt5 ==5.15.2; platform_machine == 'x86_64'", # no aarch64 wheels for macOS/linux

View File

@ -4,7 +4,6 @@ import argparse
import json import json
import codecs import codecs
from hexdump import hexdump
from cereal import log from cereal import log
from cereal.services import SERVICE_LIST from cereal.services import SERVICE_LIST
from openpilot.tools.lib.live_logreader import raw_live_logreader from openpilot.tools.lib.live_logreader import raw_live_logreader
@ -12,6 +11,18 @@ from openpilot.tools.lib.live_logreader import raw_live_logreader
codecs.register_error("strict", codecs.backslashreplace_errors) codecs.register_error("strict", codecs.backslashreplace_errors)
def hexdump(msg):
m = str.upper(msg.hex())
m = [m[i:i+2] for i in range(0,len(m),2)]
m = [m[i:i+16] for i in range(0,len(m),16)]
for row,dump in enumerate(m):
addr = '%08X:' % (row*16)
raw = ' '.join(dump[:8]) + ' ' + ' '.join(dump[8:])
space = ' ' * (48 - len(raw))
asci = ''.join(chr(int(x,16)) if 0x20 <= int(x,16) <= 0x7E else '.' for x in dump)
print(f'{addr} {raw} {space} {asci}')
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Dump communication sockets. See cereal/services.py for a complete list of available sockets.') parser = argparse.ArgumentParser(description='Dump communication sockets. See cereal/services.py for a complete list of available sockets.')

1275
uv.lock

File diff suppressed because it is too large Load Diff