Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._vendor.pygments.styles Namespace Reference

Functions

 get_style_by_name (name)
 
 get_all_styles ()
 

Variables

dict STYLE_MAP
 

Detailed Description

    pygments.styles
    ~~~~~~~~~~~~~~~

    Contains built-in styles.

    :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.

Function Documentation

◆ get_all_styles()

get_all_styles ( )
Return a generator for all styles by name, both builtin and plugin.

Definition at line 99 of file __init__.py.

99def get_all_styles():
100 """Return a generator for all styles by name, both builtin and plugin."""
101 yield from STYLE_MAP
102 for name, _ in find_plugin_styles():
103 yield name

◆ get_style_by_name()

get_style_by_name (   name)
Return a style class by its short name. The names of the builtin styles
are listed in :data:`pygments.styles.STYLE_MAP`.

Will raise :exc:`pygments.util.ClassNotFound` if no style of that name is
found.

Definition at line 68 of file __init__.py.

68def get_style_by_name(name):
69 """
70 Return a style class by its short name. The names of the builtin styles
71 are listed in :data:`pygments.styles.STYLE_MAP`.
72
73 Will raise :exc:`pygments.util.ClassNotFound` if no style of that name is
74 found.
75 """
76 if name in STYLE_MAP:
77 mod, cls = STYLE_MAP[name].split('::')
78 builtin = "yes"
79 else:
80 for found_name, style in find_plugin_styles():
81 if name == found_name:
82 return style
83 # perhaps it got dropped into our styles package
84 builtin = ""
85 mod = name
86 cls = name.title() + "Style"
87
88 try:
89 mod = __import__('pygments.styles.' + mod, None, None, [cls])
90 except ImportError:
91 raise ClassNotFound("Could not find style module %r" % mod +
92 (builtin and ", though it should be builtin") + ".")
93 try:
94 return getattr(mod, cls)
95 except AttributeError:
96 raise ClassNotFound("Could not find style class %r in style module." % cls)
97
98
for i

References i.

Variable Documentation

◆ STYLE_MAP

dict STYLE_MAP

Definition at line 16 of file __init__.py.