o
    ^Å÷gï  ã                   @   s"   d dl mZ G dd„ dejƒZdS )é   )Ú	xmlwriterc                       sh   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Z‡  ZS )ÚCustomzM
    A class for writing the Excel XLSX Custom Workbook Property file.


    c                    s   t ƒ  ¡  g | _d| _dS )z
        Constructor.

        r   N)ÚsuperÚ__init__Ú
propertiesÚpid©Úself©Ú	__class__© úk/var/www/eduai.edurigo.com/doc_train/edurigo_ai/Puru/venv/lib/python3.10/site-packages/xlsxwriter/custom.pyr      s   

zCustom.__init__c                 C   s
   || _ d S )N)r   )r	   r   r   r   r   Ú_set_properties&   s   
zCustom._set_propertiesc                 C   s&   |   ¡  |  ¡  |  d¡ |  ¡  d S )NÚ
Properties)Ú_xml_declarationÚ_write_propertiesÚ_xml_end_tagÚ
_xml_closer   r   r   r   Ú_assemble_xml_file0   s   
zCustom._assemble_xml_filec                 C   sJ   d}|d }|d }d|fd|fg}|   d|¡ | jD ]}|  |¡ q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_propertyr   r   r   r   C   s   þ
þzCustom._write_propertiesc                 C   s¨   d}|\}}}|  j d7  _ d|fd| j fd|fg}|  d|¡ |dkr*|  |¡ n#|dkr4|  |¡ n|d	kr>|  |¡ n|d
krH|  |¡ 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   r   r   r   r   T   s$   
ý
zCustom._write_propertyc                 C   ó   |   d|¡ d S )Nz	vt:lpwstr©Ú_xml_data_element©r	   r)   r   r   r   r(   v   ó   zCustom._write_vt_lpwstrc                 C   r+   )Nzvt:filetimer,   r.   r   r   r   r&   z   r/   zCustom._write_vt_filetimec                 C   r+   )Nzvt:i4r,   r.   r   r   r   r$   ~   r/   zCustom._write_vt_i4c                 C   r+   )Nzvt:r8r,   r.   r   r   r   r%   ‚   r/   zCustom._write_vt_r8c                 C   s   |rd}nd}|   d|¡ d S )NÚtrueÚfalsezvt:boolr,   r.   r   r   r   r'   †   s   zCustom._write_vt_bool)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r(   r&   r$   r%   r'   Ú__classcell__r   r   r
   r   r      s    
"r   N)Ú r   Ú	XMLwriterr   r   r   r   r   Ú<module>   s   
