scitools_client.py 文件源码

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

项目:saapy 作者: ashapochka 项目源码 文件源码
def get_node_id(self, ent=None, ent_attrs: dict=None):
        if ent and ent.kindname() == 'file':
            node_id = str(Path(ent.longname()).relative_to(
                self.root_path))
        elif ent:
            node_id = ent.uniquename()
        elif ent_attrs and ent_attrs['kindname'] == 'file':
            try:
                node_id = str(Path(ent_attrs['longname']).relative_to(
                    self.root_path))
            except ValueError:
                node_id = ent_attrs['longname']
        elif ent_attrs:
            node_id = ent_attrs['uniquename']
        else:
            node_id = None
        return node_id
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号