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

Method _resolve_selected_request

mobile_codex_control.py:1314–1337  ·  view source on GitHub ↗
(self, approved: bool)

Source from the content-addressed store, hash-verified

1312 self._render_text(self.approval_detail_text, content)
1313
1314 def _resolve_selected_request(self, approved: bool) -> None:
1315 if not self.selected_approval_token:
1316 self.status_text.set("请先选择一条待审批设备。")
1317 return
1318
1319 action_text = "批准" if approved else "拒绝"
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
1339 @staticmethod
1340 def _level_theme(level: str) -> tuple[str, str, str]:

Callers 1

_build_uiMethod · 0.95

Calls 1

run_backgroundMethod · 0.95

Tested by

no test coverage detected