python类doctest_block()的实例源码

transforms.py 文件源码 项目:chalktalk_docs 作者: loremIpsum1771 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def apply(self):
        # move doctest blocks out of blockquotes
        for node in self.document.traverse(nodes.block_quote):
            if all(isinstance(child, nodes.doctest_block) for child
                   in node.children):
                node.replace_self(node.children)
        # combine successive doctest blocks
        # for node in self.document.traverse(nodes.doctest_block):
        #    if node not in node.parent.children:
        #        continue
        #    parindex = node.parent.index(node)
        #    while len(node.parent) > parindex+1 and \
        #            isinstance(node.parent[parindex+1], nodes.doctest_block):
        #        node[0] = nodes.Text(node[0] + '\n\n' +
        #                             node.parent[parindex+1][0])
        #        del node.parent[parindex+1]
states.py 文件源码 项目:aws-cfn-plex 作者: lordmuffin 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def doctest(self, match, context, next_state):
        data = '\n'.join(self.state_machine.get_text_block())
        # TODO: prepend class value ['pycon'] (Python Console)
        # parse with `directives.body.CodeBlock` (returns literal-block
        # with class "code" and syntax highlight markup).
        self.parent += nodes.doctest_block(data, data)
        return [], next_state, []
states.py 文件源码 项目:AshsSDK 作者: thehappydinoa 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def doctest(self, match, context, next_state):
        data = '\n'.join(self.state_machine.get_text_block())
        # TODO: prepend class value ['pycon'] (Python Console)
        # parse with `directives.body.CodeBlock` (returns literal-block
        # with class "code" and syntax highlight markup).
        self.parent += nodes.doctest_block(data, data)
        return [], next_state, []
states.py 文件源码 项目:chalktalk_docs 作者: loremIpsum1771 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def doctest(self, match, context, next_state):
        data = '\n'.join(self.state_machine.get_text_block())
        self.parent += nodes.doctest_block(data, data)
        return [], next_state, []
states.py 文件源码 项目:blackmamba 作者: zrzka 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def doctest(self, match, context, next_state):
        data = '\n'.join(self.state_machine.get_text_block())
        # TODO: prepend class value ['pycon'] (Python Console)
        # parse with `directives.body.CodeBlock` (returns literal-block
        # with class "code" and syntax highlight markup).
        self.parent += nodes.doctest_block(data, data)
        return [], next_state, []
states.py 文件源码 项目:RST-vscode 作者: tht13 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def doctest(self, match, context, next_state):
        data = '\n'.join(self.state_machine.get_text_block())
        # TODO: prepend class value ['pycon'] (Python Console)
        # parse with `directives.body.CodeBlock` (returns literal-block
        # with class "code" and syntax highlight markup).
        self.parent += nodes.doctest_block(data, data)
        return [], next_state, []
states.py 文件源码 项目:tf_aws_ecs_instance_draining_on_scale_in 作者: terraform-community-modules 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def doctest(self, match, context, next_state):
        data = '\n'.join(self.state_machine.get_text_block())
        # TODO: prepend class value ['pycon'] (Python Console)
        # parse with `directives.body.CodeBlock` (returns literal-block
        # with class "code" and syntax highlight markup).
        self.parent += nodes.doctest_block(data, data)
        return [], next_state, []


问题


面经


文章

微信
公众号

扫码关注公众号