a
    b                     @   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   l/Users/vegardjervell/Documents/master/model/venv/lib/python3.9/site-packages/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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   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
   