
     h                    r    d Z ddlm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ddZddZ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)
    )annotations)TYPE_CHECKINGDictType   Style)Token)style_from_pygments_clsstyle_from_pygments_dictpygments_token_to_classnamepygments_style_clstype[PygmentsStyle]returnr	   c                Z    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   PygmentsStyles     Z/var/www/html/Sam_Eipo/venv/lib/python3.11/site-packages/prompt_toolkit/styles/pygments.pyr   r      s?     655555(-88888#$6$=>>>    pygments_dictdict[Token, str]c                    g }|                                  D ])\  }}|                    t          |          |f           *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styles       r   r   r   0   s]    
 N%++-- K Ku:5AA5IJJJJ   r   r   r
   strc                Z    d| z   }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   partss     r   r   r   =   s*     E!E88E??  """r   N)r   r   r   r	   )r   r   r   r	   )r   r
   r   r    )__doc__
__future__r   typingr   r   r   r   r	   r   r   pygments.tokenr
   __all__r   r   r    r   r   <module>r-      s     # " " " " " , , , , , , , , , ,       %555555$$$$$$  ? ? ? ?*
! 
! 
! 
!# # # # # #r   