U
    ‰dP\  ã                   @   s@   d dl mZ d dl mZ d dlmZmZmZ G dd„ deƒZdS )é   )ÚBIFFRecords)ÚStyle)Úunicode_typeÚ	int_typesÚ
basestringc                   @   s²  e Zd ZdZd¼dd„Zdd„ Zdd	„ Zd
d„ ZeeeƒZ	dd„ Z
dd„ Zeee
ƒZdd„ Zdd„ ZeeeƒZdd„ Zdd„ ZeeeƒZdd„ Zdd„ ZeeeƒZdd„ Zdd„ ZeeeƒZd d!„ Zd"d#„ ZeeeƒZd$d%„ Zd&d'„ ZeeeƒZd(d)„ Zd*d+„ Z ee eƒZ!d,d-„ Z"d.d/„ Z#ee#e"ƒZ$d0d1„ Z%d2d3„ Z&ee&e%ƒZ'd4d5„ Z(d6d7„ Z)ee)e(ƒZ*d8d9„ Z+d:d;„ Z,ee,e+ƒZ-d<d=„ Z.d>d?„ Z/ee/e.ƒZ0d@dA„ Z1dBdC„ Z2ee2e1ƒZ3dDdE„ Z4dFdG„ Z5ee5e4ƒZ6dHdI„ Z7dJdK„ Z8ee8e7ƒZ9dLdM„ Z:dNdO„ Z;ee;e:ƒZ<dPdQ„ Z=dRdS„ Z>ee>e=ƒZ?dTdU„ Z@ee@ƒZAdVdW„ ZBdXdY„ ZCdZd[„ ZDd\d]„ ZEd^d_„ ZFd`da„ ZGdbdc„ ZHddde„ ZId½dgdh„ZJdidj„ ZKdkdl„ ZLdmdn„ ZMdodp„ ZNdqdr„ ZOdsdt„ ZPdudv„ ZQdwdx„ ZRdydz„ ZSd{d|„ ZTd}d~„ ZUdd€„ ZVdd‚„ ZWdƒd„„ ZXd…d†„ ZYd‡dˆ„ ZZd‰dŠ„ Z[d‹dŒ„ Z\ddŽ„ Z]dd„ Z^d‘d’„ Z_d“d”„ Z`d•d–„ Zad—d˜„ Zbd™dš„ Zcd›dœ„ Zdddž„ ZedŸd „ Zfd¡d¢„ Zgd£d¤„ Zhd¥d¦„ Zid§d¨„ Zjd©dª„ Zkd«d¬„ Zld­d®„ Zmd¯d°„ Znd±d²„ Zod³d´„ Zpdµd¶„ Zqd·d¸„ Zrd¹dº„ Zsd»S )¾ÚWorkbookz¶
    This is a class representing a workbook and all its contents. When creating
    Excel files with xlwt, you will normally start by instantiating an
    object of this class.
    Úasciié    c                 C   sÞ   || _ d| _d | _d| _d| _d| _d| _d| _d| _d| _	d| _
