mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-10 09:06:36 +00:00
Merge remote-tracking branch 'origin/claude/frame-timing-harness' into claude/scan-order-compensation
This commit is contained in:
@@ -77,8 +77,9 @@ def load_config() -> dict:
|
||||
config = ConfigManager().config
|
||||
if isinstance(config, dict) and config:
|
||||
return config
|
||||
except Exception:
|
||||
pass
|
||||
except Exception as exc: # noqa: BLE001 - any failure means use the plain read
|
||||
print(f"ConfigManager unavailable ({exc}); reading {CONFIG} directly",
|
||||
file=sys.stderr)
|
||||
# ConfigManager pulls in a lot; a plain read is enough to drive the panel
|
||||
# and keeps the benchmark usable on a half-installed machine.
|
||||
try:
|
||||
|
||||
@@ -145,7 +145,10 @@ STATS_FILENAME = "ledmatrix_frame_stats.json"
|
||||
|
||||
|
||||
def default_stats_path() -> str:
|
||||
base = "/dev/shm" if os.path.isdir("/dev/shm") else tempfile.gettempdir()
|
||||
# A fixed name in a shared directory is safe here: write() creates its
|
||||
# temp file with mkstemp and os.replace()s it over this path, which swaps
|
||||
# out whatever is there -- a planted symlink included -- without following it.
|
||||
base = "/dev/shm" if os.path.isdir("/dev/shm") else tempfile.gettempdir() # nosec B108
|
||||
return os.path.join(base, STATS_FILENAME)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user