Coverage for src/ramses_cli/debug.py: 42%
12 statements
« prev ^ index » next coverage.py v7.11.3, created at 2026-01-05 21:44 +0100
« prev ^ index » next coverage.py v7.11.3, created at 2026-01-05 21:44 +0100
1#!/usr/bin/env python3
2"""A CLI for the ramses_rf library."""
4from __future__ import annotations
6SZ_DBG_MODE = "debug_mode"
7DEBUG_ADDR = "0.0.0.0"
8DEBUG_PORT = 5678
11def start_debugging(wait_for_client: bool) -> None:
12 import debugpy
14 debugpy.listen(address=(DEBUG_ADDR, DEBUG_PORT))
15 print(f" - Debugging is enabled, listening on: {DEBUG_ADDR}:{DEBUG_PORT}")
17 if wait_for_client:
18 print(" - execution paused, waiting for debugger to attach...")
19 debugpy.wait_for_client()
20 print(" - debugger is now attached, continuing execution.")