B
    't\                 @   s   d Z ddlmZmZ ddlmZmZmZ ddlm	Z	 ddl
mZ dddd	d
ddgZe	ddZedddddddddZdddddddddddddddd d!gZddd dddddddd"
Zee eestee ee@ rtG d#d
 d
eeeZG d$d deZG d%d deZd&S )'z#
The base classes for the styling.
    )unicode_literalsabsolute_import)ABCMetaabstractmethodabstractproperty)
namedtuple)with_metaclassAttrsDEFAULT_ATTRSANSI_COLOR_NAMESANSI_COLOR_NAMES_ALIASES	BaseStyle
DummyStyleDynamicStylez8color bgcolor bold underline italic blink reverse hidden F)ZcolorZbgcolorZboldZ	underlineZitalicZblinkreverseZhiddenZansidefaultZ	ansiblackZansiredZ	ansigreenZ
ansiyellowZansiblueZansimagentaZansicyanZansigrayZansibrightblackZansibrightredZansibrightgreenZansibrightyellowZansibrightblueZansibrightmagentaZansibrightcyanZ	ansiwhite)
ZansidarkgrayZansitealZansiturquoiseZ	ansibrownZ
ansipurpleZansifuchsiaZansilightgrayZansidarkredZansidarkgreenZansidarkbluec               @   s8   e Zd ZdZeefddZedd Zedd Z	dS )	r   z8
    Abstract base class for prompt_toolkit styles.
    c             C   s   dS )a  
        Return :class:`.Attrs` for the given style string.

        :param style_str: The style string. This can contain inline styling as
            well as classnames (e.g. "class:title").
        :param default: `Attrs` to be used if no styling was defined.
        N )self	style_strdefaultr   r   9lib/python3.7/site-packages/prompt_toolkit/styles/base.pyget_attrs_for_style_strQ   s    z!BaseStyle.get_attrs_for_style_strc             C   s   g S )z
        The list of style rules, used to create this style.
        (Required for `DynamicStyle` and `_MergedStyle` to work.)
        r   )r   r   r   r   style_rules[   s    zBaseStyle.style_rulesc             C   s   dS )z
        Invalidation hash for the style. When this changes over time, the
        renderer knows that something in the style changed, and that everything
        has to be redrawn.
        Nr   )r   r   r   r   invalidation_hashc   s    zBaseStyle.invalidation_hashN)
__name__
__module____qualname____doc__r   r
   r   r   r   r   r   r   r   r   r   M   s
   	c               @   s0   e Zd ZdZefddZdd Zedd ZdS )	r   z.
    A style that doesn't style anything.
    c             C   s   |S )Nr   )r   r   r   r   r   r   r   p   s    z"DummyStyle.get_attrs_for_style_strc             C   s   dS )N   r   )r   r   r   r   r   s   s    zDummyStyle.invalidation_hashc             C   s   g S )Nr   )r   r   r   r   r   v   s    zDummyStyle.style_rulesN)	r   r   r   r   r
   r   r   propertyr   r   r   r   r   r   l   s   c               @   s8   e Zd ZdZdd ZefddZdd Zedd	 Z	d
S )r   z
    Style class that can dynamically returns an other Style.

    :param get_style: Callable that returns a :class:`.Style` instance.
    c             C   s   || _ t | _d S )N)	get_styler   _dummy)r   r    r   r   r   __init__   s    zDynamicStyle.__init__c             C   s(   |   p| j}t|tst|||S )N)r    r!   
isinstancer   AssertionErrorr   )r   r   r   Zstyler   r   r   r      s    z$DynamicStyle.get_attrs_for_style_strc             C   s   |   p| j S )N)r    r!   r   )r   r   r   r   r      s    zDynamicStyle.invalidation_hashc             C   s   |   p| jjS )N)r    r!   r   )r   r   r   r   r      s    zDynamicStyle.style_rulesN)
r   r   r   r   r"   r
   r   r   r   r   r   r   r   r   r   {   s
   N)r   Z
__future__r   r   abcr   r   r   collectionsr   Zsixr   __all__r	   r
   r   r   setvaluesissubsetr$   keysobjectr   r   r   r   r   r   r   <module>   sD   

	

