U
    ª…7hév  ã                   @   s.   d dl mZ ddlmZ G dd„ dejƒZdS )é    )Úwarné   )Ú	xmlwriterc                       sŽ  e Zd ZdZd•‡ fdd„	Zdd„ Zd–dd	„Zd
d„ Zd—dd„Zd˜dd„Z	d™dd„Z
dšdd„Zd›dd„Zdœdd„Zddd„Zdd„ Zdždd„ZdŸd d!„Zd"d#„ Zd d$d%„Zd¡d&d'„Zd(d)„ Zd¢d*d+„Zd£d,d-„Zd¤d.d/„Zd¥d0d1„Zd2d3„ Zd4d5„ Zd¦d6d7„Zd8d9„ Zd§d:d;„Zd<d=„ Zd¨d>d?„Z d©d@dA„Z!dBdC„ Z"dªdDdE„Z#dFdG„ Z$d«dHdI„Z%dJdK„ Z&dLdM„ Z'd¬dNdO„Z(d­dPdQ„Z)d®dRdS„Z*d¯dTdU„Z+d°dVdW„Z,dXdY„ Z-dZd[„ Z.d\d]„ Z/d^d_„ Z0d`da„ Z1dbdc„ Z2d±dedf„Z3dgdh„ Z4didj„ Z5dkdl„ Z6dmdn„ Z7dodp„ Z8dqdr„ Z9dsdt„ Z:d²dudv„Z;dwdx„ Z<d³dydz„Z=d{d|„ Z>d}d~„ Z?dd€„ Z@dd‚„ ZAdƒd„„ ZBd…d†„ ZCd‡dˆ„ ZDd‰dŠ„ ZEd‹dŒ„ ZFddŽ„ ZGdd„ ZHd‘d’„ ZId“d”„ ZJ‡  ZKS )´ÚFormatz;
    A class for writing the Excel XLSX Format file.


    Nc                    sÌ  |dkr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| _0d| _1d| _2d| _3d| _4d| _5d| _6d| _7d| _8d| _9d| _:d| _;d| _<d| _=d| _>d| _?d| _@d| _Ad| _B| C¡ D ]\}}tD| d
| ƒ|ƒ q¤d| _EdS )z
        Constructor.

        NZGeneralr   FZCalibrié   é   Úminorr   Úset_)FÚsuperÚ__init__Úxf_format_indicesÚdxf_format_indicesÚxf_indexÚ	dxf_indexÚ
num_formatÚnum_format_indexÚ
font_indexÚhas_fontZ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_fillZhas_dxf_fillZ
fill_indexZ
fill_countZborder_indexZ
has_borderZhas_dxf_borderZborder_countÚbottomÚbottom_colorÚdiag_borderÚ
diag_colorÚ	diag_typeÚleftÚ
left_colorÚrightÚright_colorÚtopÚ	top_colorÚindentÚshrinkZmerge_rangeÚreading_orderÚjust_distribÚcolor_indexedÚ	font_onlyÚquote_prefixÚcheckboxÚitemsÚgetattrÚ_format_key)ÚselfÚ
propertiesZ
xf_indicesZdxf_indicesÚkeyÚvalue©Ú	__class__© úK/var/www/formularioweb/env/lib/python3.8/site-packages/xlsxwriter/format.pyr      sŽ    
zFormat.__init__c                 C   s
   || _ 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   ©rG   r   rM   rM   rN   Úset_font_name~   s    zFormat.set_font_namer   c                 C   s
   || _ 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   ©rG   r   rM   rM   rN   Úset_font_sizeŒ   s    zFormat.set_font_sizec                 C   s   |   |¡| _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©Ú
_get_colorr   ©rG   r   rM   rM   rN   Úset_font_color™   s    zFormat.set_font_colorTc                 C   s
   || _ dS )zœ
        Set the Format bold property.

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

        Returns:
            Nothing.

        N)r   )rG   r   rM   rM   rN   Úset_bold¦   s    zFormat.set_boldc                 C   s
   || _ dS )z 
        Set the Format italic property.

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

        Returns:
            Nothing.

        N)r   )rG   r   rM   rM   rN   Ú
