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
评论列表
文章目录