
    li~                     b    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
y)	    )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d,Zdd-eddfd.Zdd/eddfd0Z d1e
eef   ddfd2Z!d3e
eef   ddfd4Z"dd5e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dfd?Z'dd@eddfdAZ(dBe
eef   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-dLe
eef   ddfdMZ.ddNeddfdOZ/ddPeddfdQZ0ddReddfdSZ1ddTeddfdUZ2ddVeddfdWZ3dXeddfdYZ4dZeddfd[Z5d\eddfd]Z6d^eddfd_Z7d`eddfdaZ8dbeddfdcZ9dddeddfdeZ:dfed"   ddfdgZ;dheddfdiZ<djeddfdkZ=dleddfdmZ>dneddfdoZ?dpeddfdqZ@dreddfdsZAddteddfduZBdvedw   ddfdxZCddyeddfdzZDd{e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                     |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        |j                         D ]  \  }} t        | d
|z         |        d| _E        y)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         O/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/xlsxwriter/format.pyr   zFormat.__init__    s;   
 J!+"-# !!	""

!# 	
! %**, 	/JC'GD&3,'.	/      c                 t   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    
* +( )II; kk] #( )//* +//, - --. / --. / ' '||n %kk] #kk]!%	
ra   c                     || _         y)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"   c                     || _         y)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                  |      | _        y)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ra   r   c                     || _         y)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                     || _         y)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   !   "   c                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                    |j                         }|dk(  r| j                  d       |dk(  r| j                  d       |dk(  r| j                  d       |dk(  r| j                  d       |dk(  r| j                  d	       |d
k(  r| j                  d       |dk(  r| j                  d       |dk(  r| j                  d       |dk(  r| j                  d       |dk(  r| j                  d       |dk(  rd| _        |dk(  r| j                  d       |dk(  r| j                  d       |dk(  r| j                  d       |dk(  r| j                  d       |dk(  r| j                  d	       |dk(  r| j                  d       yy)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   c                 &    | j                  d       y)z`
        Set the Format center_across property.

        Returns:
            Nothing.

        r   N)r   )rY   
align_types     r`   set_center_acrosszFormat.set_center_across  s     	a ra   r3   c                     || _         y)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}|| _        yd|cxk  rdk  rn n|dk  r| dz   }|| _        yt        d       y|| _        y)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  sc     x= s?H ! H""!|$9r>
 ! FG ra   rM   c                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                  |      | _        y)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ra   r7   c                 8    t        j                  |      | _        y)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                     | j                  |       | j                  |       | j                  |       | j                  |       y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	  s4     	Ueura   colorc                     | j                  |       | j                  |       | j                  |       | j                  |       y)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  s<     	e$5!E"U#ra   rB   c                     || _         yr   )rB   )rY   rB   s     r`   r   zFormat.set_bottom*  rz   ra   rC   c                 8    t        j                  |      | _        y)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                     || _         y)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                     || _         y)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                  |      | _        y)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                     || _         y)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                  |      | _        y)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ra   rK   c                     || _         y)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                  |      | _        y)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ra   rE   c                 8    t        j                  |      | _        y)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                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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   	directionc                     || _         y)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                 &    | j                  |       y)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                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                     || _         y)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                 d    d| _         | j                  d       | j                  d       || _        y)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                     || _         y)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                     || _         y)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                     || _         y)z(Deprecated: Use set_font_name() instead.Nrg   rh   s     r`   set_fontzFormat.set_font  	    "ra   c                     || _         y)z(Deprecated: Use set_font_size() instead.Nrk   rl   s     r`   set_sizezFormat.set_size  r  ra   c                 8    t        j                  |      | _        y)z)Deprecated: Use set_font_color() instead.Nrp   rr   s     r`   	set_colorzFormat.set_color  s    ++J7ra   c                 8   d}g }| j                   sH| j                  s<| j                  s0| j                  s$| j                  s| j
                  s| j                  rd}n||fS | j                  ra| j                   dk7  rR| j                   dk7  rC| j                   dk7  r4| j                  dk7  r%| j                  dk7  r| j                  dk7  rd| _         | j                  rd| _        | j                   dk(  rd| _        | j                   dk(  rd| _        | j                   dk(  rd| _        | j                   dk7  rd| _        | j                  rd| _        d}| j                   dk(  r|j                  d       | j                   d	k(  r|j                  d
       | j                   dk(  r|j                  d       | j                   dk(  r|j                  d       | j                   dk(  r|j                  d       | j                   dk(  r|j                  d|f       | j                   dk(  r|j                  d       | j                  r|j                  d       | j                  dk(  r|j                  d       | j                  d	k(  r|j                  d       | j                  dk(  r|j                  d       | j                  dk(  r|j                  d       | j                  r|j                  d| j                  f       | j                  r|j                  d| j                  f       | j                  r|j                  d       | j
                  r|j                  d       | j                  dk(  r|j                  d       | j                  d	k(  r|j                  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       {{}}~~{{!!GE>! KK!!Q&!!Q&!!Q&!!Q&!!Q&!!Q& !D >>DK!DK!DK!DK! !D;; !D'
!LL/0!LL12!LL01!LL/0!LL23!LL,
34!LL67LL/0 !LL,-!LL/0!LL01!LL45==LL.$--89;;LL(DKK01>>LL);;LL+,"LL,-"LL,-~ra   c                 ~    g }| j                   s|j                  d       | j                  r|j                  d       |S )N)r1   r   )r0   r   )r1   r  r0   )rY   
attributess     r`   _get_protection_propertiesz!Format._get_protection_propertiesl  s7    
{{m,;;m,ra   c                 R   | j                   dj                  d | j                         | j                         | j	                         | j                         | j                  | j                  | j                  | j                  | j                  f	D              | _         | j                   S )N:c              3   2   K   | ]  }t        |        y wNstr.0xs     r`   	<genexpr>z)Format._get_format_key.<locals>.<genexpr>z  s      ( A(   )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 ( &&(((*&&(++-OOKKMM%%KK
(  D ra   c                 T   dj                  d | j                  | j                  | j                  | j                  | j
                  | j                  | j                  | j                  | j                  | j                  | j                  | j                  | j                  fD              }|S )Nr"  c              3   2   K   | ]  }t        |        y wr$  r%  r'  s     r`   r*  z'Format._get_font_key.<locals>.<genexpr>  s      
 F
