__init__.py 文件源码

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

项目:rscfl 作者: lc525 项目源码 文件源码
def handle_signature(self, sig, signode):
        print("looking for: " + sig)
        cache = _APP_CACHES.get(self.env.app, {})
        key = CursorKind.FUNCTION_DECL, (sig, )
        if key in cache:
            print("KEY FOunD!")
            node, comment, start, end, _ = cache[key]

            result_type = node.type.get_result()
            signode += addnodes.desc_type(result_type.spelling, result_type.spelling + ' ')
            signode += addnodes.desc_name(node.spelling, node.spelling)
            paramlist = addnodes.desc_parameterlist()
            for argument in node.get_arguments():
                parameter = addnodes.desc_parameter()
                parameter += addnodes.desc_type(argument.type.spelling, argument.type.spelling + ' ')
                parameter += nodes.Text(argument.spelling, argument.spelling)
                paramlist += parameter
            signode += paramlist

            self.content = ViewList()
            comment = ''.join(comment)
            for lineno, line in enumerate(comment.splitlines(), start[0]):
                self.content.append(line, '<unknown>', lineno)
        return sig
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号