def lexers(): lexers = [] for key in LEXERS.keys(): lexer = LEXERS[key] lexers.append( (lexer[1], key) ) lexers.sort(lambda a, b: cmp(a[1], b[1])) return lexers
:license: BSD, see LICENSE for details. """ import sys import types import fnmatch from os.path import basename from pygments.lexers._mapping import LEXERS from pygments.modeline import get_filetype_from_buffer from pygments.plugin import find_plugin_lexers from pygments.util import ClassNotFound, bytes __all__ = ['get_lexer_by_name', 'get_lexer_for_filename', 'find_lexer_class', 'guess_lexer'] + LEXERS.keys() _lexer_cache = {} def _load_lexers(module_name): """ Load a lexer (and all others in the module too). """ mod = __import__(module_name, None, None, ['__all__']) for lexer_name in mod.__all__: cls = getattr(mod, lexer_name) _lexer_cache[cls.name] = cls def get_all_lexers():
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys import types import fnmatch from os.path import basename from pygments.lexers._mapping import LEXERS from pygments.plugin import find_plugin_lexers from pygments.util import ClassNotFound, bytes __all__ = ['get_lexer_by_name', 'get_lexer_for_filename', 'find_lexer_class', 'guess_lexer'] + list(LEXERS.keys()) _lexer_cache = {} def _load_lexers(module_name): """ Load a lexer (and all others in the module too). """ mod = __import__(module_name, None, None, ['__all__']) for lexer_name in mod.__all__: cls = getattr(mod, lexer_name) _lexer_cache[cls.name] = cls def get_all_lexers():
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys import types import fnmatch from os.path import basename from pygments.lexers._mapping import LEXERS from pygments.plugin import find_plugin_lexers from pygments.util import ClassNotFound, bytes __all__ = ["get_lexer_by_name", "get_lexer_for_filename", "find_lexer_class", "guess_lexer"] + LEXERS.keys() _lexer_cache = {} def _load_lexers(module_name): """ Load a lexer (and all others in the module too). """ mod = __import__(module_name, None, None, ["__all__"]) for lexer_name in mod.__all__: cls = getattr(mod, lexer_name) _lexer_cache[cls.name] = cls def get_all_lexers():
:license: BSD, see LICENSE for details. """ import sys import types import fnmatch from os.path import basename from pygments.lexers._mapping import LEXERS from pygments.plugin import find_plugin_lexers from pygments.util import ClassNotFound, bytes __all__ = [ 'get_lexer_by_name', 'get_lexer_for_filename', 'find_lexer_class', 'guess_lexer' ] + list(LEXERS.keys()) _lexer_cache = {} def _load_lexers(module_name): """ Load a lexer (and all others in the module too). """ mod = __import__(module_name, None, None, ['__all__']) for lexer_name in mod.__all__: cls = getattr(mod, lexer_name) _lexer_cache[cls.name] = cls def get_all_lexers():
:license: BSD, see LICENSE for details. """ import sys import types import fnmatch from os.path import basename from pygments.lexers._mapping import LEXERS from pygments.modeline import get_filetype_from_buffer from pygments.plugin import find_plugin_lexers from pygments.util import ClassNotFound, bytes __all__ = ['get_lexer_by_name', 'get_lexer_for_filename', 'find_lexer_class', 'guess_lexer'] + list(LEXERS.keys()) _lexer_cache = {} def _load_lexers(module_name): """ Load a lexer (and all others in the module too). """ mod = __import__(module_name, None, None, ['__all__']) for lexer_name in mod.__all__: cls = getattr(mod, lexer_name) _lexer_cache[cls.name] = cls def get_all_lexers():
:license: BSD, see LICENSE for details. """ import sys import types import fnmatch from os.path import basename from pygments.lexers._mapping import LEXERS from pygments.plugin import find_plugin_lexers from pygments.util import ClassNotFound, bytes __all__ = [ 'get_lexer_by_name', 'get_lexer_for_filename', 'find_lexer_class', 'guess_lexer' ] + LEXERS.keys() _lexer_cache = {} def _load_lexers(module_name): """ Load a lexer (and all others in the module too). """ mod = __import__(module_name, None, None, ['__all__']) for lexer_name in mod.__all__: cls = getattr(mod, lexer_name) _lexer_cache[cls.name] = cls def get_all_lexers():
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys import types import fnmatch from os.path import basename from pygments.lexers._mapping import LEXERS from pygments.plugin import find_plugin_lexers from pygments.util import ClassNotFound, bytes __all__ = ['get_lexer_by_name', 'get_lexer_for_filename', 'find_lexer_class', 'guess_lexer'] + LEXERS.keys() _lexer_cache = {} def _load_lexers(module_name): """ Load a lexer (and all others in the module too). """ mod = __import__(module_name, None, None, ['__all__']) for lexer_name in mod.__all__: cls = getattr(mod, lexer_name) _lexer_cache[cls.name] = cls def get_all_lexers():