set_italic³   s    zFormat.set_italicr   c                 C   s
   || _ dS )z¢
        Set the Format underline property.

        Args:
            underline: Default is 1, single underline.

        Returns:
            Nothing.

        N)r   )rG   r   rM   rM   rN   Úset_underlineÀ   s    zFormat.set_underlinec                 C   s
   || _ dS )z°
        Set the Format font_strikeout property.

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

        Returns:
            Nothing.

        N)r   )rG   r   rM   rM   rN   Úset_font_strikeoutÍ   s    zFormat.set_font_strikeoutc                 C   s
   || _ dS )z¡
        Set the Format font_script property.

        Args:
            font_script: Default is 1, superscript.

        Returns:
            Nothing.

        N)r   )rG   r   rM   rM   rN   Úset_font_scriptÚ   s    zFormat.set_font_scriptc                 C   s
   || _ dS )z¬
        Set the Format font_outline property.

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

        Returns:
            Nothing.

        N)r   )rG   r   rM   rM   rN   Úset_font_outlineç   s    zFormat.set_font_outlinec                 C   s
   || _ dS )zª
        Set the Format font_shadow property.

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

        Returns:
            Nothing.

        N)r   )rG   r   rM   rM   rN   Úset_font_shadowô   s    zFormat.set_font_shadowc                 C   s
   || _ 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   )rG   r   rM   rM   rN   Úset_num_format  s    zFormat.set_num_formatc                 C   s
   || _ dS )z 
        Set the Format locked property.

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

        Returns:
            Nothing.

        N)r'   )rG   r'   rM   rM   rN   Ú
set_locked  s    zFormat.set_lockedc                 C   s
   || _ dS )z 
        Set the Format hidden property.

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

        Returns:
            Nothing.

        N)r&   )rG   r&   rM   rM   rN   Ú
