This website requires JavaScript.
0
Issues
Pull Requests
Milestones
Explore
0
Create…
New Repository
New Migration
New Organization
public
Signed in as
public
Profile
Starred
Subscriptions
Settings
Help
Sign Out
yws
/
lc-mcp
Watch
1
Star
0
Fork
0
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
lc-mcp
/
lc_mcp
/
or
Cancel
Edit File
Preview
Preview Changes
Spaces
Tabs
2
4
8
Wrap
No wrap
# -*- coding: utf-8 -*- """测试用引擎: 屏幕内容由测试脚本预设, 记录所有输入动作。""" from .engine import Engine class FakeEngine(Engine): def __init__(self, frames=None, images=None): # frames: 每次 ocr() 依次返回的 items 列表; 用完后停在最后一帧 self.frames = list(frames or [[]]) self.images = dict(images or {}) # name -> (x, y) self.actions = [] self.shots = 0 def screenshot(self): self.shots += 1 return {'path': 'fake/shot_%d.png' % self.shots, 'w': 1920, 'h': 1080} def ocr(self): shot = self.screenshot() items = self.frames.pop(0) if len(self.frames) > 1 else self.frames[0] return shot, [dict(it, score=it.get('score', 0.99)) for it in items] def find_image(self, name, threshold=0.8, model='normal'): return self.images.get(name) def list_images(self, prefix=''): return sorted(n for n in self.images if n.startswith(prefix)) def click(self, x, y, times=1): self.actions.append(('click', int(x), int(y), int(times))) def keypress(self, key): self.actions.append(('key', key)) def drag(self, from_x, from_y, to_x, to_y, duration=1.0): self.actions.append(('drag', from_x, from_y, to_x, to_y, duration)) def type_text(self, text): self.actions.append(('type', text))
Commit Changes
Add a Signed-off-by trailer by the committer at the end of the commit log message.
Commit directly to the
fix/team-scroll-patch
branch.
Create a
new branch
for this commit and start a pull request.
Commit Changes
Cancel