osfexplorer.py 文件源码

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

项目:QOpenScienceFramework 作者: dschreij 项目源码 文件源码
def __upload_refresh_item(self, reply, parent_item, *args, **kwargs):
        """ Called by __upload_finished, if it is possible to add the new item
        at the correct position in the tree, without refreshing the whole tree.
        """
        item = json.loads(safe_decode(reply.readAll().data()))
        # Remove old item first, before adding new one
        updateIndex = kwargs.get('updateIndex')
        if not updateIndex is None:
            parent_item.takeChild(updateIndex)
        # Add the item as a new item to the tree
        new_item, kind = self.tree.add_item(parent_item, item['data'])
        # Set new item as currently selected item
        self.tree.setCurrentItem(new_item)
        # Store item in kwargs so callback functions can use it
        kwargs['new_item'] = new_item
        # Perform the afterUploadCallback if it has been specified
        after_upload_cb = kwargs.pop('afterUploadCallback', None)
        if callable(after_upload_cb):
            after_upload_cb(*args, **kwargs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号