
    	i~                     `    d dl mZmZ d dlmZ d dlmZ ddlmZ  G d dej	                  Z
dS )	    )LiteralUnion)warn)Color   )	xmlwriterc                   <    e Zd ZdZdd fdZdefdZddZddeddfd	Z	d
e
eef         ddfdZddeddfdZddeddfdZdded         ddfdZddeddfdZdded         ddfdZddeddfdZddeddfdZdeddfdZdd eddfd!Zdd"eddfd#Zd$ed%         ddfd&Zddd(Zdd)eddfd*Zd+eddfd,Zdd-eddfd.Zdd/eddfd0Zdd1eddfd2Zdd3eddfd4Z d5e
eef         ddfd6Z!d7e
eef         ddfd8Z"dd9eddfd:Z#d;e
eef         ddfd<Z$dd=eddfd>Z%d?e
eef         ddfd@Z&ddAedB         ddfdCZ'ddDeddfdEZ(dFe
eef         ddfdGZ)ddHeddfdIZ*dJe
eef         ddfdKZ+ddLeddfdMZ,dNe
eef         ddfdOZ-dPe
eef         ddfdQZ.ddReddfdSZ/ddTeddfdUZ0ddVeddfdWZ1ddXeddfdYZ2ddZeddfd[Z3d\eddfd]Z4d^eddfd_Z5d`eddfdaZ6dbeddfdcZ7ddeddfdeZ8dfeddfdgZ9ddieddfdjZ:dked%         ddfdlZ;dmeddfdnZ<doeddfdpZ=dqeddfdrZ>dseddfdtZ?dueddfdvZ@dweddfdxZAddyeddfdzZBd{ed|         ddfd}ZCdd~eddfdZDdeddfdZEdeddfdZFd
e
eef         ddfdZGd ZHd ZId ZJd ZKd ZLd ZMd ZNd ZOd ZP xZQS )Formatz;
    A class for writing the Excel XLSX Format file.


    Nreturnc                 X   |i }t                                                       || _        || _        d| _        d| _        d| _        d| _        d| _        d| _	        d| _
        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d	| _        d| _        d| _         d| _!        d| _"        d| _#        d| _$        d| _%        d| _&        d| _'        d| _(        d| _)        d| _*        d| _+        d| _,        d| _-        d| _.        d| _/        d| _0        d| _1        d| _2        d| _3        d| _4        d| _5        d| _6        d| _7        d| _8        d| _9        d| _:        d| _;        d| _<        d| _=        d| _>        d| _?        d| _@        d| _A        d| _B        |C                                D ]!\  }} t          | d
|z             |           "d| _E        dS )z
        Constructor.

        NGeneralr   FCalibri      minorr   set_)Fsuper__init__xf_format_indicesdxf_format_indicesxf_index	dxf_index
num_formatnum_format_index
font_indexhas_fonthas_dxf_fontbold	underlineitalic	font_name	font_size
font_colorfont_strikeoutfont_outlinefont_shadowfont_scriptfont_familyfont_charsetfont_schemefont_condensefont_extendtheme	hyperlinkxf_idhiddenlockedtext_h_align	text_wraptext_v_aligntext_justlastrotationfg_colorbg_colorpatternhas_fillhas_dxf_fill
fill_index
fill_countborder_index
has_borderhas_dxf_borderborder_countbottombottom_colordiag_border
diag_color	diag_typeleft
left_colorrightright_colortop	top_colorindentshrinkmerge_rangereading_orderjust_distribcolor_indexed	font_onlyquote_prefixcheckboxitemsgetattr_format_key)self
properties
xf_indicesdxf_indiceskeyvalue	__class__s         I/srv/django_bis/venv311/lib/python3.11/site-packages/xlsxwriter/format.pyr   zFormat.__init__    sY   
 J!+"-# !!	""

!# 	
! %**,, 	/ 	/JC'GD&3,''....    c                     d| j         d| j         d| j         d| j         d| j         d| j         d| j        d| j         d	| j         d
| j	         d| j
         d| j         d| j         d| j         dS )zH
        Return a string representation of the Format instance.
        zFormat(font_name=z, font_size=z, bold=z	, italic=z, underline=z, font_color=z, num_format=z, text_h_align=z, text_v_align=z, fg_color=z, bg_color=z
, pattern=z	, locked=z	, hidden=))r!   r"   r   r    r   r#   r   r2   r4   r7   r8   r9   r1   r0   rY   s    r`   __repr__zFormat.__repr__{   s    
%% %% % I% % k	% %
 % % /% % /% % !-% % !-% % % % % % |% % k% % k% % %	