d | _d| _d| _d| _d| _d| _d| _d| _d| _d| _t |¡| _d| _d| _t | j ¡| _g | _i | _i | _i | _ i | _!d | _"d | _#d | _$d | _%d S )	NÚNoner	   ià  éZ   iÏ?  iN*  r   iX  )&ÚencodingÚ_Workbook__ownerÚ_Workbook__country_codeÚ_Workbook__wnd_protectÚ_Workbook__obj_protectÚ_Workbook__protectÚ_Workbook__backup_on_saveÚ_Workbook__hpos_twipsÚ_Workbook__vpos_twipsÚ_Workbook__width_twipsÚ_Workbook__height_twipsÚ_Workbook__custom_palette_b8Ú_Workbook__active_sheetÚ_Workbook__first_tab_indexÚ_Workbook__selected_tabsÚ_Workbook__tab_width_twipsÚ_Workbook__wnd_hiddenÚ_Workbook__wnd_miniÚ_Workbook__hscroll_visibleÚ_Workbook__vscroll_visibleÚ_Workbook__tabs_visibler   ZStyleCollectionÚ_Workbook__stylesÚ_Workbook__dates_1904Ú_Workbook__use_cell_valuesr   ZSharedStringTableÚ_Workbook__sstÚ_Workbook__worksheetsÚ"_Workbook__worksheet_idx_from_nameÚ_Workbook__sheet_refsÚ_supbook_xrefÚ_xcall_xrefÚ_ownbook_supbookxÚ_ownbook_supbook_refÚ_xcall_supbookxÚ_xcall_supbook_ref)Úselfr   Zstyle_compression© r/   ú1/tmp/pip-unpacked-wheel-xnx7fvnv/xlwt/Workbook.pyÚ__init__7   sD    zWorkbook.__init__c                 C   s   | j jd d … S ©N)r!   Ústats©r.   r/   r/   r0   Úget_style_statsh   s    zWorkbook.get_style_statsc                 C   s
   || _ d S r2   ©r   ©r.   Úvaluer/   r/   r0   Ú	set_ownerk   s    zWorkbook.set_ownerc                 C   s   | j S r2   r6   r4   r/   r/   r0   Ú	get_ownern   s    zWorkbook.get_ownerc                 C   s
   || _ d S r2   ©r   r7   r/   r/   r0   Úset_country_codeu   s    zWorkbook.set_country_codec                 C   s   | j S r2   r;   r4   r/   r/   r0   Úget_country_codex   s    zWorkbook.get_country_codec                 C   s   t |ƒ| _d S r2   )Úintr   r7   r/   r/   r0   Úset_wnd_protect   s    zWorkbook.set_wnd_protectc                 C   s
   t | jƒS r2   )Úboolr   r4   r/   r/   r0   Úget_wnd_protect‚   s    zWorkbook.get_wnd_protectc                 C   s   t |ƒ| _d S r2   )r>   r   r7   r/   r/   r0   Úset_obj_protect‰   s    zWorkbook.set_obj_protectc                 C   s
   t | jƒS r2   )r@   r   r4   r/   r/   r0   Úget_obj_protectŒ   s    zWorkbook.get_obj_protectc                 C   s   t |ƒ| _d S r2   )r>   r   r7   r/   r/   r0   Úset_protect“   s    zWorkbook.set_protectc                 C   s
   t | jƒS r2   )r@   r   r4   r/   r/   r0   Úget_protect–   s    zWorkbook.get_protectc                 C   s   t |ƒ| _d S r2   )r>   r   r7   r/   r/   r0   Úset_backup_on_save   s    zWorkbook.set_backup_on_savec                 C   s
   t | jƒS r2   )r@   r   r4   r/   r/   r0   Úget_backup_on_save    s    zWorkbook.get_backup_on_savec                 C   s   |d@ | _ d S ©Néÿÿ  ©r   r7   r/   r/   r0   Úset_hpos§   s    zWorkbook.set_hposc                 C   s   | j S r2   rJ   r4   r/   r/   r0   Úget_hposª   s    zWorkbook.get_hposc                 C   s   |d@ | _ d S rH   ©r   r7   r/   r/   r0   Úset_vpos±   s    zWorkbook.set_vposc                 C   s   | j S r2   rM   r4   r/   r/   r0   Úget_vpos´   s    zWorkbook.get_vposc                 C   s   |d@ | _ d S rH   ©r   r7   r/   r/   r0   Ú	set_width»   s    zWorkbook.set_widthc                 C   s   | j S r2   rP   r4   r/   r/   r0   Ú	get_width¾   s    zWorkbook.get_widthc                 C   s   |d@ | _ d S rH   ©r   r7   r/   r/   r0   Ú
