run.py 文件源码

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

项目:cavalcade 作者: worron 项目源码 文件源码
def import_optional():
    """Safe module import"""
    success = AttributeDict()
    try:
        gi.require_version('Gst', '1.0')
        from gi.repository import Gst  # noqa: F401
        success.gstreamer = True
    except Exception:
        success.gstreamer = False
        logger.warning("Fail to import Gstreamer module")

    try:
        from PIL import Image  # noqa: F401
        success.pillow = True
    except Exception:
        success.pillow = False
        logger.warning("Fail to import Pillow module")

    return success
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号