ra   c                     || _         dS )z
        Set the Format font_name property such as 'Time New Roman'. The
        default Excel font is 'Calibri'.

        Args:
            font_name: String with the font name. No default.

        Returns:
            Nothing.

        Nr!   rY   r!   s     r`   set_font_namezFormat.set_font_name   s     #ra   r   r"   c                     || _         dS )z
        Set the Format font_size property. The default Excel font size is 11.

        Args:
            font_size: Int with font size. No default.

        Returns:
            Nothing.

        Nr"   rY   r"   s     r`   set_font_sizezFormat.set_font_size        #ra   r#   c                 8    t          j        |          | _        dS )z
        Set the Format font_color property. The Excel default is black.

        Args:
            font_color: String with the font color. No default.

        Returns:
            Nothing.

        Nr   _from_valuer#   rY   r#   s     r`   set_font_colorzFormat.set_font_color         +J77ra   Tr   c                     || _         dS )z
        Set the Format bold property.

        Args:
            bold: Default is True, turns property on.

        Returns:
            Nothing.

        N)r   )rY   r   s     r`   set_boldzFormat.set_bold        			ra   r    c                     || _         dS )z
        Set the Format italic property.

        Args:
            italic: Default is True, turns property on.

        Returns:
            Nothing.

        N)r    )rY   r    s     r`   
set_italiczFormat.set_italic        ra   r   r   )r   r   !   "   c                     || _         dS )z
        Set the Format underline property.

        Args:
            underline: Default is 1, single underline.

        Returns:
            Nothing.

        N)r   )rY   r   s     r`   set_underlinezFormat.set_underline   rn   ra   r$   c                     || _         dS )z
        Set the Format font_strikeout property.

        Args:
            font_strikeout: Default is True, turns property on.

        Returns:
            Nothing.

        N)r$   )rY   r$   s     r`   set_font_strikeoutzFormat.set_font_strikeout   s     -ra   r'   )r   r   c                     || _         dS )z
        Set the Format font_script property.

        Args:
            font_script: Default is 1, superscript.

        Returns:
            Nothing.

        N)r'   )rY   r'   s     r`   set_font_scriptzFormat.set_font_script        'ra   r%   c                     || _         dS )z
        Set the Format font_outline property.

        Args:
            font_outline: Default is True, turns property on.

        Returns:
            Nothing.

        N)r%   )rY   r%   s     r`   set_font_outlinezFormat.set_font_outline        )ra   r&   c                     || _         dS )z
        Set the Format font_shadow property.

        Args:
            font_shadow: Default is True, turns property on.

        Returns:
            Nothing.

        N)r&   )rY   r&   s     r`   set_font_shadowzFormat.set_font_shadow  r   ra   r   c                     || _         dS )z
        Set the Format num_format property such as '#,##0'.

        Args:
            num_format: String representing the number format. No default.

        Returns:
            Nothing.

        N)r   )rY   r   s     r`   set_num_formatzFormat.set_num_format       %ra   r1   c                     || _         dS )z
        Set the Format locked property.

        Args:
            locked: Default is True, turns property on.

        Returns:
            Nothing.

        N)r1   )rY   r1   s     r`   
set_lockedzFormat.set_locked'  rz   ra   r0   c                     || _         dS )z
        Set the Format hidden property.

        Args:
            hidden: Default is True, turns property on.

        Returns:
            Nothing.

        N)r0   )rY   r0   s     r`   