set_heightÅ   s    zWorkbook.set_heightc                 C   s   | j S r2   rS   r4   r/   r/   r0   Ú
get_heightÈ   s    zWorkbook.get_heightc                 C   s   |d@ | _ | j | _d S rH   )r   r   r7   r/   r/   r0   Úset_active_sheetÏ   s    
zWorkbook.set_active_sheetc                 C   s   | j S r2   )r   r4   r/   r/   r0   Úget_active_sheetÓ   s    zWorkbook.get_active_sheetc                 C   s   |d@ | _ d S rH   ©r   r7   r/   r/   r0   Úset_tab_widthÚ   s    zWorkbook.set_tab_widthc                 C   s   | j S r2   rX   r4   r/   r/   r0   Úget_tab_widthÝ   s    zWorkbook.get_tab_widthc                 C   s   t | ƒ| _d S r2   )r>   r   r7   r/   r/   r0   Úset_wnd_visibleä   s    zWorkbook.set_wnd_visiblec                 C   s   t | jƒ S r2   )r@   r   r4   r/   r/   r0   Úget_wnd_visibleç   s    zWorkbook.get_wnd_visiblec                 C   s   t |ƒ| _d S r2   )r>   r   r7   r/   r/   r0   Úset_wnd_miniî   s    zWorkbook.set_wnd_minic                 C   s
   t | jƒS r2   )r@   r   r4   r/   r/   r0   Úget_wnd_miniñ   s    zWorkbook.get_wnd_minic                 C   s   t |ƒ| _d S r2   )r>   r   r7   r/   r/   r0   Úset_hscroll_visibleø   s    zWorkbook.set_hscroll_visiblec                 C   s
   t | jƒS r2   )r@   r   r4   r/   r/   r0   Úget_hscroll_visibleû   s    zWorkbook.get_hscroll_visiblec                 C   s   t |ƒ| _d S r2   )r>   r   r7   r/   r/   r0   Úset_vscroll_visible  s    zWorkbook.set_vscroll_visiblec                 C   s
   t | jƒS r2   )r@   r   r4   r/   r/   r0   Úget_vscroll_visible  s    zWorkbook.get_vscroll_visiblec                 C   s   t |ƒ| _d S r2   )r>   r    r7   r/   r/   r0   Úset_tabs_visible  s    zWorkbook.set_tabs_visiblec                 C   s
   t | jƒS r2   )r@   r    r4   r/   r/   r0   Úget_tabs_visible  s    zWorkbook.get_tabs_visiblec                 C   s   t |ƒ| _d S r2   )r>   r"   r7   r/   r/   r0   Úset_dates_1904  s    zWorkbook.set_dates_1904c                 C   s
   t | jƒS r2   )r@   r"   r4   r/   r/   r0   Úget_dates_1904  s    zWorkbook.get_dates_1904c                 C   s   t |ƒ| _d S r2   )r>   r#   r7   r/   r/   r0   Úset_use_cell_values   s    zWorkbook.set_use_cell_valuesc                 C   s
   t | jƒS r2   )r@   r#   r4   r/   r/   r0   Úget_use_cell_values#  s    zWorkbook.get_use_cell_valuesc                 C   s   | j jS r2   )r!   Údefault_styler4   r/   r/   r0   Úget_default_style*  s    zWorkbook.get_default_stylec                 C   s”   d|  krdks"n t d| ƒ‚t|||ƒdk sBt|||ƒdkrTt d|||f ƒ‚| jd krjttjƒ| _|d }|d> |d> B |d> B | j|< d S )	Né   é?   z5set_colour_RGB: colour_index (%d) not in range(8, 64)r	   éÿ   zAset_colour_RGB: colour values (%d,%d,%d) must be in range(0, 256)é   é   )Ú	ExceptionÚminÚmaxr   Úlistr   Zexcel_default_palette_b8)r.   Zcolour_indexZredZgreenZblueZpalette_indexr/   r/   r0   Úset_colour_RGB1  s    ÿ ÿ
zWorkbook.set_colour_RGBc                 C   s   | j  |¡S r2   )r!   Úadd)r.   Ústyler/   r/   r0   Ú	add_styleC  s    zWorkbook.add_stylec                 C   s   | j  |¡S r2   )r!   Úadd_font)r.   Úfontr/   r/   r0   rx   F  s    zWorkbook.add_fontc                 C   s   | j  |¡S r2   )r$   Úadd_str©r.   Úsr/   r/   r0   rz   I  s    zWorkbook.add_strc                 C   s   | j  |¡ d S r2   )r$   Údel_str)r.   Zsst_idxr/   r/   r0   r}   L  s    zWorkbook.del_strc                 C   s   | j  |¡S r2   )r$   Ú	str_indexr{   r/   r/   r0   r~   O  s    zWorkbook.str_indexc                 C   s   | j  |¡S r2   )r$   Úadd_rt©r.   Úrtr/   r/   r0   r   R  s    zWorkbook.add_rtc                 C   s   | j  |¡S r2   )r$   Úrt_indexr€   r/   r/   r0   r‚   U  s    zWorkbook.rt_indexFc                 C   s   ddl m} ddlm} t|tƒs.| | j¡}| |¡sDtd| ƒ‚| 	¡ }|| j
krbtd| ƒ‚t| jƒ| j
|< | j ||| |ƒ¡ | jd S )aÐ  
        This method is used to create Worksheets in a Workbook.

        :param sheetname:

          The name to use for this sheet, as it will appear in the
          tabs at the bottom of the Excel application.

        :param cell_overwrite_ok:

          If ``True``, cells in the added worksheet will not raise an
          exception if written to more than once.

        :return:

          The :class:`~xlwt.Worksheet.Worksheet` that was added.

        r   )ÚUtils)Ú	Worksheetzinvalid worksheet name %rzduplicate worksheet name %réÿÿÿÿ)Ú rƒ   r„   Ú
