U
    yãc
  ã                   @   s@   d Z dZdZdZdZdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dS )a  
    pygments.plugin
    ~~~~~~~~~~~~~~~

    Pygments plugin interface. By default, this tries to use
    ``importlib.metadata``, which is in the Python standard
    library since Python 3.8, or its ``importlib_metadata``
    backport for earlier versions of Python. It falls back on
    ``pkg_resources`` if not found. Finally, if ``pkg_resources``
    is not found either, no plugins are loaded at all.

    lexer plugins::

        [pygments.lexers]
        yourlexer = yourmodule:YourLexer

    formatter plugins::

        [pygments.formatters]
        yourformatter = yourformatter:YourFormatter
        /.ext = yourformatter:YourFormatter

    As you can see, you can define extensions for the formatter
    with a leading slash.

    syntax plugins::

        [pygments.styles]
        yourstyle = yourstyle:YourStyle

    filter plugin::

        [pygments.filter]
        yourfilter = yourfilter:YourFilter


    :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
zpygments.lexerszpygments.formatterszpygments.styleszpygments.filtersc                 C   s¾   zddl m} W n€ tk
r   zddlm} W nZ tk
rŠ   zddlm} W n$ ttfk
rt   g  Y  Y  Y S X || ƒ Y  Y S Y nX Y nX |ƒ }t|dƒr®|j| dS | 	| g ¡S d S )Né    )Úentry_points)Úiter_entry_pointsÚselect)Úgroup)
Úimportlib.metadatar   ÚImportErrorZimportlib_metadataZpip._vendor.pkg_resourcesr   ÚOSErrorÚhasattrr   Úget)Z
group_namer   r   Úgroups© r   ú:/tmp/pip-build-0we0fmvo/pip/pip/_vendor/pygments/plugin.pyr   /   s    
r   c                  c   s   t tƒD ]} |  ¡ V  qd S ©N)r   ÚLEXER_ENTRY_POINTÚload©Z
entrypointr   r   r   Úfind_plugin_lexersG   s    r   c                  c   s"   t tƒD ]} | j|  ¡ fV  qd S r   )r   ÚFORMATTER_ENTRY_POINTÚnamer   r   r   r   r   Úfind_plugin_formattersL   s    r   c                  c   s"   t tƒD ]} | j|  ¡ fV  qd S r   )r   ÚSTYLE_ENTRY_POINTr   r   r   r   r   r   Úfind_plugin_stylesQ   s    r   c                  c   s"   t tƒD ]} | j|  ¡ fV  qd S r   )r   ÚFILTER_ENTRY_POINTr   r   r   r   r   r   Úfind_plugin_filtersV   s    r   N)
Ú__doc__r   r   r   r   r   r   r   r   r   r   r   r   r   Ú<module>   s   (