workerManager.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:pyree-old 作者: DrLuke 项目源码 文件源码
def replyMonitors(self, msg):
        """Handle reply to monitors request"""
        self.monitors = msg["replydata"]

        for monitor in self.monitors:
            if monitor not in self.monitorState:    # Monitor is newly available
                self.monitorState[monitor] = {}
                self.monitorState[monitor]["treeItem"] = QTreeWidgetItem(1002)  # Type 1002 for monitor item
                self.monitorState[monitor]["treeItem"].setText(0, monitor)
                self.monitorState[monitor]["treeItem"].setIcon(0, self.monitorOkIcon)
                self.treeItem.addChild(self.monitorState[monitor]["treeItem"])
                self.treeItem.setExpanded(True)
                self.monitorState[monitor]["state"] = "stop"
                self.monitorState[monitor]["sheet"] = None
        for monitor in self.monitorState:
            if monitor not in self.monitors:    # Monitor exists in state, but is not available anymore
                self.monitorState[monitor]["state"] = "gone"
                self.monitorState[monitor]["treeItem"].setIcon(0, self.monitorGoneIcon)

        # TODO: Set sheet item state here (blue for active, but no sheet, red for gone, black for all good)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号