isinstancer   Údecoder   Zvalid_sheet_namerp   Úlowerr&   Úlenr%   Úappend)r.   Ú	sheetnameZcell_overwrite_okrƒ   r„   Z
lower_namer/   r/   r0   Ú	add_sheetX  s    


zWorkbook.add_sheetc                 C   s>   t |tƒr| j| S t |tƒr2|  |¡}| j| S tdƒ‚d S )Nzsheet must be integer or string)r‡   r   r%   r   Úsheet_indexrp   )r.   ÚsheetÚsheetnumr/   r/   r0   Ú	get_sheetx  s    




zWorkbook.get_sheetc                 C   s6   z| j | ¡  }W n tk
r0   |  |¡ Y nX |S r2   )r&   r‰   ÚKeyErrorÚraise_bad_sheetname)r.   rŒ   r   r/   r/   r0   rŽ     s
    zWorkbook.sheet_indexc                 C   s   t d| ƒ‚d S )NzFormula: unknown sheet name %s)rp   )r.   rŒ   r/   r/   r0   r“   ‰  s    zWorkbook.raise_bad_sheetnamec                 C   s<   t |ƒ}d|  kr|k r$n n|S d||f }t|ƒ‚d S )Nr	   z2Formula: sheet index (%s) >= number of sheets (%d))r>   rp   )r.   Zstrg_refÚn_sheetsÚidxÚmsgr/   r/   r0   Úconvert_sheetindexŒ  s
    zWorkbook.convert_sheetindexc                 C   s,   || j kr| j | S t| j ƒ | j |< }|S r2   )r(   rŠ   )r.   Útagr•   r/   r/   r0   Ú_get_supbook_index“  s    

zWorkbook._get_supbook_indexc                 C   sJ   |   d¡| _d | _| jddf}|| jkr0tdƒ‚t| jƒ | j|< | _d S )N)Úownbookr	   éþÿ  úcan't happen)r™   r*   r+   r'   rp   rŠ   ©r.   Ú	referencer/   r/   r0   Úsetup_ownbook™  s    
zWorkbook.setup_ownbookc                 C   sJ   |   d¡| _d | _| jddf}|| jkr0tdƒ‚t| jƒ | j|< | _d S )N)Úxcallr	   r›   rœ   )r™   r,   r-   r'   rp   rŠ   r   r/   r/   r0   Úsetup_xcall¡  s    
zWorkbook.setup_xcallc              	   C   s  g }t | jƒ}| ¡ \}}|D ]<\}}}| ¡ sfz| j| ¡  }	W qr tk
rb   |  |¡ Y qrX n|  ||¡}	||kr€|	}
nH| ¡ s¼z| j| ¡  }
W qÈ tk
r¸   |  |¡ Y qÈX n|  ||¡}
|
|	k rèd|||	|
f }t	|ƒ‚| j
d krú|  ¡  | j
|	|
f}|| jkr(| || j| f¡ qt | jƒ}|dkrDt	dƒ‚|| j|< | ||f¡ q|D ]œ\}}| j
d kr~|  ¡  | jd kr’|  ¡  | || jf¡ t|tƒsº| | j¡}|| jkrÒ| j| }nt | jƒ | j|< }| |d |d f¡ qb| |¡ d S )Nz/Formula: sheets out of order; %r:%r -> (%d, %d)rI   z&More than 65536 inter-sheet referencesé   r   )rŠ   r%   Zget_referencesÚisdigitr&   r‰   r’   r“   r—   rp   r*   rŸ   r'   r‹   r,   r¡   r-   r‡   r   rˆ   r   r)   Zpatch_references)r.   ZformulaZpatchesr”   Z
sheet_refsZ
xcall_refsZref0Zref1ÚoffsetZref0nZref1nr–   rž   ZnrefsÚfuncnamer•   r/   r/   r0   Úadd_sheet_reference©  s\    

