aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Pygments/py3/pygments/lexers/__init__.py
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-06-09 14:39:19 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-06-09 14:39:19 +0300
commitc04b663c7bb4b750deeb8f48f620497ec13da8fa (patch)
tree151ebc8bfdd2ad918caf5e6e2d8013e14272ddf8 /contrib/python/Pygments/py3/pygments/lexers/__init__.py
parent0d55ca22c507d18c2f35718687e0b06d9915397b (diff)
downloadydb-c04b663c7bb4b750deeb8f48f620497ec13da8fa.tar.gz
intermediate changes
ref:2d4f292087954c9344efdabb7b2a67f466263c65
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/__init__.py')
-rw-r--r--contrib/python/Pygments/py3/pygments/lexers/__init__.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/__init__.py b/contrib/python/Pygments/py3/pygments/lexers/__init__.py
index 9b89b6da3f..79c4e9bf35 100644
--- a/contrib/python/Pygments/py3/pygments/lexers/__init__.py
+++ b/contrib/python/Pygments/py3/pygments/lexers/__init__.py
@@ -4,7 +4,7 @@
Pygments lexers.
- :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -47,14 +47,18 @@ def _load_lexers(module_name):
_lexer_cache[cls.name] = cls
-def get_all_lexers():
+def get_all_lexers(plugins=True):
"""Return a generator of tuples in the form ``(name, aliases,
filenames, mimetypes)`` of all know lexers.
+
+ If *plugins* is true (the default), plugin lexers supplied by entrypoints
+ are also returned. Otherwise, only builtin ones are considered.
"""
for item in LEXERS.values():
yield item[1:]
- for lexer in find_plugin_lexers():
- yield lexer.name, lexer.aliases, lexer.filenames, lexer.mimetypes
+ if plugins:
+ for lexer in find_plugin_lexers():
+ yield lexer.name, lexer.aliases, lexer.filenames, lexer.mimetypes
def find_lexer_class(name):