set_hiddenzFormat.set_hidden4  rz   ra   	alignment)rG   centrecenterrI   filljustifycenter_acrosscentre_acrossdistributedjustify_distributedr   rK   vcentrevcenterrB   vjustifyvdistributedc                    |                                 }|dk    r|                     d           |dk    r|                     d           |dk    r|                     d           |dk    r|                     d           |dk    r|                     d	           |d
k    r|                     d           |dk    r|                     d           |dk    r|                     d           |dk    r|                     d           |dk    r|                     d           |dk    rd| _        |dk    r|                     d           |dk    r|                     d           |dk    r|                     d           |dk    r|                     d           |dk    r|                     d	           |dk    r|                     d           dS dS )z
        Set the Format cell alignment.

        Args:
            alignment: String representing alignment. No default.

        Returns:
            Nothing.
        rG   r   r   r   r   rI      r      r      r      r   r      r   rK   r   r   rB   r   r   N)lowerset_text_h_alignrQ   set_text_v_align)rY   r   s     r`   	set_alignzFormat.set_alignA  s*   > OO%%	 !!!$$$  !!!$$$  !!!$$$!!!$$$!!!$$$	!!!!!$$$''!!!$$$''!!!$$$%%!!!$$$---!!!$$$--- !D !!!$$$	!!!!!$$$	!!!!!$$$  !!!$$$
""!!!$$$&&!!!$$$$$ '&ra   
align_typec                 0    |                      d           dS )z`
        Set the Format center_across property.

        Returns:
            Nothing.

        r   N)r   )rY   r   s     r`   set_center_acrosszFormat.set_center_across  s     	a     ra   r3   c                     || _         dS )z
        Set the Format text_wrap property.

        Args:
            text_wrap: Default is True, turns property on.

        Returns:
            Nothing.

        N)r3   )rY   r3   s     r`   set_text_wrapzFormat.set_text_wrap  rn   ra   r6   c                     t          |          }|dk    rd}n.d|cxk    rdk    rn n|dk     r| dz   }nt          d           dS || _        dS )z
        Set the Format rotation property.

        Args:
            rotation: Rotation angle. No default.

        Returns:
            Nothing.

        i     iZ   r   z3Rotation rotation outside range: -90 <= angle <= 90N)intr   r6   )rY   r6   s     r`   set_rotationzFormat.set_rotation  sw     x== s??HHH"""""""""!||$9r>FGGGF ra   rM   c                     || _         dS )z
        Set the Format indent property.

        Args:
            indent: Default is 1, first indentation level.

        Returns:
            Nothing.

        N)rM   )rY   rM   s     r`   
