launch_gui.py 文件源码

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

项目:spyking-circus 作者: spyking-circus 项目源码 文件源码
def run(self):
        if self.ui.cb_batch.isChecked():
            self.last_log_file = None
        else:
            if self.params is None:
                self.create_params_file(self.params)
                return
            elif not os.path.exists(self.params):
                self.create_params_file(self.params)
                return

        if self.ui.tabWidget.currentIndex() == 0:
            args = self.command_line_args()
        elif self.ui.tabWidget.currentIndex() == 2:
            args = self.gui_command_line_args()

        self.update_result_tab()

        # # Start process
        self.ui.edit_stdout.clear()
        format = self.ui.edit_stdout.currentCharFormat()
        format.setFontWeight(QFont.Normal)
        format.setForeground(Qt.blue)
        self.ui.edit_stdout.setCurrentCharFormat(format)
        time_str = datetime.datetime.now().ctime()
        start_msg = '''\
                       Starting spyking circus at {time_str}.

                       Command line call:
                       {call}
                    '''.format(time_str=time_str, call=' '.join(args))
        self.ui.edit_stdout.appendPlainText(textwrap.dedent(start_msg))
        format.setForeground(Qt.black)
        self.ui.edit_stdout.setCurrentCharFormat(format)
        self.ui.edit_stdout.appendPlainText('\n')

        self.process = QProcess(self)
        self.process.readyReadStandardOutput.connect(self.append_output)
        self.process.readyReadStandardError.connect(self.append_error)
        self.process.started.connect(self.process_started)
        self.process.finished.connect(self.process_finished)
        self.process.error.connect(self.process_errored)
        self._interrupted = False
        self.process.start(args[0], args[1:])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号