From db7f9b03850265ebc99efe4aa4f2db47a579d8c8 Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 17 Apr 2025 14:30:40 +0200 Subject: [PATCH] would not work on python 3.11 ... --- src/meshcore_cli/meshcore_cli.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/meshcore_cli/meshcore_cli.py b/src/meshcore_cli/meshcore_cli.py index 0572a90..b9f48fa 100644 --- a/src/meshcore_cli/meshcore_cli.py +++ b/src/meshcore_cli/meshcore_cli.py @@ -155,9 +155,17 @@ async def process_event_message(mc, ev, json_output, end="\n"): name = data["pubkey_prefix"] else: name = ct["adv_name"] - print(f"{name}({"D" if data['path_len'] == 255 else str(data['path_len'])}): {data['text']}") + if data['path_len'] == 255 : + path_str = "D" + else : + path_str = str(data['path_len']) + print(f"{name}({path_str}): {data['text']}") elif (data['type'] == "CHAN") : - print(f"ch{data['channel_idx']}({"D" if data['path_len'] == 255 else data['path_len']}): {data['text']}") + if data['path_len'] == 255 : + path_str = "D" + else : + path_str = str(data['path_len']) + print(f"ch{data['channel_idx']}({path_str}): {data['text']}") else: print(json.dumps(ev.payload)) return True