a
    lc                     @   s   d Z ddlmZmZmZ ddlmZ er@ddlmZ ddl	m
Z
 g dZed edd	d
Zedef edddZdedddZdS )z
Adaptor for building prompt_toolkit styles, starting from a Pygments style.

Usage::

    from pygments.styles.tango import TangoStyle
    style = style_from_pygments_cls(pygments_style_cls=TangoStyle)
    )TYPE_CHECKINGDictType   Style)Token)style_from_pygments_clsstyle_from_pygments_dictpygments_token_to_classnamePygmentsStyle)pygments_style_clsreturnc                 C   s$   ddl m} t| |sJ t| jS )a  
    Shortcut to create a :class:`.Style` instance from a Pygments style class
    and a style dictionary.

    Example::

        from prompt_toolkit.styles.from_pygments import style_from_pygments_cls
        from pygments.styles import get_style_by_name
        style = style_from_pygments_cls(get_style_by_name('monokai'))

    :param pygments_style_cls: Pygments style class to start from.
    r   r   )pygments.styler   
issubclassr
   styles)r   r    r   Z/var/www/html/django/DPS/env/lib/python3.9/site-packages/prompt_toolkit/styles/pygments.pyr	      s    r	   r   )pygments_dictr   c                 C   s0   g }|   D ]\}}|t||f qt|S )z
    Create a :class:`.Style` instance from a Pygments style dictionary.
    (One that maps Token objects to style strings.)
    )itemsappendr   r   )r   pygments_styletokenstyler   r   r   r
   .   s    r
   )r   r   c                 C   s   d|  }d | S )z
    Turn e.g. `Token.Name.Exception` into `'pygments.name.exception'`.

    (Our Pygments lexer will also turn the tokens that pygments produces in a
    prompt_toolkit list of fragments that match these styling rules.)
    )pygments.)joinlower)r   partsr   r   r   r   ;   s    r   N)__doc__typingr   r   r   r   r   r   r   Zpygments.tokenr   __all__r	   strr
   r   r   r   r   r   <module>   s   