(_mime, **options)
Get a lexer for a mimetype.
Get a lexer for a mimetype.
Get a lexer for a mimetype .
def get_lexer_for_mimetype(_mime, **options):
    """
    Get a lexer for a mimetype.
    """
    for modname, name, _, _, mimetypes in LEXERS.itervalues():
        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)
def get_lexer_for_mimetype ( _mime , * * options ) : for modname , name , _ , _ , mimetypes in LEXERS . itervalues ( ) : 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 )