static.py 文件源码

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

项目:lifesoundtrack 作者: MTG 项目源码 文件源码
def handle_token(cls, parser, token):
        """
        Class method to parse prefix node and return a Node.
        """
        bits = token.split_contents()

        if len(bits) < 2:
            raise template.TemplateSyntaxError(
                "'%s' takes at least one argument (path to file)" % bits[0])

        path = parser.compile_filter(bits[1])

        if len(bits) >= 2 and bits[-2] == 'as':
            varname = bits[3]
        else:
            varname = None

        return cls(varname, path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号