gui.py 文件源码

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

项目:pbtk 作者: marin-m 项目源码 文件源码
def delete_endpoint(self):
        if QMessageBox.question(self.view, ' ', 'Delete this endpoint?') == QMessageBox.Yes:
            path = str(BASE_PATH / 'endpoints' / (urlparse(self.base_url).netloc + '.json'))

            with open(path) as fd:
                json = load(fd, object_pairs_hook=OrderedDict)
            json.remove(self.endpoint)

            with open(path, 'w') as fd:
                dump(json, fd, ensure_ascii=False, indent=4)
            if not json:
                remove(path)

            self.load_endpoints()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号