set_indentzFormat.set_indent  rz   ra   rN   c                     || _         dS )z
        Set the Format shrink property.

        Args:
            shrink: Default is True, turns property on.

        Returns:
            Nothing.

        N)rN   )rY   rN   s     r`   
set_shrinkzFormat.set_shrink  rz   ra   r5   c                     || _         dS )z
        Set the Format text_justlast property.

        Args:
            text_justlast: Default is True, turns property on.

        Returns:
            Nothing.

        N)r5   )rY   r5   s     r`   set_text_justlastzFormat.set_text_justlast       +ra   r9   c                     || _         dS )z
        Set the Format pattern property.

        Args:
            pattern: Default is 1, solid fill.

        Returns:
            Nothing.

        N)r9   )rY   r9   s     r`   set_patternzFormat.set_pattern  s     ra   r8   c                 8    t          j        |          | _        dS )z
        Set the Format bg_color property.

        Args:
            bg_color: Background color. No default.

        Returns:
            Nothing.

        N)r   rq   r8   )rY   r8   s     r`   set_bg_colorzFormat.set_bg_color       )(33ra   r7   c                 8    t          j        |          | _        dS )z
        Set the Format fg_color property.

        Args:
            fg_color: Foreground color. No default.

        Returns:
            Nothing.

        N)r   rq   r7   )rY   r7   s     r`   set_fg_colorzFormat.set_fg_color  r   ra   stylec                     |                      |           |                     |           |                     |           |                     |           dS z
        Set the Format bottom property.

        Args:
            bottom: Default is 1, border type 1.

        Returns:
            Nothing.

        N)
set_bottomset_topset_left	set_right)rY   r   s     r`   
set_borderzFormat.set_border	  sR     	Ueura   colorc                     |                      |           |                     |           |                     |           |                     |           dS )z
        Set the Format bottom property.

        Args:
            color: Color string. No default.

        Returns:
            Nothing.

        N)set_bottom_colorset_top_colorset_left_colorset_right_color)rY   r   s     r`   set_border_colorzFormat.set_border_color  sZ     	e$$$5!!!E"""U#####ra   rB   c                     || _         dS r   )rB   )rY   rB   s     r`   r   zFormat.set_bottom*  rz   ra   rC   c                 8    t          j        |          | _        dS )z
        Set the Format bottom_color property.

        Args:
            bottom_color: Color string. No default.

        Returns:
            Nothing.

        N)r   rq   rC   )rY   rC   s     r`   r   zFormat.set_bottom_color7  s     "-l;;ra   rF   )r   r   r   c                     || _         dS )z
        Set the Format diag_type property.

        Args:
            diag_type: Default is 1, border type 1.

        Returns:
            Nothing.

        N)rF   )rY   rF   s     r`   set_diag_typezFormat.set_diag_typeD  rn   ra   rG   c                     || _         dS )z
        Set the Format left property.

        Args:
            left: Default is 1, border type 1.

        Returns:
            Nothing.

        N)rG   )rY   rG   s     r`   r   zFormat.set_leftQ  rw   ra   rH   c                 8    t          j        |          | _        dS )z
        Set the Format left_color property.

        Args:
            left_color: Color string. No default.

        Returns:
            Nothing.

        N)r   rq   rH   )rY   rH   s     r`   r   zFormat.set_left_color^  rt   ra   rI   c                     || _         dS )z
        Set the Format right property.

        Args:
            right: Default is 1, border type 1.

        Returns:
            Nothing.

        N)rI   )rY   rI   s     r`   r   zFormat.set_rightk       


ra   rJ   c                 8    t          j        |          | _        dS )z
        Set the Format right_color property.

        Args:
            right_color: Color string. No default.

        Returns:
            Nothing.

        N)r   rq   rJ   )rY   rJ   s     r`   r   zFormat.set_right_colorx  s     !,[99ra   rK   c                     || _         dS )z
        Set the Format top property.

        Args:
            top: Default is 1, border type 1.

        Returns:
            Nothing.

        N)rK   )rY   rK   s     r`   r   zFormat.set_top  s     ra   rL   c                 8    t          j        |          | _        dS )z
        Set the Format top_color property.

        Args:
            top_color: Color string. No default.

        Returns:
            Nothing.

        N)r   rq   rL   )rY   rL   s     r`   r   zFormat.set_top_color  s     *955ra   rE   c                 8    t          j        |          | _        dS )z
        Set the Format diag_color property.

        Args:
            diag_color: Color string. No default.

        Returns:
            Nothing.

        N)r   rq   rE   )rY   rE   s     r`   set_diag_colorzFormat.set_diag_color  rt   ra   rD   c                     || _         dS )z
        Set the Format diag_border property.

        Args:
            diag_border: Default is 1, border type 1.

        Returns:
            Nothing.

        N)rD   )rY   rD   s     r`   set_diag_borderzFormat.set_diag_border  r   ra   rT   c                     || _         dS )z
        Set the Format quote prefix property.

        Args:
            quote_prefix: Default is True, turns property on.

        Returns:
            Nothing.

        N)rT   )rY   rT   s     r`   set_quote_prefixzFormat.set_quote_prefix  r   ra   rU   c                     || _         dS )a  
        Set the Format property to show a checkbox in a cell.

        This format property can be used with a cell that contains a boolean
        value to display it as a checkbox. This property isn't required very
        often and it is generally easier to create a checkbox using the
        ``worksheet.insert_checkbox()`` method.

        Args:
            checkbox: Default is True, turns property on.

        Returns:
            Nothing.

        N)rU   )rY   rU   s     r`   set_checkboxzFormat.set_checkbox  s      !ra   r   c                     || _         dS )z
        Set the property to indicate the format has a font.

        Args:
            has_font: Default is True, turns property on.

        Returns:
            Nothing.

        N)r   )rY   r   s     r`   set_has_fontzFormat.set_has_font       !ra   r:   c                     || _         dS )z
        Set the property to indicate the format has a fill.

        Args:
            has_fill: Default is True, turns property on.

        Returns:
            Nothing.

        N)r:   )rY   r:   s     r`   set_has_fillzFormat.set_has_fill  r   ra   r   c                     || _         dS )z
        Set the unique font index property.

        Args:
            font_index: The unique font index.

        Returns:
            Nothing.

        N)r   )rY   r   s     r`   set_font_indexzFormat.set_font_index  r   ra   r   c                     || _         dS )z
        Set the unique format index property.

        Args:
            xf_index: The unique Excel format index.

        Returns:
            Nothing.

        N)r   )rY   r   s     r`   set_xf_indexzFormat.set_xf_index  r   ra   r   c                     || _         dS )z
        Set the unique conditional format index property.

        Args:
            dxf_index: The unique Excel conditional format index.

        Returns:
            Nothing.

        N)r   )rY   r   s     r`   set_dxf_indexzFormat.set_dxf_index  rn   ra   r   c                     || _         dS )z
        Set the number format_index property.

        Args:
            num_format_index: The unique number format index.

        Returns:
            Nothing.

        N)r   )rY   r   s     r`   set_num_format_indexzFormat.set_num_format_index   s     !1ra   r2   c                     || _         dS )z
        Set the horizontal text alignment property.

        Args:
            text_h_align: Horizontal text alignment.

        Returns:
            Nothing.

        N)r2   )rY   r2   s     r`   r   zFormat.set_text_h_align-  r   ra   r4   c                     || _         dS )z
        Set the vertical text alignment property.

        Args:
            text_h_align: Vertical text alignment.

        Returns:
            Nothing.

        N)r4   )rY   r4   s     r`   r   zFormat.set_text_v_align:  r   ra   r   	directionc                     || _         dS )z
        Set the reading order property.

        Args:
            direction: Default is 0, left to right.

        Returns:
            Nothing.

        N)rP   )rY   r   s     r`   set_reading_orderzFormat.set_reading_orderG  s     'ra   alignc                 0    |                      |           dS )a  
        Set vertical cell alignment property.

        This is required by the constructor properties dict to differentiate
        between the vertical and horizontal properties.

        Args:
            align: Alignment property.

        Returns:
            Nothing.

        N)r   )rY   r   s     r`   
