control.py 文件源码

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

项目:cmt 作者: chadmv 项目源码 文件源码
def remove_selected(self):
        """Remove the curves selected in the curve list from the curve library."""
        items = self.control_list.selectedItems()
        if items:
            button = QtWidgets.QMessageBox.question(self, 'Remove Controls',
                                                'Are you sure you want to remove the selected controls?',
                                                QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
            if button == QtWidgets.QMessageBox.Yes:
                for item in items:
                    text = item.text()
                    control_file = os.path.join(CONTROLS_DIRECTORY, '{0}.json'.format(text))
                    os.remove(control_file)
                self.populate_controls()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号