aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Pygments/py3/pygments/cmdline.py
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-05-20 07:58:40 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-05-20 08:05:00 +0300
commitbcd5bcc390793791d293d386b2ebefbe683fb4e1 (patch)
treec93e3b8c847237e7e7626f4a07f1b657bb34f04d /contrib/python/Pygments/py3/pygments/cmdline.py
parent1a9f1508fe9c8c5927ffebf33197a6108e70501d (diff)
downloadydb-bcd5bcc390793791d293d386b2ebefbe683fb4e1.tar.gz
Intermediate changes
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/cmdline.py')
-rw-r--r--contrib/python/Pygments/py3/pygments/cmdline.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/contrib/python/Pygments/py3/pygments/cmdline.py b/contrib/python/Pygments/py3/pygments/cmdline.py
index 435231e651..df1c3b7a46 100644
--- a/contrib/python/Pygments/py3/pygments/cmdline.py
+++ b/contrib/python/Pygments/py3/pygments/cmdline.py
@@ -4,7 +4,7 @@
Command line interface.
- :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2024 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)