update pygments to support python3

This commit is contained in:
everyx
2014-05-06 01:25:08 +08:00
parent ecc0c66006
commit 70305b971a
164 changed files with 24351 additions and 1445 deletions

View File

@@ -7,7 +7,7 @@
Make sure each Python file has a correct file header
including copyright and license information.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -30,7 +30,7 @@ def checker(*suffixes, **kwds):
name_mail_re = r'[\w ]+(<.*?>)?'
copyright_re = re.compile(r'^ :copyright: Copyright 2006-2012 by '
copyright_re = re.compile(r'^ :copyright: Copyright 2006-2013 by '
r'the Pygments team, see AUTHORS\.$', re.UNICODE)
copyright_2_re = re.compile(r'^ %s(, %s)*[,.]$' %
(name_mail_re, name_mail_re), re.UNICODE)

View File

@@ -8,6 +8,8 @@ def main():
for name, aliases, filenames, mimetypes in get_all_lexers():
cls = find_lexer_class(name)
if not cls.aliases:
print cls, "has no aliases"
for f in filenames:
if f not in uses:
uses[f] = []

View File

@@ -7,7 +7,7 @@
Find code tags in specified files and/or directories
and create a report in HTML format.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

View File

@@ -8,17 +8,16 @@
the text where Error tokens are being generated, along
with some context.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys, os
try:
import pygments
except ImportError:
# try parent path
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
# always prefer Pygments from source if exists
srcpath = os.path.join(os.path.dirname(__file__), '..')
if os.path.isdir(os.path.join(srcpath, 'pygments')):
sys.path.insert(0, srcpath)
from pygments.lexer import RegexLexer