本文整理汇总了Python中pygments.lexers._mapping.LEXERS.keys方法的典型用法代码示例。如果您正苦于以下问题:Python LEXERS.keys方法的具体用法?Python LEXERS.keys怎么用?Python LEXERS.keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pygments.lexers._mapping.LEXERS
的用法示例。
在下文中一共展示了LEXERS.keys方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: lexers
# 需要导入模块: from pygments.lexers._mapping import LEXERS [as 别名]
# 或者: from pygments.lexers._mapping.LEXERS import keys [as 别名]
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
示例2: _load_lexers
# 需要导入模块: from pygments.lexers._mapping import LEXERS [as 别名]
# 或者: from pygments.lexers._mapping.LEXERS import keys [as 别名]
: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():
示例3: list
# 需要导入模块: from pygments.lexers._mapping import LEXERS [as 别名]
# 或者: from pygments.lexers._mapping.LEXERS import keys [as 别名]
: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():
示例4: _load_lexers
# 需要导入模块: from pygments.lexers._mapping import LEXERS [as 别名]
# 或者: from pygments.lexers._mapping.LEXERS import keys [as 别名]
: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():