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

Method __init__

mobile_codex_control.py:949–970  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

947 REFRESH_MS = 15000
948
949 def __init__(self) -> None:
950 if tk is None:
951 raise RuntimeError("当前 Python 环境缺少 tkinter,无法显示桌面界面")
952
953 self.root = tk.Tk()
954 self.root.title(APP_TITLE)
955 self.root.geometry("1260x900")
956 self.root.minsize(1120, 800)
957 self.root.configure(bg="#eef3f8")
958
959 self.status_text = tk.StringVar(value="就绪")
960 self.last_refresh_text = tk.StringVar(value="尚未刷新")
961 self.local_url_text = tk.StringVar(value=f"本地面板:{LOCAL_PANEL_URL}")
962 self.remote_url_text = tk.StringVar(value="远程地址:未开启")
963 self.block_labels: list[dict[str, tk.Label]] = []
964 self.metric_widgets: dict[str, dict[str, Any]] = {}
965 self.pending_approval_items: list[dict[str, Any]] = []
966 self.selected_approval_token: str | None = None
967 self._busy = False
968
969 self._build_ui()
970 self.refresh_status()
971
972 def _build_ui(self) -> None:
973 container = tk.Frame(self.root, bg="#eef3f8")

Callers

nothing calls this directly

Calls 2

_build_uiMethod · 0.95
refresh_statusMethod · 0.95

Tested by

no test coverage detected