mpsys/cree-led-pcb

This circuit diagram depicts a compact LED driver module featuring a TPS923655DMTR LED driver IC, input filtering and storage components (capacitors, inductor, diode), sensing and control resistors, output filtering capacitors, and various support passive components arranged on a 2-layer PCB with mounting holes.

Version
1.0.2
License
unset
Stars
0

watch-edits.py

#!/usr/bin/env python3
"""Watch manual-edits.json for changes and touch driver-board.circuit.tsx to trigger rebuild."""
import os, time, sys

json_path = os.path.expanduser("~/Projects/cree-led-pcb/manual-edits.json")
tsx_path = os.path.expanduser("~/Projects/cree-led-pcb/driver-board.circuit.tsx")

if not os.path.exists(json_path):
    print(f"ERROR: {json_path} not found")
    sys.exit(1)

last_mtime = os.path.getmtime(json_path)
print(f"Watching {json_path} for changes...")
print(f"Initial mtime: {last_mtime}")

while True:
    time.sleep(1)
    try:
        current_mtime = os.path.getmtime(json_path)
        if current_mtime != last_mtime:
            print(f"manual-edits.json changed! Touching {tsx_path} to trigger rebuild...")
            os.utime(tsx_path, None)
            last_mtime = current_mtime
    except FileNotFoundError:
        print("manual-edits.json disappeared, waiting...")
    except Exception as e:
        print(f"Error: {e}")