set_hidden  s    zFormat.set_hiddenc                 C   sB  |  ¡ }|dkr|  d¡ |dkr,|  d¡ |dkr>|  d¡ |dkrP|  d¡ |dkrb|  d	¡ |d
krt|  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 )z¨
        Set the Format cell alignment.

        Args:
            alignment: String representing alignment. No default.

        Returns:
            Nothing.
        r6   r   Zcentrer   Úcenterr8   é   Úfillé   Újustifyé   Zcenter_acrossé   Zcentre_acrossÚdistributedé   Zjustify_distributedr:   ZvcentreZvcenterr1   ZvjustifyZvdistributedN)ÚlowerÚset_text_h_alignr?   Úset_text_v_align)rG   Z	alignmentrM   rM   rN   Ú	set_align(  sF    



















zFormat.set_alignc                 C   s   |   d¡ dS )z`
        Set the Format center_across property.

        Returns:
            Nothing.

        ri   N)rm   )rG   Z
align_typerM   rM   rN   Úset_center_across[  s    	zFormat.set_center_acrossc                 C   s
   || _ dS )z¦
        Set the Format text_wrap property.

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

        Returns:
            Nothing.

        N)r)   )rG   r)   rM   rM   rN   Úset_text_wrapf  s    zFormat.set_text_wrapc                 C   sX   t |ƒ}|dkrd}n8d|  kr*dkrBn n|dk rN| d }ntdƒ dS || _dS )zœ
        Set the Format rotation property.

        Args:
            rotation: Rotation angle. No default.

        Returns:
            Nothing.

        i  éÿ   i¦ÿÿÿéZ   r   z3Rotation rotation outside range: -90 <= angle <= 90N)Úintr   r,   )rG   r,   rM   rM   rN   Úset_rotations  s    zFormat.set_rotationc                 C   s
   || _ dS )z£
        Set the Format indent property.

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

        Returns:
            Nothing.

        N)r<   )rG   r<   rM   rM   rN   Ú
set_indentŒ  s    zFormat.set_indentc                 C   s
   || _ dS )z 
        Set the Format shrink property.

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

        Returns:
            Nothing.

        N)r=   )rG   r=   rM   rM   rN   Ú
set_shrink™  s    zFormat.set_shrinkc                 C   s
   || _ dS )z®
        Set the Format text_justlast property.

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

        Returns:
            Nothing.

        N)r+   )rG   r+   rM   rM   rN   Úset_text_justlast¦  s    zFormat.set_text_justlastc                 C   s
   || _ dS )z˜
        Set the Format pattern property.

        Args:
            pattern: Default is 1, solid fill.

        Returns:
            Nothing.

        N)r/   )rG   r/   rM   rM   rN   Úset_pattern³  s    zFormat.set_patternc                 C   s   |   |¡| _dS )zž
        Set the Format bg_color property.

        Args:
            bg_color: Background color. No default.

        Returns:
            Nothing.

        N)rV   r.   )rG   r.   rM   rM   rN   Úset_bg_colorÀ  s    zFormat.set_bg_colorc                 C   s   |   |¡| _dS )zž
        Set the Format fg_color property.

        Args:
            fg_color: Foreground color. No default.

        Returns:
            Nothing.

        N)rV   r-   )rG   r-   rM   rM   rN   Úset_fg_colorÍ  s    zFormat.set_fg_colorc                 C   s,   |   |¡ |  |¡ |  |¡ |  |¡ 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)rG   ÚstylerM   rM   rN   Ú
set_borderÛ  s    


zFormat.set_borderc                 C   s,   |   |¡ |  |¡ |  |¡ |  |¡ 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)rG   ÚcolorrM   rM   rN   Úset_border_colorì  s    


zFormat.set_border_colorc                 C   s
   || _ dS r|   )r1   )rG   r1   rM   rM   rN   r}   ü  s    zFormat.set_bottomc                 C   s   |   |¡| _dS )z¢
        Set the Format bottom_color property.

        Args:
            bottom_color: Color string. No default.

        Returns:
            Nothing.

        N)rV   r2   )rG   r2   rM   rM   rN   rƒ   	  s    zFormat.set_bottom_colorc                 C   s
   || _ dS )zŸ
        Set the Format diag_type property.

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

        Returns:
            Nothing.

        N)r5   )rG   r5   rM   rM   rN   Úset_diag_type  s    zFormat.set_diag_typec                 C   s
   || _ dS )z•
        Set the Format left property.

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

        Returns:
            Nothing.

        N)r6   )rG   r6   rM   rM   rN   r   #  s    zFormat.set_leftc                 C   s   |   |¡| _dS )zž
        Set the Format left_color property.

        Args:
            left_color: Color string. No default.

        Returns:
            Nothing.

        N)rV   r7   )rG   r7   rM   rM   rN   r…   0  s    zFormat.set_left_colorc                 C   s
   || _ dS )z—
        Set the Format right property.

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

        Returns:
            Nothing.

        N)r8   )rG   r8   rM   rM   rN   r€   =  s    zFormat.set_rightc                 C   s   |   |¡| _dS )z 
        Set the Format right_color property.

        Args:
            right_color: Color string. No default.

        Returns:
            Nothing.

        N)rV   r9   )rG   r9   rM   rM   rN   r†   J  s    zFormat.set_right_colorc                 C   s
   || _ dS )z“
        Set the Format top property.

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

        Returns:
            Nothing.

        N)r:   )rG   r:   rM   rM   rN   r~   W  s    zFormat.set_topc                 C   s   |   |¡| _dS )zœ
        Set the Format top_color property.

        Args:
            top_color: Color string. No default.

        Returns:
            Nothing.

        N)rV   r;   )rG   r;   rM   rM   rN   r„   d  s    zFormat.set_top_colorc                 C   s   |   |¡| _dS )zž
        Set the Format diag_color property.

        Args:
            diag_color: Color string. No default.

        Returns:
            Nothing.

        N)rV   r4   )rG   r4   rM   rM   rN   Úset_diag_colorq  s    zFormat.set_diag_colorc                 C   s
   || _ dS )z£
        Set the Format diag_border property.

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

        Returns:
            Nothing.

        N)r3   )rG   r3   rM   rM   rN   Úset_diag_border~  s    zFormat.set_diag_borderc                 C   s
   || _ dS )z¬
        Set the Format quote prefix property.

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

        Returns:
            Nothing.

        N)rB   )rG   rB   rM   rM   rN   Úset_quote_prefix‹  s    zFormat.set_quote_prefixc                 C   s
   || _ 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)rC   )rG   rC   rM   rM   rN   Úset_checkbox˜  s    zFormat.set_checkboxc                 C   s
   || _ 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   )rG   r   rM   rM   rN   Úset_has_font±  s    zFormat.set_has_fontc                 C   s
   || _ 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)r0   )rG   r0   rM   rM   rN   Úset_has_fill¾  s    zFormat.set_has_fillc                 C   s
   || _ dS )z›
        Set the unique font index property.

        Args:
            font_index: The unique font index.

        Returns:
            Nothing.

        N)r   )rG   r   rM   rM   rN   Úset_font_indexË  s    zFormat.set_font_indexc                 C   s
   || _ dS )z£
        Set the unique format index property.

        Args:
            xf_index: The unique Excel format index.

        Returns:
            Nothing.

        N)r   )rG   r   rM   rM   rN   Úset_xf_indexØ  s    zFormat.set_xf_indexc                 C   s
   || _ dS )z¼
        Set the unique conditional format index property.

        Args:
            dxf_index: The unique Excel conditional format index.

        Returns:
            Nothing.

        N)r   )rG   r   rM   rM   rN   Úset_dxf_indexå  s    zFormat.set_dxf_indexc                 C   s
   || _ dS )z¬
        Set the number format_index property.

        Args:
            num_format_index: The unique number format index.

        Returns:
            Nothing.

        N)r   )rG   r   rM   rM   rN   Úset_num_format_indexò  s    zFormat.set_num_format_indexc                 C   s
   || _ dS )z©
        Set the horizontal text alignment property.

        Args:
            text_h_align: Horizontal text alignment.

        Returns:
            Nothing.

        N)r(   )rG   r(   rM   rM   rN   rm   ÿ  s    zFormat.set_text_h_alignc                 C   s
   || _ dS )z¥
        Set the vertical text alignment property.

        Args:
            text_h_align: Vertical text alignment.

        Returns:
            Nothing.

        N)r*   )rG   r*   rM   rM   rN   rn     s    zFormat.set_text_v_alignr   c                 C   s
   || _ dS )zœ
        Set the reading order property.

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

        Returns:
            Nothing.

        N)r>   )rG   Ú	directionrM   rM   rN   Úset_reading_order  s    zFormat.set_reading_orderc                 C   s   |   |¡ 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)ro   )rG   ÚalignrM   rM   rN   Ú
set_valign'  s    zFormat.set_valignc                 C   s
   || _ dS )z“
        Set the font family property.

        Args:
            font_family: Font family number.

        Returns:
            Nothing.

        N)r   )rG   r   rM   rM   rN   Úset_font_family:  s    zFormat.set_font_familyc                 C   s
   || _ dS )z¦
        Set the font character set property.

        Args:
            font_charset: The font character set number.

        Returns:
            Nothing.

        N)r   )rG   r   rM   rM   rN   Úset_font_charsetG  s    zFormat.set_font_charsetc                 C   s
   || _ dS )z
        Set the font scheme property.

        Args:
            font_scheme: The font scheme.

        Returns:
            Nothing.

        N)r    )rG   r    rM   rM   rN   Úset_font_schemeT  s    zFormat.set_font_schemec                 C   s
   || _ dS )zŸ
        Set the font condense property.

        Args:
            font_condense: The font condense property.

        Returns:
            Nothing.

        N)r!   )rG   r!   rM   rM   rN   Úset_font_condensea  s    zFormat.set_font_condensec                 C   s
   || _ dS )z™
        Set the font extend property.

        Args:
            font_extend: The font extend property.

        Returns:
            Nothing.

        N)r"   )rG   r"   rM   rM   rN   Úset_font_extendn  s    zFormat.set_font_extendc                 C   s
   || _ dS )z
        Set the theme property.

        Args:
            theme: Format theme.

        Returns:
            Nothing.

        N)r#   )rG   r#   rM   rM   rN   Ú	set_theme{  s    zFormat.set_themec                 C   s$   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$   )rG   r$   rM   rM   rN   Úset_hyperlinkˆ  s    

zFormat.set_hyperlinkc                 C   s
   || _ 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)r@   )rG   Zcolor_indexrM   rM   rN   Úset_color_indexed˜  s    zFormat.set_color_indexedc                 C   s
   || _ 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)rA   )rG   rA   rM   rM   rN   Úset_font_only¦  s    zFormat.set_font_onlyc                 C   s
   || _ dS )z(Deprecated: Use set_font_name() instead.NrO   rP   rM   rM   rN   Úset_font·  s    zFormat.set_fontc                 C   s
   || _ dS )z(Deprecated: Use set_font_size() instead.NrR   rS   rM   rM   rN   Úset_size»  s    zFormat.set_sizec                 C   s   |   |¡| _dS )z)Deprecated: Use set_font_color() instead.NrU   rW   rM   rM   rN   Ú	set_color¿  s    zFormat.set_colorc                 C   sr  d}g }| j s2| js2| js2| js2| js2| js2| jr8d}n||fS | jrˆ| j dkrˆ| j dkrˆ| 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rP| d¡ | j dkrj| 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rT| d¡ | jd	krj| d¡ ||fS )Nr   r   rd   rk   rh   rf   ZcenterContinuous)Ú
horizontalr6   r   )r¥   rc   )r¥   r8   )r¥   re   )r¥   rg   ri   r¥   )r¥   rj   )ZjustifyLastLiner   )Úverticalr:   )r¦   rc   )r¦   rg   )r¦   rj   ZtextRotationr<   )ZwrapTextr   )ZshrinkToFitr   )ÚreadingOrderr   )r§   r   )	r(   r*   r<   r,   r)   r=   r>   r?   Úappend)rG   Úchangedr–   Z
continuousrM   rM   rN   Ú_get_align_propertiesÉ  s¦    ÿþýüûúù	ÿþýüûúù	



















zFormat._get_align_propertiesc                 C   s(   g }| j s| d¡ | jr$| d¡ |S )N)r'   r   )r&   r   )r'   r¨   r&   )rG   Ú
attributesrM   rM   rN   Ú_get_protection_properties)  s    

z!Format._get_protection_propertiesc                 C   sR   | j d krLd dd„ |  ¡ |  ¡ |  ¡ |  ¡ | j| j| j| j	| j
f	D ƒ¡| _ | j S )Nú:c                 s   s   | ]}t |ƒV  qd S ©N©Ústr©Ú.0ÚxrM   rM   rN   Ú	<genexpr>7  s   ÿz)Format._get_format_key.<locals>.<genexpr>)rF   ÚjoinÚ_get_font_keyÚ_get_border_keyÚ_get_fill_keyÚ_get_alignment_keyr   r'   rC   rB   r&   )rG   rM   rM   rN   Ú_get_format_key4  s    

÷þ
zFormat._get_format_keyc                 C   sL   d  dd„ | j| j| j| j| j| j| j| j| j	| j
| j| j| jfD ƒ¡}|S )Nr­   c                 s   s   | ]}t |ƒV  qd S r®   r¯   r±   rM   rM   rN   r´   J  s   ÿz'Format._get_font_key.<locals>.<genexpr>)rµ   r   r   r   r   r   r   r   r   r   r   r   r   r#   ©rG   rI   rM   rM   rN   r¶   H  s"    
óþzFormat._get_font_keyc                 C   sD   d  dd„ | j| j| j| j| j| j| j| j| j	| j
| jfD ƒ¡}|S )Nr­   c                 s   s   | ]}t |ƒV  qd S r®   r¯   r±   rM   rM   rN   r´   a  s   ÿz)Format._get_border_key.<locals>.<genexpr>)rµ   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r»   rM   rM   rN   r·   _  s    
õþzFormat._get_border_keyc                 C   s$   d  dd„ | j| j| jfD ƒ¡}|S )Nr­   c                 s   s   | ]}t |ƒV  qd S r®   r¯   r±   rM   rM   rN   r´   v  s     z'Format._get_fill_key.<locals>.<genexpr>)rµ   r/   r.   r-   r»   rM   rM   rN   r¸   t  s     zFormat._get_fill_keyc              
   C   s4   d  dd„ | j| j| j| j| j| j| jfD ƒ¡}|S )Nr­   c                 s   s   | ]}t |ƒV  qd S r®   r¯   r±   rM   rM   rN   r´   }  s   ÿz,Format._get_alignment_key.<locals>.<genexpr>)rµ   r(   r*   r<   r,   r)   r=   r>   r»   rM   rM   rN   r¹   z  s    
ùþzFormat._get_alignment_keyc                 C   sN   | j d k	r| j S |  ¡ }|| jkr,| j| S dt| jƒ }|| j|< || _ |S )Nr   )r   rº   r   Úlen©rG   rI   ÚindexrM   rM   rN   Ú_get_xf_indexŒ  s    



zFormat._get_xf_indexc                 C   sJ   | j d k	r| j S |  ¡ }|| jkr,| j| S t| jƒ}|| j|< || _ |S r®   )r   rº   r   r¼   r½   rM   rM   rN   Ú_get_dxf_index   s    




zFormat._get_dxf_indexc                 C   s4   ddddddddd	d
ddddddddœ}|  ||¡S )Nz#000000z#0000FFz#800000z#00FFFFz#808080z#008000z#00FF00z#FF00FFz#000080z#FF6600z#800080z#FF0000z#C0C0C0z#FFFFFFz#FFFF00Z	Automatic)ÚblackÚblueZbrownÚcyanÚgrayÚgreenZlimeÚmagentaZnavyZorangeZpinkÚpurpleÚredÚsilverÚwhiteÚyellowZ	automatic)Úget)rG   r‡   Znamed_colorsrM   rM   rN   rV   ³  s&    ïzFormat._get_color)NNN)r   )T)T)r   )T)r   )T)T)T)T)N)T)r   )T)T)r   )r   )r   )r   )r   )r   )r   )r   )T)T)T)T)r   )T)T)LÚ__name__Ú
__module__Ú__qualname__Ú__doc__r   rQ   rT   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   ro   rp   rq   ru   rv   rw   rx   ry   rz   r{   r‚   rˆ   r}   rƒ   r‰   r   r…   r€   r†   r~   r„   rŠ   r‹   rŒ   r   rŽ   r   r   r‘   r’   r“   rm   rn   r•   r—   r˜   r™   rš   r›   rœ   r   rŸ   r    r¡   r¢   r£   r¤   rª   r¬   rº   r¶   r·   r¸   r¹   r¿   rÀ   rV   Ú__classcell__rM   rM   rK   rN   r      s   a









3




















`r   N)Úwarningsr   Ú r   Z	XMLwriterr   rM   rM   rM   rN   Ú<module>   s   