
    	iQ                     H    d dl mZmZ ddlmZ  G d dej                  ZdS )    )ListTuple   )	xmlwriterc                        e Zd ZdZd fdZdeeeeef                  ddfdZddZ	ddZ
d	eeeef         ddfd
ZdeddfdZdeddfdZdeddfdZdeddfdZdeddfdZ xZS )CustomzM
    A class for writing the Excel XLSX Custom Workbook Property file.


    returnNc                 d    t                                                       g | _        d| _        dS )z
        Constructor.

        r   N)super__init__
propertiespid)self	__class__s    I/srv/django_bis/venv311/lib/python3.11/site-packages/xlsxwriter/custom.pyr   zCustom.__init__   s-     	    r   c                     || _         d S )N)r   )r   r   s     r   _set_propertieszCustom._set_properties(   s    $r   c                     |                                   |                                  |                     d           |                                  d S )N
Properties)_xml_declaration_write_properties_xml_end_tag
_xml_close)r   s    r   _assemble_xml_filezCustom._assemble_xml_file2   sT     	   ,''' 	r   c                     d}|dz   }|dz   }d|fd|fg}|                      d|           | j        D ]}|                     |           d S )Nz6http://schemas.openxmlformats.org/officeDocument/2006/zcustom-propertiesdocPropsVTypesxmlnszxmlns:vtr   )_xml_start_tagr   _write_property)r   schemar   xmlns_vt
attributescustom_propertys         r   r   zCustom._write_propertiesE   s    I,,,, e"


 	L*555# 	2 	2O  1111	2 	2r   r$   c                    d}|\  }}}| xj         dz  c_         d|fd| j         fd|fg}|                     d|           |dk    r|                     |           ni|dk    r|                     |           nM|d	k    r|                     |           n1|d
k    r|                     |           n|                     |           |                     d           d S )Nz&{D5CDD505-2E9C-101B-9397-08002B2CF9AE}r   fmtidr   nameproperty
number_intnumberdatebool)r   r   _write_vt_i4_write_vt_r8_write_vt_filetime_write_vt_bool_write_vt_lpwstrr   )r   r$   r&   r'   valueproperty_typer#   s          r   r    zCustom._write_propertyV   s    9%4"e]A eDHTN

 	J
333L((e$$$$h&&e$$$$f$$##E****f$$&&&& !!%(((*%%%%%r   r2   c                 2    |                      d|           d S )Nz	vt:lpwstr_xml_data_elementr   r2   s     r   r1   zCustom._write_vt_lpwstrx   s    {E22222r   c                 2    |                      d|           d S )Nzvt:filetimer5   r7   s     r   r/   zCustom._write_vt_filetime|   s    }e44444r   c                 2    |                      d|           d S )Nzvt:i4r5   r7   s     r   r-   zCustom._write_vt_i4       w.....r   c                 2    |                      d|           d S )Nzvt:r8r5   r7   s     r   r.   zCustom._write_vt_r8   r:   r   c                 2    |                      d|           d S )Nzvt:boolr5   r7   s     r   r0   zCustom._write_vt_bool   s    y%00000r   )r	   N)__name__
__module____qualname____doc__r   r   r   strr   r   r   r    r1   r/   r-   r.   r0   __classcell__)r   s   @r   r   r      sy        	 	 	 	 	 	%$uS#s]/C*D % % % % %   &2 2 2 2" &uS#s]/C  &  &  &  &  &D3c 3d 3 3 3 35 5 5 5 5 5/# /$ / / / //# /$ / / / /1C 1D 1 1 1 1 1 1 1 1r   r   N)typingr   r    r   	XMLwriterr    r   r   <module>rG      sr                 z1 z1 z1 z1 z1Y  z1 z1 z1 z1 z1r   