Skip to content
Prev Previous commit
Next Next commit
refactor: update exit calls to use meshtastic.util.our_exit for consi…
…stency
  • Loading branch information
benallfree committed Apr 13, 2026
commit 517bcb6e6cd5e6a358c461842484194589704864
6 changes: 3 additions & 3 deletions meshtastic/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def onConnected(interface):
node = interface.localNode
rows = node.listDir(remote_dir, depth=depth)
if rows is None:
our_exit("listDir failed", 1)
meshtastic.util.our_exit("listDir failed", 1)
for path, sz in rows:
print(f"{sz}\t{path}")

Expand All @@ -469,15 +469,15 @@ def _upload_progress(sent, total):
ok = node.uploadFile(src, dst, on_progress=_upload_progress)
print(f"\r {'OK' if ok else 'FAILED'}: {src} → {dst} ")
if not ok:
our_exit("Upload failed", 1)
meshtastic.util.our_exit("Upload failed", 1)
else:
print(f"Downloading {src} → {dst}")
def _download_progress(received, _total):
print(f"\r {received} bytes received...", end="", flush=True)
ok = node.downloadFile(src, dst, on_progress=_download_progress)
print(f"\r {'OK' if ok else 'FAILED'}: {src} → {dst} ")
if not ok:
our_exit("Download failed", 1)
meshtastic.util.our_exit("Download failed", 1)

if args.reboot:
closeNow = True
Expand Down