U
    7h                     @   s2   d dl mZmZ ddlmZ G dd dejZdS )    )ListTuple   )	xmlwriterc                       s   e Zd ZdZ fddZeeeeef  dddZdd Z	d	d
 Z
eeeef dddZedddZedddZedddZedddZed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/formularioweb/env/lib/python3.8/site-packages/xlsxwriter/custom.pyr      s    
zCustom.__init__r	   c                 C   s
   || _ d S )Nr   )r   r	   r   r   r   _set_properties(   s    zCustom._set_propertiesc                 C   s&   |    |   | d |   d S )N
Properties)Z_xml_declaration_write_properties_xml_end_tagZ
_xml_closer   r   r   r   _assemble_xml_file2   s    
zCustom._assemble_xml_filec                 C   sJ   d}|d }|d }d|fd|fg}|  d| | jD ]}| | q6d S )Nz6http://schemas.openxmlformats.org/officeDocument/2006/zcustom-propertiesZdocPropsVTypesxmlnszxmlns:vtr   )_xml_start_tagr	   _write_property)r   Zschemar   Zxmlns_vt
attributescustom_propertyr   r   r   r   E   s    
zCustom._write_properties)r   c                 C   s   d}|\}}}|  j d7  _ d|fd| j fd|fg}| d| |dkrT| | nF|dkrh| | n2|d	kr|| | n|d
kr| | n
| | | d d S )Nz&{D5CDD505-2E9C-101B-9397-08002B2CF9AE}r   fmtidr
   namepropertyZ
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   valueZproperty_typer   r   r   r   r   V   s$    

zCustom._write_property)r'   c                 C   s   |  d| d S )Nz	vt:lpwstrZ_xml_data_elementr   r'   r   r   r   r&   x   s    zCustom._write_vt_lpwstrc                 C   s   |  d| d S )Nzvt:filetimer(   r)   r   r   r   r$   |   s    zCustom._write_vt_filetimec                 C   s   |  d| d S )Nzvt:i4r(   r)   r   r   r   r"      s    zCustom._write_vt_i4c                 C   s   |  d| d S )Nzvt:r8r(   r)   r   r   r   r#      s    zCustom._write_vt_r8c                 C   s   |  d| d S )Nzvt:boolr(   r)   r   r   r   r%      s    zCustom._write_vt_bool)__name__
__module____qualname____doc__r   r   r   strr   r   r   r   r&   r$   r"   r#   r%   __classcell__r   r   r   r   r      s   
"r   N)typingr   r    r   Z	XMLwriterr   r   r   r   r   <module>   s   