当前位置: 首页>>代码示例>>Python>>正文


Python LEXERS.keys方法代码示例

本文整理汇总了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
开发者ID:markchadwick,项目名称:syntaxing,代码行数:11,代码来源:__init__.py

示例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():
开发者ID:CindyLulu,项目名称:SublimeHighlight,代码行数:33,代码来源:__init__.py

示例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():
开发者ID:Darriall,项目名称:eric,代码行数:33,代码来源:__init__.py

示例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():
开发者ID:mmagnus,项目名称:SyntaxHighlight,代码行数:32,代码来源:__init__.py


注:本文中的pygments.lexers._mapping.LEXERS.keys方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。