magic_characterizer_mixin.py 文件源码

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

项目:loris-redux 作者: jpstroop 项目源码 文件源码
def _get_and_cache(file_path, supported_formats):
        mime_type = from_file(file_path, mime=True)
        try:
            fmt = supported_formats[mime_type]
            MagicCharacterizerMixin._cache[file_path] = fmt
            return fmt
        except KeyError:
            message = '{0} characterized as {1} format, which is not supported'
            message = message.format(file_path, mime_type)
            raise UnsupportedFormat(message, http_status_code=500)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号