o
    f                     @   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                   @   st   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   U/home/ubuntu/webapp/venv/lib/python3.10/site-packages/openpyxl/styles/differential.py__init__    s   	
zDifferentialStyle.__init__)NNNNNNN)__name__
__module____qualname__tagname__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.
    dxfs)r   r   )countr   Nc                 C   s
   || _ d S r   )r   )r   r   r$   r   r   r   r   >      
zDifferentialStyleList.__init__c                 C   s8   t |tstdtt || jv 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   
   t | jS r   )boolr)   r   r   r   r   __bool__U   r%   zDifferentialStyleList.__bool__c                 C   s
   | j | S r   )r)   )r   idxr   r   r   __getitem__Y   r%   z!DifferentialStyleList.__getitem__c                 C   r.   r   )lenr   r0   r   r   r   r$   ]   s   
zDifferentialStyleList.count)r   N)r   r   r   __doc__r    r   r   r   r   r)   	__attrs__r   r*   r-   r1   r3   propertyr$   r   r   r   r   r"   2   s    

r"   N)openpyxl.descriptorsr   r   r   !openpyxl.descriptors.serialisabler   openpyxl.stylesr   r   r   r	   r
   numbersr   r   r"   r   r   r   r   <module>   s   