ÿ



zWorkbook.add_sheet_referencec                 C   s   t  t jj¡ ¡ S r2   )r   ZBiff8BOFRecordZBOOK_GLOBALÚgetr4   r/   r/   r0   Z	__bof_recä  s    zWorkbook.__bof_recc                 C   s   t  ¡  ¡ S r2   )r   Z	EOFRecordr§   r4   r/   r/   r0   Z	__eof_recç  s    zWorkbook.__eof_recc                 C   s   t  ¡  ¡ S r2   )r   ZInteraceHdrRecordr§   r4   r/   r/   r0   Z__intf_hdr_recê  s    zWorkbook.__intf_hdr_recc                 C   s   t  ¡  ¡ S r2   )r   ZInteraceEndRecordr§   r4   r/   r/   r0   Z__intf_end_recí  s    zWorkbook.__intf_end_recc                 C   s   t  ¡  ¡ S r2   )r   Z	MMSRecordr§   r4   r/   r/   r0   Z__intf_mms_recð  s    zWorkbook.__intf_mms_recc                 C   s   t  | j¡ ¡ S r2   )r   ZWriteAccessRecordr   r§   r4   r/   r/   r0   Z__write_access_recó  s    zWorkbook.__write_access_recc                 C   s   t  | j¡ ¡ S r2   )r   ZWindowProtectRecordr   r§   r4   r/   r/   r0   Z__wnd_protect_recö  s    zWorkbook.__wnd_protect_recc                 C   s   t  | j¡ ¡ S r2   )r   ZObjectProtectRecordr   r§   r4   r/   r/   r0   Z__obj_protect_recù  s    zWorkbook.__obj_protect_recc                 C   s   t  | j¡ ¡ S r2   )r   ZProtectRecordr   r§   r4   r/   r/   r0   Z__protect_recü  s    zWorkbook.__protect_recc                 C   s   t  ¡  ¡ S r2   )r   ZPasswordRecordr§   r4   r/   r/   r0   Z__password_recÿ  s    zWorkbook.__password_recc                 C   s   t  ¡  ¡ S r2   )r   ZProt4RevRecordr§   r4   r/   r/   r0   Z__prot4rev_rec  s    zWorkbook.__prot4rev_recc                 C   s   t  ¡  ¡ S r2   )r   ZProt4RevPassRecordr§   r4   r/   r/   r0   Z__prot4rev_pass_rec  s    zWorkbook.__prot4rev_pass_recc                 C   s   t  | j¡ ¡ S r2   )r   ZBackupRecordr   r§   r4   r/   r/   r0   Z__backup_rec  s    zWorkbook.__backup_recc                 C   s   t  ¡  ¡ S r2   )r   ZHideObjRecordr§   r4   r/   r/   r0   Z__hide_obj_rec  s    zWorkbook.__hide_obj_recc                 C   sx   d}|| j d> O }|| jd> O }|| jd> O }|| jd> O }|| jd> O }t | j| j| j	| j
|| j| j| j| j¡	 ¡ S )Nr	   r   é   é   é   )r   r   r   r   r    r   ZWindow1Recordr   r   r   r   r   r   r   r   r§   )r.   Úflagsr/   r/   r0   Z__window1_rec  s       üzWorkbook.__window1_recc                 C   s   t  ¡  ¡ S r2   )r   ZCodepageBiff8Recordr§   r4   r/   r/   r0   Z__codepage_rec  s    zWorkbook.__codepage_recc                 C   s   | j s
dS t | j | j ¡ ¡ S ©Nó    )r   r   ZCountryRecordr§   r4   r/   r/   r0   Z__country_rec  s    zWorkbook.__country_recc                 C   s   t  ¡  ¡ S r2   )r   Z	DSFRecordr§   r4   r/   r/   r0   Z	__dsf_rec$  s    zWorkbook.__dsf_recc                 C   s   t  t| jƒ¡ ¡ S r2   )r   ZTabIDRecordrŠ   r%   r§   r4   r/   r/   r0   Z__tabid_rec'  s    zWorkbook.__tabid_recc                 C   s   t  ¡  ¡ S r2   )r   ZFnGroupCountRecordr§   r4   r/   r/   r0   Z__fngroupcount_rec*  s    zWorkbook.__fngroupcount_recc                 C   s   t  | j¡ ¡ S r2   )r   ZDateModeRecordr"   r§   r4   r/   r/   r0   Z__datemode_rec-  s    zWorkbook.__datemode_recc                 C   s   t  | j¡ ¡ S r2   )r   ZPrecisionRecordr#   r§   r4   r/   r/   r0   Z__precision_rec0  s    zWorkbook.__precision_recc                 C   s   t  ¡  ¡ S r2   )r   ZRefreshAllRecordr§   r4   r/   r/   r0   Z__refresh_all_rec3  s    zWorkbook.__refresh_all_recc                 C   s   t  ¡  ¡ S r2   )r   ZBookBoolRecordr§   r4   r/   r/   r0   Z__bookbool_rec6  s    zWorkbook.__bookbool_recc                 C   s
   | j  ¡ S r2   )r!   Úget_biff_datar4   r/   r/   r0   Z%__all_fonts_num_formats_xf_styles_rec9  s    z.Workbook.__all_fonts_num_formats_xf_styles_recc                 C   s"   | j d krdS t | j ¡ ¡ }|S r¬   )r   r   ZPaletteRecordr§   )r.   Úinfor/   r/   r0   Z__palette_rec<  s    
