planning.py 文件源码

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

项目:PonyConf 作者: PonyConf 项目源码 文件源码
def render(self, output='html', **kwargs):
        if self.cache:
            cache_entry = 'ponyconf-%d' % adler32('|'.join(map(str, [self.site.domain, output, self.pending] + list(kwargs.values()))).encode('utf-8'))
            result = cache.get(cache_entry)
            if not result:
                result = getattr(self, '_as_%s' % output)(**kwargs)
                cache.set(cache_entry, result, 3 * 60 * 60) # 3H
            return result
        else:
            return getattr(self, '_as_%s' % output)(**kwargs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号