修复 v0.5 审查问题: platform 改名, 协议健壮性, CJK 匹配, VBS 引号, interception API

Browse Source
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
yws
2026-10-02 01:39:06 +00:00
co-authored by Claude Opus 5.5
parent 176570e7cd
commit 809a7fb017
12 changed files with 667 additions and 360 deletions
+20
View File
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
"""macOS 截图提供者:screencapture CLI (系统自带)。"""
import os
import subprocess
import tempfile
import time
class MacScreenshotProvider:
def grab(self):
path = os.path.join(tempfile.gettempdir(), 'lc_shot_%s.png' % time.strftime('%H%M%S'))
try:
subprocess.run(['screencapture', '-x', path], check=True, timeout=20)
if os.path.exists(path):
return {'ok': True, 'path': path}
except Exception as e:
return {'ok': False, 'error': 'screencapture fail: %s' % e}
return {'ok': False, 'error': 'no png produced'}