Fix GUI instance counts and launcher tmp paths

This commit is contained in:
every_holiday
2026-06-25 02:36:55 +09:00
parent 23d5fcfcda
commit 75f2d8b9c2
24 changed files with 2479 additions and 20 deletions

30
internal/app/ocr.go Normal file
View File

@@ -0,0 +1,30 @@
package app
import (
"fmt"
"log"
"os/exec"
)
func runPythonOcrFromScreen() error {
script := `
import sys
from pathlib import Path
root = Path(r"C:\Users\kenny\Documents\git\messpy\VRC\VRWT_Tool\VRC_OSC")
sys.path.insert(0, str(root / "src"))
from ocr.ocr_actions import runOcrFromScreen
runOcrFromScreen()
`
cmd := exec.Command("python", "-c", script)
cmd.Dir = `C:\Users\kenny\Documents\git\messpy\VRC\VRWT_Tool\VRC_OSC`
out, err := cmd.CombinedOutput()
if len(out) > 0 {
log.Printf("ocr output: %s", string(out))
SetOCRText(string(out))
SetTranslateText("翻訳: 未実装")
}
if err != nil {
return fmt.Errorf("ocr failed: %w", err)
}
return nil
}