U
    .R”iÛ  ã                   @   sl   d dl mZmZmZ d dlmZ d dlmZmZm	Z	m
Z
mZ ddlmZ G dd„ deƒZG dd	„ d	eƒZd
S )é    )ÚTypedÚSequenceÚAlias)ÚSerialisable)ÚFontÚFillÚBorderÚ	AlignmentÚ
Protectioné   )ÚNumberFormatc                   @   sf   e Zd ZdZdZeedd�Zeedd�Z	ee
dd�Zeedd�Zeedd�Zeedd�Zddd„ZdS )	ÚDifferentialStyleÚdxf)ÚfontÚnumFmtÚfillÚ	alignmentÚborderÚ
protectionT)Úexpected_typeÚ
allow_noneNc                 C   s.   || _ || _|| _|| _|| _|| _|| _d S ©N)r   r   r   r   r   r   ÚextLst)Úselfr   r   r   r   r   r   r   © r   ú@/tmp/pip-unpacked-wheel-r0v169r1/openpyxl/styles/differential.pyÚ__init__    s    	zDifferentialStyle.__init__)NNNNNNN)Ú__name__Ú
__module__Ú__qualname__ÚtagnameZ__elements__r   r   r   r   r   r   r   r	   r   r   r   r
   r   r   r   r   r   r   r      s           ùr   c                   @   s`   e Zd ZdZdZeed�ZedƒZ	dZ
ddd	„Zd
d„ Zdd„ Zdd„ Zdd„ Zedd„ ƒZdS )ÚDifferentialStyleListz6
    Dedupable container for differential styles.
    Zdxfs)r   r   )Úcountr   Nc                 C   s
   || _ d S r   )r   )r   r   r"   r   r   r   r   >   s    zDifferentialStyleList.__init__c                 C   s8   t |tƒstdttƒ ƒ‚|| jkr(dS | j |¡ dS )zV
        Check to see whether style already exists and append it if does not.
        z	expected N)Ú
isinstancer   Ú	TypeErrorÚstrÚstylesÚappend©r   r   r   r   r   r'   B   s
    

zDifferentialStyleList.appendc                 C   s   |   |¡ | j |¡S )z?
        Add a differential style and return its index
        )r'   r&   Úindexr(   r   r   r   ÚaddM   s    
zDifferentialStyleList.addc                 C   s
   t | jƒS r   )Úboolr&   ©r   r   r   r   Ú__bool__U   s    zDifferentialStyleList.__bool__c                 C   s
   | j | S r   )r&   )r   Úidxr   r   r   Ú__getitem__Y   s    z!DifferentialStyleList.__getitem__c                 C   s
   t | jƒS r   )Úlenr   r,   r   r   r   r"   ]   s    zDifferentialStyleList.count)r   N)r   r   r   Ú__doc__r    r   r   r   r   r&   Ú	__attrs__r   r'   r*   r-   r/   Úpropertyr"   r   r   r   r   r!   2   s   

r!   N)Zopenpyxl.descriptorsr   r   r   Z!openpyxl.descriptors.serialisabler   Zopenpyxl.stylesr   r   r   r	   r
   Znumbersr   r   r!   r   r   r   r   Ú<module>   s
   