Updated vendored modules

This commit is contained in:
morpheus65535 2025-01-18 10:02:09 -05:00 committed by GitHub
parent 6fc6ca5ec2
commit 2fc8f10a94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2037 changed files with 61083 additions and 68809 deletions

View file

@ -4,7 +4,7 @@
Command line interface.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@ -68,19 +68,19 @@ def _print_help(what, name):
try:
if what == 'lexer':
cls = get_lexer_by_name(name)
print("Help on the %s lexer:" % cls.name)
print(f"Help on the {cls.name} lexer:")
print(dedent(cls.__doc__))
elif what == 'formatter':
cls = find_formatter_class(name)
print("Help on the %s formatter:" % cls.name)
print(f"Help on the {cls.name} formatter:")
print(dedent(cls.__doc__))
elif what == 'filter':
cls = find_filter_class(name)
print("Help on the %s filter:" % name)
print(f"Help on the {name} filter:")
print(dedent(cls.__doc__))
return 0
except (AttributeError, ValueError):
print("%s not found!" % what, file=sys.stderr)
print(f"{what} not found!", file=sys.stderr)
return 1
@ -97,7 +97,7 @@ def _print_list(what):
info.append(tup)
info.sort()
for i in info:
print(('* %s\n %s %s') % i)
print(('* {}\n {} {}').format(*i))
elif what == 'formatter':
print()
@ -112,7 +112,7 @@ def _print_list(what):
info.append(tup)
info.sort()
for i in info:
print(('* %s\n %s %s') % i)
print(('* {}\n {} {}').format(*i))
elif what == 'filter':
print()
@ -122,7 +122,7 @@ def _print_list(what):
for name in get_all_filters():
cls = find_filter_class(name)
print("* " + name + ':')
print(" %s" % docstring_headline(cls))
print(f" {docstring_headline(cls)}")
elif what == 'style':
print()
@ -132,7 +132,7 @@ def _print_list(what):
for name in get_all_styles():
cls = get_style_by_name(name)
print("* " + name + ':')
print(" %s" % docstring_headline(cls))
print(f" {docstring_headline(cls)}")
def _print_list_as_json(requested_items):
@ -185,8 +185,8 @@ def main_inner(parser, argns):
return 0
if argns.V:
print('Pygments version %s, (c) 2006-2023 by Georg Brandl, Matthäus '
'Chajdas and contributors.' % __version__)
print(f'Pygments version {__version__}, (c) 2006-2024 by Georg Brandl, Matthäus '
'Chajdas and contributors.')
return 0
def is_only_option(opt):
@ -659,7 +659,7 @@ def main(args=sys.argv):
msg = info[-1].strip()
if len(info) >= 3:
# extract relevant file and position info
msg += '\n (f%s)' % info[-2].split('\n')[0].strip()[1:]
msg += '\n (f{})'.format(info[-2].split('\n')[0].strip()[1:])
print(file=sys.stderr)
print('*** Error while highlighting:', file=sys.stderr)
print(msg, file=sys.stderr)