__init__.py 文件源码

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

项目:iris 作者: linkedin 项目源码 文件源码
def on_get(self, req, resp, filename):
        suffix = os.path.splitext(req.path)[1]
        resp.content_type = mimes.get(suffix, 'application/octet-stream')

        filepath = os.path.join(ui_root, self.path, secure_filename(filename))
        try:
            resp.stream = open(filepath, 'rb')
            resp.stream_len = os.path.getsize(filepath)
        except IOError:
            raise HTTPNotFound()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号