__init__.py 文件源码

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

项目:macos-st-packages 作者: zce 项目源码 文件源码
def get_lexer_for_mimetype(_mime, **options):
    """Get a lexer for a mimetype.

    Raises ClassNotFound if not found.
    """
    for modname, name, _, _, mimetypes in itervalues(LEXERS):
        if _mime in mimetypes:
            if name not in _lexer_cache:
                _load_lexers(modname)
            return _lexer_cache[name](**options)
    for cls in find_plugin_lexers():
        if _mime in cls.mimetypes:
            return cls(**options)
    raise ClassNotFound('no lexer for mimetype %r found' % _mime)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号