zWorkbook.__palette_recc                 C   s   t  ¡  ¡ S r2   )r   ZUseSelfsRecordr§   r4   r/   r/   r0   Z__useselfs_recB  s    zWorkbook.__useselfs_recc           	   	   C   s‚   d}| j D ]&}|tt d|j|j| j¡ ¡ ƒ7 }q
|| | }d}t|| j ƒD ].\}}|t ||j|j| j¡ ¡ 7 }||7 }qN|S )Nr	   r­   )	r%   rŠ   r   ZBoundSheetRecordZ
visibilityÚnamer   r§   Úzip)	r.   Zdata_len_beforeZdata_len_afterÚsheet_biff_lensZboundsheets_lenr   ÚstartÚresultZsheet_biff_lenr/   r/   r0   Z__boundsheets_recE  s&    	
   ÿ   ÿ

zWorkbook.__boundsheets_recc           
      C   s0  g }dd„ | j  ¡ D ƒ}| ¡  |D ]®\}}|\}}|dkr\t t| jƒ¡ ¡ }| |¡ q$|dkrÆt 	¡  ¡ }| |¡ dd„ | j
 ¡ D ƒ}| ¡  |D ](\}}tjdd|dd ¡ }| |¡ qšq$td	| ƒ‚q$t| jƒdkr&d
