我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用pygments.__version__()。
def setup(app): # enable Pygments json lexer try: import pygments if pygments.__version__ >= '1.5': # use JSON lexer included in recent versions of Pygments from pygments.lexers import JsonLexer else: # use JSON lexer from pygments-json if installed from pygson.json_lexer import JSONLexer as JsonLexer except ImportError: pass # not fatal if we have old (or no) Pygments and no pygments-json else: app.add_lexer('json', JsonLexer()) return {"parallel_read_safe": True}
def setup(app): # enable Pygments json lexer try: import pygments if pygments.__version__ >= '1.5': # use JSON lexer included in recent versions of Pygments from pygments.lexers import JsonLexer else: # use JSON lexer from pygments-json if installed from pygson.json_lexer import JSONLexer as JsonLexer except ImportError: pass # not fatal if we have old (or no) Pygments and no pygments-json else: app.add_lexer('json', JsonLexer())
def print_debug_info(env): sys.stderr.writelines([ 'HTTPie %s\n' % httpie_version, 'HTTPie data: %s\n' % env.config.directory, 'Requests %s\n' % requests_version, 'Pygments %s\n' % pygments_version, 'Python %s %s\n' % (sys.version, sys.platform) ])
def print_debug_info(env): env.stderr.writelines([ 'HTTPie %s\n' % httpie_version, 'Requests %s\n' % requests_version, 'Pygments %s\n' % pygments_version, 'Python %s\n%s\n' % (sys.version, sys.executable), '%s %s' % (platform.system(), platform.release()), ]) env.stderr.write('\n\n') env.stderr.write(repr(env)) env.stderr.write('\n')