set_valignzFormat.set_valignU  s    L 	ura   r(   c                     || _         dS )z
        Set the font family property.

        Args:
            font_family: Font family number.

        Returns:
            Nothing.

        N)r(   )rY   r(   s     r`   set_font_familyzFormat.set_font_family}  r   ra   r)   c                     || _         dS )z
        Set the font character set property.

        Args:
            font_charset: The font character set number.

        Returns:
            Nothing.

        N)r)   )rY   r)   s     r`   set_font_charsetzFormat.set_font_charset  r   ra   r*   c                     || _         dS )z
        Set the font scheme property.

        Args:
            font_scheme: The font scheme.

        Returns:
            Nothing.

        N)r*   )rY   r*   s     r`   set_font_schemezFormat.set_font_scheme  r   ra   r+   c                     || _         dS )z
        Set the font condense property.

        Args:
            font_condense: The font condense property.

        Returns:
            Nothing.

        N)r+   )rY   r+   s     r`   set_font_condensezFormat.set_font_condense  r   ra   r,   c                     || _         dS )z
        Set the font extend property.

        Args:
            font_extend: The font extend property.

        Returns:
            Nothing.

        N)r,   )rY   r,   s     r`   set_font_extendzFormat.set_font_extend  r   ra   r-   c                     || _         dS )z
        Set the theme property.

        Args:
            theme: Format theme.

        Returns:
            Nothing.

        N)r-   )rY   r-   s     r`   	set_themezFormat.set_theme  r   ra   r.   c                 v    d| _         |                     d           |                     d           || _        dS )z
        Set the properties for the hyperlink style.

        Args:
            hyperlink: Default is True, turns property on.

        Returns:
            Nothing.

        r   
   N)r/   r~   r  r.   )rY   r.   s     r`   set_hyperlinkzFormat.set_hyperlink  s<     
1r"ra   color_index)r   r   c                     || _         dS )z
        Set the color index property. Some fundamental format properties use an
        indexed color instead of a rbg or theme color.

        Args:
            color_index: Generally 0 or 1.

        Returns:
            Nothing.

        N)rR   )rY   r  s     r`   set_color_indexedzFormat.set_color_indexed  s     )ra   rS   c                     || _         dS )z
        Set property to indicate that the format is used for fonts only.

        Args:
            font_only: Default is True, turns property on.

        Returns:
            Nothing.

        N)rS   )rY   rS   s     r`   set_font_onlyzFormat.set_font_only  rn   ra   r!   c                     || _         dS )z(Deprecated: Use set_font_name() instead.Nrg   rh   s     r`   set_fontzFormat.set_font      "ra   c                     || _         dS )z(Deprecated: Use set_font_size() instead.Nrk   rl   s     r`   set_sizezFormat.set_size  r  ra   c                 8    t          j        |          | _        dS )z)Deprecated: Use set_font_color() instead.Nrp   rr   s     r`   	set_colorzFormat.set_color  s    +J77ra   c                 f   d}g }| j         s*| j        s#| j        s| j        s| j        s| j        s| j        rd}n||fS | j        rI| j         dk    r>| j         dk    r3| j         dk    r(| j        dk    r| j        dk    r| j        dk    rd| _         | j        rd| _        | j         dk    rd| _        | j         dk    rd| _        | j         dk    rd| _        | j         dk    rd| _        | j        rd| _        d}| j         dk    r|                    d           | j         d	k    r|                    d
           | j         dk    r|                    d           | j         dk    r|                    d           | j         dk    r|                    d           | j         dk    r|                    d|f           | j         dk    r|                    d           | j        r|                    d           | j        dk    r|                    d           | j        d	k    r|                    d           | j        dk    r|                    d           | j        dk    r|                    d           | j        r|                    d| j        f           | j        r|                    d| j        f           | j        r|                    d           | j        r|                    d           | j        dk    r|                    d           | j        d	k    r|                    d           ||fS )Nr   r   r   r   r   r   centerContinuous)
