MCPcopy Create free account
hub / github.com/StarsTom/mobileCodexHelper / task

Method task

mobile_codex_control.py:1322–1335  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1320 token = self.selected_approval_token
1321
1322 def task() -> str:
1323 current = next(
1324 (entry for entry in self.pending_approval_items if str(entry["request_token"]) == token),
1325 None,
1326 )
1327 if not current:
1328 raise RuntimeError("待审批设备已不存在,请先刷新。")
1329 if not resolve_device_request(token, approved):
1330 raise RuntimeError("审批未生效,请刷新后重试。")
1331
1332 status = collect_status()
1333 self.root.after(0, lambda: self.apply_status(status))
1334 device_name = current.get("display_name") or current.get("device_id") or "该设备"
1335 return f"已{action_text}设备:{device_name}"
1336
1337 self.run_background(f"正在{action_text}所选设备...", task)
1338

Callers

nothing calls this directly

Calls 3

apply_statusMethod · 0.95
resolve_device_requestFunction · 0.85
collect_statusFunction · 0.85

Tested by

no test coverage detected