r+  )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j                  d | j                  | j                  | j                  | j                  | j
                  | j                  | j                  | j                  | j                  | j                  | j                  fD              }|S )Nr"  c              3   2   K   | ]  }t        |        y wr$  r%  r'  s     r`   r*  z)Format._get_border_key.<locals>.<genexpr>  s      
 F
r+  )r,  rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   r4  s     r`   r.  zFormat._get_border_key  s{    hh 
 !!  		

  
 
" 
ra   c                 x    dj                  d | j                  | j                  | j                  fD              }|S )Nr"  c              3   2   K   | ]  }t        |        y wr$  r%  r'  s     r`   r*  z'Format._get_fill_key.<locals>.<genexpr>  s     T!s1vTr+  )r,  r9   r8   r7   r4  s     r`   r/  zFormat._get_fill_key  s.    hhTdmmT]]'STT
ra   c           
          dj                  d | j                  | j                  | j                  | j                  | j
                  | j                  | j                  fD              }|S )Nr"  c              3   2   K   | ]  }t        |        y wr$  r%  r'  s     r`   r*  z,Format._get_alignment_key.<locals>.<genexpr>  s      
 F
r+  )r,  r2   r4   rM   r6   r3   rN   rP   r4  s     r`   r0  zFormat._get_alignment_key  sa     hh 
 !!!!""
 
 
ra   c                     | j                   | j                   S | j                         }|| j                  v r| j                  |   S dt        | j                        z   }|| j                  |<   || _         |S )Nr   )r   r1  r   lenrY   r]   indexs      r`   _get_xf_indexzFormat._get_xf_index  sx    ==$==  ""$$((())#.. C..//&+s#ra   c                     | j                   | j                   S | j                         }|| j                  v r| j                  |   S t        | j                        }|| j                  |<   || _         |S r$  )r   r1  r   r<  r=  s      r`   _get_dxf_indexzFormat._get_dxf_index  ss    >>%>>! ""$$)))**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   r1  r-  r.  r/  r0  r?  rA  __classcell__)r_   s   @r`   r
   r
      s/   Y v
# 
8##s #D #8sEz): 8t 8T T   #w|'< #T #- - -'74= ' ')T )T )'4 '4 '% % %    F%
F%* 
+F%P	!#t #t #!S !T !2 T   +t +t +3 t 4U3:%6 44 44U3:%6 44 4 D "$eCJ&7 $D $  T <U3:-> <4 <#ww'7 # #S  8sEz): 8t 8s 4 :5e+< : :3 t 6uS%Z'8 6T 68sEz): 8t 8'3 't ')T )T )!T !T !2!T !T !!T !T !% % %!S !T !#s #t #1S 1T 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^@	 (.*$(ra   r
   N)typingr   r   warningsr   xlsxwriter.colorr    r   	XMLwriterr
    ra   r`   <module>rN     s'    "  " aY   ara   