horizontalrG   r   )r  r   )r  rI   )r  r   )r  r   r   r  )r  r   )justifyLastLiner   )verticalrK   )r  r   )r  r   )r  r   textRotationrM   )wrapTextr   )shrinkToFitr   )readingOrderr   )r  r   )	r2   r4   rM   r6   r3   rN   rP   rQ   append)rY   changedr   
continuouss       r`   _get_align_propertieszFormat._get_align_properties  s     	" 	" {	" }		"
 ~	" {	" !	" GGE>! K		"!Q&&!Q&&!Q&&!Q&&!Q&&!Q&& !D > 	DK!!DK!!DK!!DK!! !D; 	" !D'
!!LL/000!!LL1222!!LL0111!!LL/000!!LL2333!!LL,
3444!!LL6777 	1LL/000 !!LL,---!!LL/000!!LL0111!!LL4555= 	:LL.$-8999; 	2LL(DK0111> 	*LL))); 	-LL+,,,""LL,---""LL,---~ra   c                 z    g }| j         s|                    d           | j        r|                    d           |S )N)r1   r   )r0   r   )r1   r  r0   )rY   
attributess     r`   _get_protection_propertiesz!Format._get_protection_propertiesl  sI    
{ 	-m,,,; 	-m,,,ra   c                 :   | j         d                    d |                                 |                                 |                                 |                                 | j        | j        | j        | j	        | j
        f	D                       | _         | j         S )N:c              3   4   K   | ]}t          |          V  d S Nstr.0xs     r`   	<genexpr>z)Format._get_format_key.<locals>.<genexpr>z  s<       ( ( A( ( ( ( ( (ra   )rX   join_get_font_key_get_border_key_get_fill_key_get_alignment_keyr   r1   rU   rT   r0   rd   s    r`   _get_format_keyzFormat._get_format_keyw  s    #"xx ( ( &&((((**&&((++--OKM%K
( ( (    D ra   c                     d                     d | j        | j        | j        | j        | j        | j        | j        | j        | j	        | j
        | j        | j        | j        fD                       }|S )Nr"  c              3   4   K   | ]}t          |          V  d S r$  r%  r'  s     r`   r*  z'Format._get_font_key.<locals>.<genexpr>  s<       
 
 FF
 
 
 
 
 
ra   )r+  r   r#   r)   r(   r%   r'   r&   r$   r!   r    r"   r   r-   rY   r]   s     r`   r,  zFormat._get_font_key  s    hh 
 
 	! !  #

 
 
 
 
