rest_parameters.py 文件源码

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

项目:Trusted-Platform-Module-nova 作者: BU-NU-CLOUD-SP16 项目源码 文件源码
def run(self):
        lineno = self.state_machine.abs_line_number()
        target = nodes.target()
        section = nodes.section(classes=["detail-control"])
        # env = self.state.document.settings.env
        # env.app.info("Parent %s" % self.state.parent.attributes)

        node = rest_method()

        # TODO(sdague): this is a super simplistic parser, should be
        # more robust.
        method, sep, url = self.content[0].partition(' ')

        node['method'] = method
        node['url'] = url
        node['target'] = self.state.parent.attributes['ids'][0]

        # We need to build a temporary target that we can replace
        # later in the processing to get the TOC to resolve correctly.
        temp_target = "%s-selector" % node['target']
        target = nodes.target(ids=[temp_target])
        self.state.add_target(temp_target, '', target, lineno)
        section += node

        return [target, section]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号