template.py 文件源码

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

项目:Anubis 作者: KawashiroNitori 项目源码 文件源码
def __init__(self):
        super(Environment, self).__init__(
            loader=jinja2.FileSystemLoader(path.join(path.dirname(__file__), 'ui/templates')),
            extensions=[jinja2.ext.with_],
            auto_reload=options.options.debug,
            autoescape=True,
            trim_blocks=True,
            undefined=Undefined
        )
        globals()[self.__class__.__name__] = lambda: self

        self.globals['anubis'] = anubis
        self.globals['static_url'] = lambda s: options.options.cdn_prefix + s
        self.globals['paginate'] = paginate

        self.filters['markdown'] = markdown
        self.filters['json'] = json.encode
        self.filters['gravatar_url'] = gravatar_url
        self.filters['to_size'] = to_size
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号