widgets.py 文件源码

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

项目:BigBrotherBot-For-UrT43 作者: ptitbigorneau 项目源码 文件源码
def make_new_process(self, path):
        """
        Create a new B3 process using the provided configuration file path.
        NOTE: this actually handle also the repainting of the main table but
        since it's not a toolbar button handler it has been implemented here instead.
        :param path: the configuration file path
        """
        if path:

            try:
                abspath = b3.getAbsolutePath(path)
                config = MainConfig(load_config(abspath))
            except ConfigFileNotValid:
                msgbox = QMessageBox()
                msgbox.setIcon(QMessageBox.Critical)
                msgbox.setWindowTitle('WARNING')
                msgbox.setText('You selected an invalid configuration file')
                msgbox.setStandardButtons(QMessageBox.Ok)
                msgbox.exec_()
            else:
                analysis = config.analyze()
                if analysis:
                    msgbox = QMessageBox()
                    msgbox.setIcon(QMessageBox.Critical)
                    msgbox.setWindowTitle('ERROR')
                    msgbox.setText('One or more problems have been detected in your configuration file')
                    msgbox.setDetailedText('\n'.join(analysis))
                    msgbox.setStandardButtons(QMessageBox.Ok)
                    msgbox.exec_()
                else:
                    if not B3.exists(config.fileName):
                        process = B3(config=config)
                        process.insert()
                        main_table = self.centralWidget().main_table
                        main_table.repaint()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号