
    h@                     Z    S SK Jr  S SKJr   " S S\R                  5      r " S S5      rg)   )	xmlwriter)_preserve_whitespacec                   D   ^  \ rS rSrSrU 4S jrS rS rS rS r	Sr
U =r$ )	SharedStrings   z9
A class for writing the Excel XLSX sharedStrings file.

c                 0   > [         TU ]  5         SU l        g)z
Constructor.

N)super__init__string_table)self	__class__s    kC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\xlsxwriter/sharedstrings.pyr
   SharedStrings.__init__   s     	     c                     U R                  5         U R                  5         U R                  5         U R                  S5        U R	                  5         g )Nsst)_xml_declaration
_write_sst_write_sst_strings_xml_end_tag
_xml_closer   s    r   _assemble_xml_file SharedStrings._assemble_xml_file+   sF     	 	 	! 	%  	r   c                     SnSU4SU R                   R                  4SU R                   R                  4/nU R                  SU5        g )Nz9http://schemas.openxmlformats.org/spreadsheetml/2006/mainxmlnscountuniqueCountr   )r   r   unique_count_xml_start_tag)r   r   
attributess      r   r   SharedStrings._write_sstC   sR    K ed''--.D--::;

 	E:.r   c                 `    U R                   R                   H  nU R                  U5        M     g )N)r   string_array	_write_si)r   strings     r   r    SharedStrings._write_sst_stringsO   s&     ''44FNN6" 5r   c                 
   / nU R                  U5      n[        U5      (       a  UR                  S5        UR                  S5      (       a(  UR	                  S5      (       a  U R                  U5        g U R                  X5        g )N)z	xml:spacepreservez<r>z</r>)_escape_control_charactersr   append
startswithendswith_xml_rich_si_element_xml_si_element)r   r&   r!   s      r   r%   SharedStrings._write_siU   sr    
 008  ''78 U##(?(?%%f-  4r   )r   )__name__
__module____qualname____firstlineno____doc__r
   r   r   r   r%   __static_attributes____classcell__)r   s   @r   r   r      s&    ! 0
/#5 5r   r   c                   0    \ rS rSrSrS rS rS rS rSr	g)	SharedStringTableh   z<
A class to track Excel shared strings between worksheets.

c                 <    SU l         SU l        0 U l        / U l        g )N    )r   r   r   r$   r   s    r   r
   SharedStringTable.__init__n   s!    
r   c                     XR                   ;  aF  U R                  nX R                   U'   U =R                  S-  sl        U =R                  S-  sl        U$ U R                   U   nU =R                  S-  sl        U$ )z9" Get the index of the string in the Shared String table.r   )r   r   r   )r   r&   indexs      r   _get_shared_string_index*SharedStringTable._get_shared_string_indext   sn    ***%%E(-f%JJ!OJ"L !!&)

a
r   c                      U R                   U   $ )z%" Get a shared string from the index.)r$   )r   r?   s     r   _get_shared_string$SharedStringTable._get_shared_string   s      ''r   c                 l    [        U R                  U R                  R                  S9U l        0 U l        g)z<" Sort the shared string data and convert from dict to list.)keyN)sortedr   __getitem__r$   r   s    r   _sort_string_data#SharedStringTable._sort_string_data   s+    "4#4#4$:K:K:W:WXr   )r   r$   r   r   N)
r1   r2   r3   r4   r5   r
   r@   rC   rI   r6    r   r   r9   r9   h   s    
(r   r9   N) r   utilityr   	XMLwriterr   r9   rK   r   r   <module>rO      s,     )U5I'' U5r" "r   