widgets.py 文件源码

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

项目:BigBrotherBot-For-UrT43 作者: ptitbigorneau 项目源码 文件源码
def process_start(self, row, process, warn=True):
        """
        Handle the startup of a B3 process.
        :param row: the number of the row displaying the process state
        :param process: the QProcess instance to start
        :param warn: whether to warn the user of a startup failure or not
        """
        if process.state() != QProcess.Running:
            # refresh the config before running
            process.config = process.config_path
            self.paint_row(row)
            if process.isFlag(CONFIG_READY):
                process.stateChanged.connect(partial(self.paint_row, row=row))
                process.start()
            else:
                if warn:
                    suffix = 'not found' if process.isFlag(CONFIG_FOUND) else 'not valid'
                    reason = 'configuration file %s: %s' % (suffix, process.config_path)
                    msgbox = QMessageBox()
                    msgbox.setIcon(QMessageBox.Warning)
                    msgbox.setWindowTitle('WARNING')
                    msgbox.setText('%s startup failure: %s' % (process.name, reason))
                    msgbox.setStandardButtons(QMessageBox.Ok)
                    msgbox.exec_()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号