"""Фрейм для обновления статистики бота""" from typing import Dict, Any from tkinter import LabelFrame,Frame, Label, Button from pakApp.pakGui.pakWinState.modWinState import WinState class FrmBot(Frame): def __init__(self, app:Any, frmListBot:LabelFrame, name:str)->None: Frame.__init__(self, frmListBot, border=3,relief="sunken") self.pack(fill="x", side="top") self.app=app self.lblState=Label(self) self.lblState.pack(side="left") self.name=name self.btnStat=Button(self, text="Статистика",command=self.show_stat) self.btnStat.pack(side="right") def show_stat(self): print(f"FrmBot.show_Stat: name={self.name}") WinState(self.app.gui.winMain, self.name) def update_state(self, dictBot:Dict[str,str])->None: strAuto:str=dictBot["isAuto"] strIsWork:str=dictBot["isWork"] gold:str=dictBot["gold"] fuel:str=dictBot["fuel"] self.lblState["text"]="["+self.name+"] "+\ "[АвтоИгра="+strAuto+"] "+\ "[Работа="+strIsWork+"] "+\ "[Золото="+gold+"] "+\ "[Топливо="+fuel+"] "