& 
ra   c                     d                     d | j        | j        | j        | j        | j        | j        | j        | j        | j	        | j
        | j        fD                       }|S )Nr"  c              3   4   K   | ]}t          |          V  d S r$  r%  r'  s     r`   r*  z)Format._get_border_key.<locals>.<genexpr>  s<       
 
 FF
 
 
 
 
 
ra   )r+  rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   r3  s     r`   r-  zFormat._get_border_key  sv    hh 
 
 ! 	
 
 
 
 
 
" 
ra   c                 h    d                     d | j        | j        | j        fD                       }|S )Nr"  c              3   4   K   | ]}t          |          V  d S r$  r%  r'  s     r`   r*  z'Format._get_fill_key.<locals>.<genexpr>  s(      TT!s1vvTTTTTTra   )r+  r9   r8   r7   r3  s     r`   r.  zFormat._get_fill_key  s4    hhTTdmT]'STTTTT
ra   c           
          d                     d | j        | j        | j        | j        | j        | j        | j        fD                       }|S )Nr"  c              3   4   K   | ]}t          |          V  d S r$  r%  r'  s     r`   r*  z,Format._get_alignment_key.<locals>.<genexpr>  s<       
 
 FF
 
 
 
 
 
ra   )r+  r2   r4   rM   r6   r3   rN   rP   r3  s     r`   r/  zFormat._get_alignment_key  sd     hh 
 
 !!"
 
 
 
 
 
ra   c                     | j         | j         S |                                 }|| j        v r| j        |         S dt          | j                  z   }|| j        |<   || _         |S )Nr   )r   r0  r   lenrY   r]   indexs      r`   _get_xf_indexzFormat._get_xf_index  sq    =$=  ""$$$((()#.. C.///&+s#ra   c                     | j         | j         S |                                 }|| j        v r| j        |         S t          | j                  }|| j        |<   || _         |S r$  )r   r0  r   r;  r<  s      r`   _get_dxf_indexzFormat._get_dxf_index  sl    >%>! ""$$$)))*3// D+,,',$ra   )NNN)r   N)r   )T)r   r$  )r   Nr   N)r   )R__name__
__module____qualname____doc__r   r&  re   ri   r   rm   r   r   rs   boolrv   ry   r   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r	  r  r  r  r  r   r0  r,  r-  r.  r/  r>  r@  __classcell__)r_   s   @r`   r
   r
      s	        Y  Y  Y  Y  Y  Y  Y v
# 
 
 
 
8# # # ## #s #D # # # #8sEz): 8t 8 8 8 8 T T          # #w|'< #T # # # #- - - - - - -' '74= ' ' ' ' ') )T )T ) ) ) )' '4 '4 ' ' ' '% % % % % %            F%
F%* 
+F% F% F% F%P	! 	! 	! 	! 	!# #t #t # # # #!S !T ! ! ! !2  T          + +t +t + + + + 3 t    4U3:%6 44 4 4 4 44U3:%6 44 4 4 4 4  D    "$eCJ&7 $D $ $ $ $   T    <U3:-> <4 < < < <# #ww'7 # # # # # S     8sEz): 8t 8 8 8 8 s 4    :5e+< : : : : : 3 t    6uS%Z'8 6T 6 6 6 68sEz): 8t 8 8 8 8' '3 't ' ' ' ') )T )T ) ) ) )! !T !T ! ! ! !2! !T !T ! ! ! !! !T !T ! ! ! !% % % % % %!S !T ! ! ! !#s #t # # # #1S 1T 1 1 1 1)S )T ) ) ) ))S )T ) ) ) )' '3 't ' ' ' '&
&* 
+& & & &P'3 '4 ' ' ' ')S )T ) ) ) )'3 '4 ' ' ' '+s +t + + + +'3 '4 ' ' ' 's t    # #t #t # # # # )WT] )t ) ) ) )# #t #t # # # #"## #$ # # # ### #$ # # # #8E%*$5 8$ 8 8 8 8^ ^ ^@	 	 	     (  .  *    $  (      ra   r
   N)typingr   r   warningsr   xlsxwriter.colorr    r   	XMLwriterr
    ra   r`   <module>rM     s    " ! ! ! ! ! ! !       " " " " " "      a a a a aY  a a a a ara   