B
    P\                 @   s   d dl mZ d dlmZmZmZmZmZ d dlm	Z	 d dl
mZmZ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 )    )absolute_import)IntegerStringTypedSequenceAlias)Serialisable)FontFillGradientFillPatternFill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_typeZ
allow_noneNc             C   s.   || _ || _|| _|| _|| _|| _|| _d S )N)r   r   r   r   r   r   extLst)selfr   r   r   r   r   r   r    r   ;lib/python3.7/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               @   sT   e Zd ZdZdZeedZedZ	dddZ
dd	 Zd
d Zdd ZeZdd ZdS )DifferentialStyleListz5
    Deduping container for differential styles.
    Zdxfs)r   r   r   c             C   s
   || _ d S )N)r   )r   r   r   r   r   r   B   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)   F   s
    

zDifferentialStyleList.appendc             C   s   |  | | j|S )z?
        Add a differential style and return its index
        )r)   r(   index)r   r   r   r   r   addQ   s    
zDifferentialStyleList.addc             C   s
   t | jS )N)boolr(   )r   r   r   r   __bool__Y   s    zDifferentialStyleList.__bool__c             C   s
   | j | S )N)r(   )r   idxr   r   r   __getitem___   s    z!DifferentialStyleList.__getitem__N)r   )r    r!   r"   __doc__r#   r   r   r   r   r(   r   r)   r+   r-   Z__nonzero__r/   r   r   r   r   r$   7   s   

r$   N)Z
__future__r   Zopenpyxl.descriptorsr   r   r   r   r   Z!openpyxl.descriptors.serialisabler   Zopenpyxl.stylesr	   r
   r   r   r   r   r   Znumbersr   r   r$   r   r   r   r   <module>   s   $	