d„ | j ¡ D ƒ}| ¡  dd„ |D ƒ}t |¡ ¡ }	| |	¡ d |¡S )Nc                 S   s   g | ]\}}||f‘qS r/   r/   )Ú.0r˜   r•   r/   r/   r0   Ú
<listcomp>`  s     z,Workbook.__all_links_rec.<locals>.<listcomp>rš   r    c                 S   s   g | ]\}}||f‘qS r/   r/   )rµ   r°   r•   r/   r/   r0   r¶   j  s     r	   z )ÚoptionsÚindexr°   Zfmlazunknown supbook stype %rc                 S   s   g | ]\}}||f‘qS r/   r/   )rµ   Úrefr•   r/   r/   r0   r¶   t  s     c                 S   s   g | ]\}}|‘qS r/   r/   )rµ   r•   r¹   r/   r/   r0   r¶   v  s     r­   )r(   ÚitemsÚsortr   ZInternalReferenceSupBookRecordrŠ   r%   r§   r‹   ZXcallSupBookRecordr)   ZExternnameRecordrp   r'   ZExternSheetRecordÚjoin)
r.   ÚpiecesÚtempr•   r˜   ÚstypeZsnumZrecr°   Zexternsheet_recordr/   r/   r0   Z__all_links_rec^  s:    
   ÿ

zWorkbook.__all_links_recc                 C   s
   | j  ¡ S r2   )r$   Zget_biff_recordr4   r/   r/   r0   Z	__sst_rec{  s    zWorkbook.__sst_recc                 C   s   dS r¬   r/   )r.   Zabs_stream_posr/   r/   r0   Z__ext_sst_rec~  s    zWorkbook.__ext_sst_recc                 C   s  d}||   ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  	¡ 7 }||  
¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }||  ¡ 7 }|  ¡ }|  ¡ }|  ¡ }|| | }|  d¡}|  ¡ }d| j| j _ d}g }	| jD ]$}
|
 !¡ }||7 }|	 "t#|ƒ¡ q‚|  $t#|ƒt#|ƒt#|ƒ t#|ƒ |	¡}t#|ƒt#|ƒ t#|ƒ t#|ƒ }|  |¡}|| | | | | S )Nr­   r	   T)%Ú_Workbook__bof_recÚ_Workbook__intf_hdr_recÚ_Workbook__intf_mms_recÚ_Workbook__intf_end_recÚ_Workbook__write_access_recÚ_Workbook__codepage_recÚ_Workbook__dsf_recÚ_Workbook__tabid_recÚ_Workbook__fngroupcount_recÚ_Workbook__wnd_protect_recÚ_Workbook__protect_recÚ_Workbook__obj_protect_recÚ_Workbook__password_recÚ_Workbook__prot4rev_recÚ_Workbook__prot4rev_pass_recÚ_Workbook__backup_recÚ_Workbook__hide_obj_recÚ_Workbook__window1_recÚ_Workbook__datemode_recÚ_Workbook__precision_recÚ_Workbook__refresh_all_recÚ_Workbook__bookbool_recÚ._Workbook__all_fonts_num_formats_xf_styles_recÚ_Workbook__palette_recÚ_Workbook__useselfs_recÚ_Workbook__country_recÚ_Workbook__all_links_recÚ_Workbook__sst_recÚ_Workbook__ext_sst_recÚ_Workbook__eof_recr%   r   Úselectedr®   r‹   rŠ   Ú_Workbook__boundsheets_rec)r.   ÚbeforeZcountryZ	all_linksZshared_str_tableÚafterZext_sstÚeofZsheetsr²   r   ÚdataZbundlesheetsZsst_stream_posr/   r/   r0   r®   ƒ  sV    

& 
zWorkbook.get_biff_datac                 C   s(   ddl m} | ¡ }| ||  ¡ ¡ dS )aÒ  
        This method is used to save the Workbook to a file in native Excel
        format.

        :param filename_or_stream:
          This can be a string containing a filename of
          the file, in which case the excel file is saved to disk using the name
          provided. It can also be a stream object with a write method, such as
          a :class:`~io.StringIO`, in which case the data for the excel
          file is written to the stream.
        r   )ÚCompoundDocN)r†   rä   ZXlsDocÚsaver®   )r.   Zfilename_or_streamrä   Údocr/   r/   r0   rå   ·  s    zWorkbook.saveN)r   r	   )F)tÚ__name__Ú
__module__Ú__qualname__Ú__doc__r1   r5   r9   r:   ÚpropertyÚownerr<   r=   Zcountry_coder?   rA   Zwnd_protectrB   rC   Zobj_protectrD   rE   ZprotectrF   rG   Zbackup_on_saverK   rL   ZhposrN   rO   ZvposrQ   rR   ÚwidthrT   rU   ÚheightrV   rW   Zactive_sheetrY   rZ   Z	tab_widthr[   r\   Zwnd_visibler]   r^   Zwnd_minir_   r`   Zhscroll_visiblera   rb   Zvscroll_visiblerc   rd   Ztabs_visiblere   rf   Z
dates_1904rg   rh   Zuse_cell_valuesrj   ri   rt   rw   rx   rz   r}   r~   r   r‚   r   r‘   rŽ   r“   r—   r™   rŸ   r¡   r¦   rÀ   rÝ   rÁ   rÃ   rÂ   rÄ   rÉ   rË   rÊ   rÌ   rÍ   rÎ   rÏ   rÐ   rÑ   rÅ   rÙ   rÆ   rÇ   rÈ   rÒ   rÓ   rÔ   rÕ   rÖ   r×   rØ   rß   rÚ   rÛ   rÜ   r®   rå   r/   r/   r/   r0   r   -   sà   	
1



















 	;4r   N)	r†   r   r   Úcompatr   r   r   Úobjectr   r/   r/   r/   r0   Ú<module>)   s   