jinja2ext.py 文件源码

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

项目:statik 作者: thanethomson 项目源码 文件源码
def parse(self, parser):
        lineno = next(parser.stream).lineno

        # get the context
        context = nodes.ContextReference()

        # get the arguments
        args = [context]
        try:
            while True:
                args.append(parser.parse_expression())
        except TemplateSyntaxError:
            pass  # no more arguments

        # get the tag_name for use in looking up callable
        self.active_tag = parser._tag_stack[-1]

        # create the node
        node = self.call_method('_invoke_tag', args=args, lineno=lineno)

        return nodes.Output(
            [node],
            lineno=lineno
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号