+
    i                         ^ RI Ht ^ RIt^RIHtHtHt ^RI5 ^RI5 ^RI	5  ^ RI
Ht ^ RIHt ]P                  t^ t^ RItRt]! ^4      w  tttttR0t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$/t/ t/ t]P;                  4        F   w  tt] ! ]4      t] ! ]4      t]]]&   ]]]&   K"  	  AAAR]!PD                  ^ R%RRR&R&R&R&3
R' lt# ! R( R)]$4      t% ! R* R+]$4      t&R, t'R1R- lt(R. t)R/ t*R#   ] d
    ^ RI
Ht  Li ; i)2    )print_functionN)compdoc
formattingsheet)*)perf_counter)clockunpacki Consolidate_Area 	Auto_Open
Auto_CloseExtractDatabaseCriteria
Print_AreaPrint_TitlesRecorder	Data_Form	Auto_Activate
Auto_DeactivateSheet_Title_FilterDatabaseTFc
                    \        4       p
\        4       p VP                  WWVVVVVV	R 7
       \        4       pW,
          Vn        VP	                  \
        4      pV'       g   \        R4      hV\        9  d   \        R\        V,          ,          4      hWn	        V^(8:  d9   V'       d    \        VP                  R4       R;Vn        pVP                  4        MV^-8X  d9   VP                  4        V'       d    \        VP                  R4       R;Vn        pMIVP                  4        VP                   Uu. uF  pRNK  	  upVn        V'       g   VP#                  4        \%        VP                   4      Vn        V^-8X  d3   VP&                  ^8  d"   \        VP                  RVP&                  4       \        4       pW,
          Vn        T'       g   TP+                  4        T# u upi    TP+                  4        h ; i))
filenamefile_contentslogfile	verbosityuse_mmapencoding_overrideformatting_info	on_demandragged_rowsignore_workbook_corruptionz#Can't determine file's BIFF versionz BIFF version %s is not supportedz`*** WARNING: on_demand is not supported for this Excel version.
*** Setting on_demand to False.
FNz|*** WARNING: Excel 4.0 workbook (.XLW) file contains %d worksheets.
*** Book-level data will be that of the last worksheet.
)r   Bookbiff2_8_loadload_time_stage_1getbofXL_WORKBOOK_GLOBALS	XLRDErrorSUPPORTED_VERSIONSbiff_text_from_numbiff_versionfprintfr+   r0   fake_globals_get_sheetparse_globals_sheet_names_sheet_list
get_sheetslennsheetsload_time_stage_2release_resources)r)   r+   r,   r-   r*   r.   r/   r0   r1   r2   t0bkt1r;   sht2s   &&&&&&&&&&      R/Users/mibo/.openclaw/workspace/.venv-ak/lib/python3.14/site-packages/xlrd/book.pyopen_workbook_xlsrL   ;   s    
B	B5
8/+#'A 	 	
 ^!wyy!45ABB112$\23  '2

89 ,10y%%'R

 %H I+00y-/__=_rd_=BN(
2"**q.

L

	 ^!w
 
I' >
s2   BG, +AG, :>G, 8G'G, A:G, 'G, ,G?c                   ~   a  ] tR t^t o RtR.tRt^ t^ t^ t	^ t
^ t^ t^ t^ t^ t]! R4      tRtR	tRtR tR
R ltRtV tR# )Namez
Information relating to a named reference, formula, macro, etc.

.. note::

  Name information is **not** extracted from files older than
  Excel 5.0 (``Book.biff_version < 50``)
stackN     c                   V P                   pV'       d   VP                  pVP                  pV\        8X  d   \	        V4      ^8X  d   V^ ,          p^ VP
                  u;8:  d   VP                  ^,
          8X  d   M MVP                  VP                  ^,
          8X  dn   VP                  VP                  ^,
          8X  dL   V P                  P                  VP
                  4      pVP                  VP                  VP                  4      # V P                  V P                  P                  RRR7       \!        R4      h)a  
This is a convenience method for the frequent use case where the name
refers to a single cell.

:returns: An instance of the :class:`~xlrd.sheet.Cell` class.

:raises xlrd.biffh.XLRDError:
  The name is not a constant absolute reference
  to a single cell.
=== Dump of Name object ========== End of dump =======headerfooterz2Not a constant absolute reference to a single cell)resultkindvalueoREFrB   shtxloshtxhirowxlorowxhicolxlocolxhibooksheet_by_indexcelldumpr+   r8   )selfresrY   rZ   ref3drI   s   &     rK   rd   	Name.cell   s     kk88DIIEt|E
aa9)99q(88q(8811%,,?B775<<>>		II00 	 	

 LMMrQ   c                   V P                   pV'       Ed   VP                  pVP                  pV\        8X  Ed   \	        V4      ^8X  Edy   V^ ,          p^ VP
                  u;8:  d   VP                  ^,
          8X  EdE   M EM@V P                  P                  VP
                  4      pV'       g/   WeP                  VP                  VP                  VP                  3# \        VP                  VP                  4      p\        V\        VP                  VP                  4      4      p\        VP                  VP                   4      p	\        V	\        VP                  VP                   4      4      p
^ Tu;8:  d   Tu;8:  d   VP                  8:  g   Q h Q h^ T	u;8:  d   T
u;8:  d   VP                   8:  g   Q h Q hWgWV
3# V P#                  V P                  P$                  RRR7       \'        R4      h)ad  
This is a convenience method for the use case where the name
refers to one rectangular area in one worksheet.

:param clipped:
  If ``True``, the default, the returned rectangle is clipped
  to fit in ``(0, sheet.nrows, 0, sheet.ncols)``.
  it is guaranteed that ``0 <= rowxlo <= rowxhi <= sheet.nrows`` and
  that the number of usable rows in the area (which may be zero) is
  ``rowxhi - rowxlo``; likewise for columns.

:returns: a tuple ``(sheet_object, rowxlo, rowxhi, colxlo, colxhi)``.

:raises xlrd.biffh.XLRDError:
   The name is not a constant absolute reference
   to a single area in a single sheet.
rS   rT   rU   zDNot a constant absolute reference to a single area in a single sheet)rX   rY   rZ   r[   rB   r\   r]   rb   rc   r^   r_   r`   ra   minnrowsmaxncolsre   r+   r8   )rf   clippedrg   rY   rZ   rh   rI   r^   r_   r`   ra   s   &&         rK   area2dName.area2d   sv   $ kk388DIIEt|E
aa8q(88811%,,?B"!<<u||U\\YY rxx8F U\\288)DEF rxx8F U\\288)DEF<&<BHH<<<<<<&<BHH<<<<<vv==		II00 	 	

 ^__rQ    T)__name__
__module____qualname____firstlineno____doc___repr_theserb   hiddenfuncvbasicmacrocomplexbuiltin	funcgroupbinary
name_indexUNICODE_LITERALnameraw_formulascoperX   rd   rp   __static_attributes____classdictcell____classdict__s   @rK   rN   rN      s      )KD F D F E
 G G I
 F J 2D K E FN<)` )`rQ   rN   c            
         a  ] tR tRt o Rt^ t^ t^ t. tRt	Rt
R0t]! R4      t. t. t. t/ t/ t/ t. tR1tR1tR tR tR tR tR	 tR
 tR tR tR tR t R t!/ t"/ t#R t$RR]%PL                  ^ RRRRRR3
R lt'R t(R t)R t*R t+R2R lt,R t-R t.R t/R t0R t1R t2R t3R  t4R! t5R" t6R# t7R$ t8R% t9R& t:R' t;R( t<R) t=R* t>R+ t?R, t@R- tAR. tBR/tCV tDR# )3r3   i  z
Contents of a "workbook".

.. warning::

  You should not instantiate this class yourself. You use the :class:`Book`
  object that was returned when you called :func:`~xlrd.open_workbook`.
NrP   c                    \        V P                  4       F/  pV P                  V,          '       d   K  V P                  V4       K1  	  V P                  R,          # )z\
:returns: A list of all sheets in the book.

All sheets not already loaded will be loaded.
NNN)xrangerC   r@   	get_sheetrf   sheetxs   & rK   sheetsBook.sheets  sG     T\\*F##F++v& + ""rQ   c                Z    V P                   V,          ;'       g    V P                  V4      # )zZ
:param sheetx: Sheet index in ``range(nsheets)``
:returns: A :class:`~xlrd.sheet.Sheet`.
)r@   r   r   s   &&rK   rc   Book.sheet_by_index  s&    
 'AA4>>&+AArQ   c              #  l   "   \        V P                  4       F  pV P                  V4      x  K  	  R# 5i)z
Makes iteration through sheets of a book a little more straightforward.
Don't free resources after use since it can be called like `list(book)`
N)rangerC   rc   )rf   is   & rK   __iter__Book.__iter__  s+     
 t||$A%%a(( %s   24c                     V P                   P                  V4      pT P	                  T4      #   \         d    \        RT,          4      hi ; i)zX
:param sheet_name: Name of the sheet required.
:returns: A :class:`~xlrd.sheet.Sheet`.
No sheet named <%r>)r?   index
ValueErrorr8   rc   )rf   
sheet_namer   s   && rK   sheet_by_nameBook.sheet_by_name  sU    
	@&&,,Z8F ""6**  	@1J>??	@s	   . Ac                r    \        V\        4      '       d   V P                  V4      # V P                  V4      # )z
Allow indexing with sheet name or index.
:param item: Name or index of sheet enquired upon
:return: :class:`~xlrd.sheet.Sheet`.
)
isinstanceintrc   r   )rf   items   &&rK   __getitem__Book.__getitem__  s3     dC  &&t,,%%d++rQ   c                (    V P                   R,          # )z
:returns:
  A list of the names of all the worksheets in the workbook file.
  This information is available even when no sheets have yet been
  loaded.
r   )r?   rf   s   &rK   sheet_namesBook.sheet_names  s       ##rQ   c                    \        V\        4      '       d   TpM V P                  P                  V4      p\        V P                  V,          4      #   \         d    \        RT,          4      hi ; i)z
:param sheet_name_or_index: Name or index of sheet enquired upon
:returns: ``True`` if sheet is loaded, ``False`` otherwise.

.. versionadded:: 0.7.1
r   )r   r   r?   r   r   r8   boolr@   rf   sheet_name_or_indexr   s   && rK   sheet_loadedBook.sheet_loaded  sq     )3//(FM**001DE D$$V,--  M 58K KLLMs   A A0c                    \        V\        4      '       d   TpM V P                  P                  V4      pRV P                  V&   R#   \         d    \        RT,          4      hi ; i)z]
:param sheet_name_or_index: Name or index of sheet to be unloaded.

.. versionadded:: 0.7.1
r   N)r   r   r?   r   r   r8   r@   r   s   && rK   unload_sheetBook.unload_sheet  sk     )3//(FM**001DE $(   M 58K KLLMs   A A%c                $   ^V n         \        V P                  R4      '       d   V P                  P                  4        RV n        \        V P                  R4      '       d   V P                  P                  4        RV n        RV n        RV n        R# )a  
This method has a dual purpose. You can call it to release
memory-consuming objects and (possibly) a memory-mapped file
(:class:`mmap.mmap` object) when you have finished loading sheets in
``on_demand`` mode, but still require the :class:`Book` object to
examine the loaded sheets. It is also called automatically (a) when
:func:`~xlrd.open_workbook`
raises an exception and (b) if you are using a ``with`` statement, when
the ``with`` block is exited. Calling this method multiple times on the
same object has no ill effect.
closeN)_resources_releasedhasattrmemr   filestr_sharedstrings_rich_text_runlist_mapr   s   &rK   rE   Book.release_resources
  sj     $% 488W%%HHNN4<<))LL "&*#rQ   c                    V # Nrr   r   s   &rK   	__enter__Book.__enter__!  s    rQ   c                &    V P                  4        R # r   )rE   )rf   exc_type	exc_valueexc_tbs   &&&&rK   __exit__Book.__exit__$  s     rQ   c                   . V n         . V n        . V n        ^ V n        . V n        . V n        / V n        RV n        ^ V n        RV n	        V P                  4        ^ V n        ^ V n        RV n        RV n        . V n        . V n        . V n        / V n        / V n        ^ V n        . V n        ^ V n        . V n        . V n        / V n        . V n        . V n        / V n        RV n        RV n        R# )r   FNrQ   rs   )r@   r?   _sheet_visibilityrC   _sh_abs_posnr   r   raw_user_name_sheethdr_countbuiltinfmtcountinitialise_format_info_all_sheets_count_supbook_count_supbook_locals_inx_supbook_addins_inx_all_sheets_map_externsheet_info_externsheet_type_b57_extnsht_name_from_num_sheet_num_from_name_extnsht_count_supbook_typesr   addin_func_namesname_obj_list
colour_mappalette_recordxf_liststyle_name_mapr   r   r   s   &rK   __init__Book.__init__5  s    !# &(#" !##%!"#' #' !!#%'"&(#$&! #$  "  rQ   TFc                   W0n         W@n        WPn        W`n        Wpn        Wn        Wn        V'       g   \        VR 4      ;_uu_ 4       pVP                  ^ ^4       VP                  4       pVP                  ^ ^ 4       V^ 8X  d   \        R4      hV P                  '       dB   \        P                  ! VP                  4       V\        P                  R7      V n        Wn        M/VP!                  4       V n        \#        V P                  4      V n        RRR4       MW n        \#        V4      V n        ^ V n        V P                  R,          \&        P(                  8w  d   V P                  V n        M\&        P,                  ! V P                  V P                   V
R7      pR FD  pVP/                  \1        V4      4      w  V n        V n        V n        V P*                  '       g   KD   M	  \        R4      h?V P*                  V P                  Jd>   \3        V P                  R4      '       d   V P                  P5                  4        RV n        V P$                  V n        \8        '       dK   \;        R	\=        V P*                  4      V P$                  V P                  3,          V P                   R
7       R# R#   + '       g   i     EL; i)rbzFile size is 0 bytes)accessN:N   N)r+   r2   z-Can't find workbook in OLE2 compound documentr   rQ   zmem: %s, base: %d, len: %dfile)Workbookr3   )r+   r,   r-   r.   r/   r0   r1   openseektellr8   mmapfilenoACCESS_READr   
stream_lenreadrB   baser   	SIGNATUREr   CompDoclocate_named_streamr   r   r   	_positionDEBUGprinttype)rf   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   fsizecdqnames   &&&&&&&&&&&    rK   r4   Book.biff2_8_loadV  s    " !2."&h%%q!vvxq!19#$:;;===#'99QXXZdFVFV#WDL&*O#$668DL&)$,,&7DO &% )L!-0DO	<<w000||DHt||<VXB-22?53IJ 5$)T_888	 .   OPPxxt||+4<<11LL&&("5.$txx.$))T__1]]dhdpdpq I &%%s   AJ1 A0J11K	c                    / V n         . V n        ^ V n        ^ V n        ^ \        /V n        ^ V n        . V n        . V n        R# )r   N)	
format_mapformat_listxfcountactualfmtcountXL_CELL_NUMBER_xf_index_to_xl_type_map_xf_epilogue_doner   	font_listr   s   &rK   r   Book.initialise_format_info  sC    )*N(;%!"rQ   c                    V P                   pV P                  W^,            p\        V4      pV ;P                   V,          un         V^8  d   \        # Vw  rE\	        V4      ^,          \	        V4      ,          # )   )r   r   rB   MY_EOF	BYTES_ORD)rf   posbuff_twolenbufflohis   &     rK   	get2bytesBook.get2bytes  s_    nn88CA&h-'!Q;M""im33rQ   c                    V P                   pV P                  p\        R W!V^,            4      w  r4V^,          pW!W,            pW,           V n         W4V3# )<HHr   r   r   )rf   r  r   codelengthdatas   &     rK   get_record_partsBook.get_record_parts  sS    nnhheSSU^4qsz"d##rQ   c                    V P                   pV P                  p\        R W2V^,            4      w  rEWA8w  d   R# V^,          pW2W%,            pW%,           V n         WEV3# )r  )Nr   rQ   r  )rf   reqd_recordr  r   r  r  r  s   &&     rK   get_record_parts_conditional!Book.get_record_parts_conditional  s_    nnhheSSU^4!!qsz"d##rQ   c                P   V P                   '       d   \        R 4      hV'       d   V P                  V,          V n        V P	                  \
        4       \        P                  ! V V P                  V P                  V,          V4      pVP                  V 4       W0P                  V&   V# )z,Can't load sheets after releasing resources.)r   r8   r   r   r6   XL_WORKSHEETr   Sheetr?   r   r@   )rf   	sh_number
update_posrI   s   &&& rK   r   Book.get_sheet  s    ###JKK!..y9DNL! [[NNi(	
 	&(#	rQ   c           	     V   \         '       d.   \        R V P                  V P                  V P                  R7       \        \        V P                  4      4       FM  p\         '       d.   \        RWP                  V P                  V P                  R7       V P                  V4       KO  	  R# )zGET_SHEETS:r   zGET_SHEETS: sheetno =N)r   r   r?   r   r+   r   rB   r   )rf   sheetnos   & rK   rA   Book.get_sheets  st    5%t'8'8$:K:KRVR^R^_c$"3"345Gue3W>O>OQUQbQbimiuiuvNN7# 6rQ   c                    \         P                  ! V 4       \        R 4      pV.V n        ^ .V n        ^ .V n        V P                  P                  R4       V P                  4        R# )zSheet 1N)	r   initialise_bookr   r?   r   r   r@   appendrA   )rf   fake_sheet_names   & rK   r=   Book.fake_globals_get_sheet  sW    ""4())4,-C"#%rQ   c           	        V P                   pV P                  4        \        '       d   \        V P                  R W!4       V^-8X  d]   \        V^ V P                  ^R7      p^ p\        p\        V P                  4      ^ 8X  d   V P                  V P                  ,           pM^RpM[\        RVR,          4      w  rtpWpP                  ,           pV\        8  d   \        V^V P                  ^R7      pM\        V^^R7      p\        '       g   V P                  ^8  d$   \        V P                  RV P                   WCWe4       V ;P                   ^,          un        V\        8w  dm   V P"                  P%                  R4       ^R^R^R/P'                  VR4      p\        '       g   V P                  ^8  d   \        V P                  R	W5V4       R
# R
# \        V P(                  4      p	V P"                  P%                  V	4       V P(                  P%                  V4       V P                  P%                  V4       V P*                  P%                  V4       WP,                  V&   R
# )zBOUNDSHEET: bv=%d data %r
lenlenz<iBB:r      NzFBOUNDSHEET: inx=%d vis=%r sheet_name=%r abs_posn=%d sheet_type=0x%02x
zMacro sheetChartzVisual Basic moduleUNKNOWNzANOTE *** Ignoring non-worksheet data named %r (type 0x%02x = %s)
Nrs   )r;   derive_encodingr   r<   r+   unpack_stringencodingXL_BOUNDSHEET_WORKSHEETrB   r   _sheetsoffsetr   r   BIFF_FIRST_UNICODEunpack_unicoder,   r   r   r+  getr?   r   r   )
rf   r  bvr   
visibility
sheet_typeabs_posnoffsetdescrsnums
   &&        rK   handle_boundsheetBook.handle_boundsheet  s   5DLL"?J8 'tQaHJJ0J4$$%*--		9
 -3FDI-F*F
		)H&&*4DMM!L
+D!A>
5DNNa'DLLY&&
V 	!#00  ''+=7( c*i(	  u!+XE3 ,
 t(()D  ''-$$Z0$$X.""))*548%%j1rQ   c                    \        R VR,          4      ^ ,          p\        '       d   \        V P                  RV4       W n        R# )<Hr   r
  NzBUILTINFMTCOUNT: %r
N)r   r   r<   r+   r   )rf   r  r   s   && rK   handle_builtinfmtcountBook.handle_builtinfmtcount  s4     !tCy1!45'$,,(?Q.rQ   c           
        V P                   '       d   V P                   V n        EM.V P                  f_   V P                  ^P8  d   \	        V P
                  R4       RV n        MRV n        V P                  ^8  d   \	        V P
                  R4       MV P                  pV\        9   d   \        V,          pMRRTu;8:  d   R8:  d   M MR\        V4      ,           pM-V P                  ^P8  d   RV n        RpMR	\        V4      ,           p\        '       g#   V P                  '       d(   W P                  8w  d   \	        V P
                  R
W4       W n        V P                  R8w  d    \        RV P                  4       V P                  '       dA   \!        V P"                  ^ V P                  ^R7      pVP%                  4       pW@n        RV n        V P                  #   \         d^   p\	        T P
                  RT P                  T P                  \        T4      P                  P                  R4      R,          T4       h R p?ii ; i)NzD*** No CODEPAGE record, no encoding_override: will use 'iso-8859-1'
z
iso-8859-1i  z2*** No CODEPAGE record; assuming 1200 (utf_16_le)
i,  i  cp	utf_16_leunknown_codepage_z%CODEPAGE: codepage %r -> encoding %r
s   trialz/ERROR *** codepage %r -> encoding %r -> %s: %s
.r/  Frs   )r.   r6  codepager;   r<   r+   r,   encoding_from_codepagestrr   unicodeBaseExceptionr   ru   splitr   r5  	user_namerstrip)rf   rO  r6  estrgs   &    rK   r4  Book.derive_encoding  s   !!! 22DM]]"  2%[] , $>>Q&DLL*_`}}H111(;(D(#h-/""b( $&.X>uH,E&NPXc$M==D $--0  DMM!LD;;=D "N!&D}} ! FMM4==$q'2B2B2H2H2Mb2QSTV 	s   &G I%AH==Ic                f    \        R VR,          4      ^ ,          pW n        V P                  4        R# )rF  rG  N)r   rO  r4  )rf   r  rO  s   && rK   handle_codepageBook.handle_codepageE  s(    $S	*1- rQ   c                    \        R VR,          4      pV P                  '       d   \        RW P                  R7       V P                  R8X  g   V P                  V8X  g   Q hW n        R# )r  r      Nz
Countries:r   Nr   r   )r   r,   r   r+   	countries)rf   r  ra  s   && rK   handle_countryBook.handle_countryK  sJ    5$s),	>>>5y||L~~'4>>Y+FFF"rQ   c                    \        R VR,          4      ^ ,          p\        '       g   V P                  '       d   \        V P                  RV4       VR9   g   Q hW n        R# )rF  rG  zDATEMODE: datemode %r
N)r      )r   r   r,   r<   r+   datemode)rf   r  rf  s   && rK   handle_datemodeBook.handle_datemodeR  sH    $S	*1-5DNNNDLL";XF6!!! rQ   c           	        \         ;'       g    V P                  ^8  pV P                  ^P8  d   \        RVR,          4      w  r4^p\	        W^R7      w  reWR pV P
                  R,          \        8X  d   V P                  P                  V4       V'       d-   \        V P                  RV P
                  R,          W4Wg4       R# R# R# )r
  <HI:Nr1  Nr/  NzCEXTERNNAME: sbktype=%d oflags=0x%04x oinfo=0x%08x name=%r extra=%r
rs   )r   r,   r;   r   unpack_unicode_update_posr   SUPBOOK_ADDINr   r+  r<   r+   )rf   r  blahoption_flags
other_infor  r   extras   &&      rK   handle_externnameBook.handle_externnameY  s    ++!+"&,UDH&=$LC1$AFIDJE""2&-7%%,,T2Z''+\tT  #rQ   c           	     Z   V P                  4        V ;P                  ^,          un        \        ;'       g    V P                  ^8  p\        ;'       g    V P                  ^8  pV P                  ^P8  Ed   \        RVR,          4      ^ ,          pV^,          ^,           p\        V4      V8  d]   V'       d"   \        V P                  RV\        V4      4       V P                  4       w  rgpV\        8w  d   \        R4      hW,          pKl  ^p	\        V4       Fc  p
\        RWV	^,            4      pVw  rpV P                  P                  V4       V	^,          p	V'       g   KK  \        V P                  RWW4       Ke  	  R# \        RVR,          4      w  ppV'       du   \        R	V P                  R
7       \!        V^ \        V4      V P                  R7       ^R^R^R^R/P#                  VR4      p\        RVVV3,          V P                  R
7       V^8X  dc   \%        V^V^,            V P&                  4      pVV P(                  V P                  &   V'       d"   \        V P(                  V P                  R
7       ^Tu;8:  d   ^8:  g   M ^ pV P*                  P                  V4       R# )re  rF  rG  z*INFO: EXTERNSHEET needs %d bytes, have %d
z)Missing CONTINUE after EXTERNSHEET recordz<HHHzLEXTERNSHEET(b8): k = %2d, record = %2d, first_sheet = %5d, last sheet = %5d
z<BBNr
  NzEXTERNSHEET(b7-):r   foutzEncoded URLzCurrent sheet!!zSpecific sheet in own doc'tz Nonspecific sheet in own doc't!!zNot encodedz   %3d chars, type is %d (%s)N)r4  r   r   r,   r;   r   rB   r<   r+   r  XL_CONTINUEr8   r   r   r+  r   hex_char_dumpr;  rR  r6  r   r   )rf   r  blah1blah2num_refs
bytes_reqdcode2length2data2r  kinforef_recordxref_first_sheetxref_last_sheetxnctymsgr   s   &&                 rK   handle_externsheetBook.handle_externsheetg  s<   q ,,1,,,1,"dDI.q1H!A)Jd)j(E"CI
 )-(=(=(?%K'#$OPPCH%fds1uo6AE>&&--d3q5g(8 & E48,FB)=dAs4yt||D}(49	
 #b-(  5REDLLYQw$T!BqD\4==A
CM++D,?,?@% ; ;$,,OLqL&&--b1rQ   c                   V P                   ^8  d   V P                  p\        VR4       \        V^ \	        V4      ^ VR7       V P
                  ^P8  d   \        RVR,          4      w  pV^ 8X  d$   \        RVR,          4      w  rE\        VRWE4       M?V^8X  d9   \        RVR,          4      w  pV^8X  d   R	pMV^8X  d   R
pMRp\        VRV4       \        R4      h)r
  z
FILEPASS:
)r   rv  rF  rt  r  :r
  NNz!weak XOR: key=0x%04x hash=0x%04x
:r_  r1  Nz	BIFF8 stdzBIFF8 strongz** UNKNOWN ENCRYPTION METHOD **z%s
zWorkbook is encrypted)r,   r+   r<   rx  rB   r;   r   r8   )rf   r  logfkind1key
hash_valuekind2captions   &&      rK   handle_filepassBook.handle_filepass  s    >>Q<<DD-($3t914@  B&d2h/A:&,UDH&=OCD<) aZ#D$s)4FEz"-!"0"CD&'2/00rQ   c                   \         ;'       g    V P                  ^8  pV P                  pV^28  d   R# V P                  4        \	        RVR,          4      w
  rErgrrr\        4       pWn        \        V P                  4      pWn	        V P                  P                  V4       WNn        . ROpV F"  w  ppp\        VVVV,          V,	          4       K$  	  RVP                  ,          pV^P8  d   \        V^V P                  VR7      w  ppM\!        V^VR7      w  ppWn        Wn        RVn        V'       d   \)        V P*                  RVVWFWxV	V4
       TpVP,                  '       d=   \.        P1                  VR4      pV'       d   \3        RV,          V P*                  R	7       VVn        VVR Vn        W~n        ^ Vn        V'       d(   VP=                  V P*                  R
V,          RR7       R# R# )r
  Nz	<HBBHHH4B:r      Nz M)	known_lenzZNAME[%d]:%s oflags=%d, name_len=%d, fmla_len=%d, extsht_index=%d, sheet_index=%d, name=%r
z??Unknown??z    builtin: %sr   z--- handle_name: name[%d] ---z-------------------rU   ))r{   re  r   )r|   r
  re  )r}   r_  r
  )r~   r      )r      r_  )r          )r   i  r1  )r   i      )r   r,   r;   r4  r   rN   rb   rB   r   r   r+  rn  setattrr~   unpack_string_update_posr6  rk  extn_sheet_numexcel_sheet_indexr   r<   r+   r   builtin_name_from_coder;  r   r   r   basic_formula_len	evaluatedre   )rf   r  rm  r<  rn  kb_shortcutname_lenfmla_lenextsht_indexsheet_indexmenu_text_lendescription_text_lenhelp_topic_text_lenstatus_bar_text_lennobjr   attrsattrmasknshift
macro_flaginternal_namer  r   s   &&                      rK   handle_nameBook.handle_name  s   ++!+7 ;T
+	
x<1Dv	++,
$!!$'(	
 #(D$D$!4 ?@ #( $**%
7!9$DMM]e!fM3!:4x!XM3*!,
mJ]	D
 <<<)--dMBDU,t3$,,G	:!)II6C,   rQ   c                   V P                   ^8  pV P                  pV'       dq   \        RVR7       \        R\        V P                  4      VR7       \        R\        V P
                  4      VR7       \        R\        V P                  4      VR7       \        V P                  4      p\        V4       F  pV P                  V,          pV P                  ^P8  dc   VP                  pV^ 8X  d   RpM^Tu;8:  d   \        V P                  4      8:  d(   M M$V P                  V^,
          ,          pVR8X  d   RpMdRpMa^2V P                  u;8:  d   ^F8:  dI   M MEVP                  pV^ 8X  d   RpM/V P
                  V,          pV P                  P                  VR4      pXVn        K  	  \        V4       F]  pV P                  V,          pVP                  '       g   VP                   '       d   K<  VP"                  '       d   KP  \%        WWAR7       K_  	  V P                   ^8  dZ   \        RVR7       \        V4       F0  pV P                  V,          pVP'                  VRV,          R	7       K2  	  \        R
VR7       / p	/ p
\        V4       F  pV P                  V,          pVP(                  P+                  4       pWP                  3pW9   d    V P                   '       d   \-        VRV4       WYV&   VP                  WE3pW9   d   W,          P/                  V4       K  V.W&   K  	  V
P1                  4        F5  pW,          pVP3                  4        V Uu. uF  q^,          NK  	  upW&   K7  	  Wn        Wn        R# u upi )r
  z+++++ names_epilogue +++++r   r   r   r   )rm  z&---------- name object dump ----------z--- name[%d] ---)rV   z&--------------------------------------z)Duplicate entry %r in name_and_scope_map
Nrs   )r,   r+   r   REPRr   r   r   rB   r   r   r;   r  r  r;  r   r~   r   r  evaluate_name_formulare   r   lowerr<   r+  keyssortname_and_scope_mapname_map)rf   rm  r   	num_namesnamexr  r  intl_sheet_indexr   r  r  
name_lcaser  	sort_dataalistxs   &               rK   names_epilogueBook.names_epilogue  s   ~~"LL.Q7#T$*>*>%?aH*D1L1L,MTUV($t/H/H*IPQR**+	9%E%%e,D
   B&"44!#')$+BT-A-A)BB'+';';KM'J$'2-+-( (*$t((.B."11!#')$!%!<!<[!IJ'+'@'@'D'DZQS'T$)DJ1 &4 9%E%%e,DzzzT[[[(~~~x!$e? & >>Q:Cy)))%0		!$6$>	? * :C  9%E%%e,D*Jzz*C(T^^^GM&*s#U1I %$++I6(1{$ & ==?CMEJJL+015aqTT51HM # #5  2s   Nc                0    \        R VR,          4      w  r#R# )rj  :r_  
   NNr
   )rf   r  obj_typeobj_ids   &&  rK   
handle_objBook.handle_obj7  s     "%d4&rQ   c           	        V P                   P                  R 4       \        ;'       g    V P                  ^8  pV'       d:   \	        RV P
                  R7       \        V^ \        V4      V P
                  R7       \        RVR,          4      ^ ,          pV'       d   \	        RV,          V P
                  R7       V P                  pV ;P                  ^,          un	        VR,          R8X  dw   \        V P                   R&   V P                  ^,
          V n        V'       dB   \	        R	WC3,          V P
                  R7       \	        R
V P                  V P
                  R7       R # VR,          R8X  dT   \        V P                   R&   V P                  ^,
          V n        V'       d   \	        RV,          V P
                  R7       R # \        V^^R7      w  rVV^ 8X  d5   \         V P                   R&   V'       d   \#        V P
                  RWE4       R # \$        V P                   R&   V'       d   \#        V P
                  RWE4       . p\'        V4       FP  p \        W^R7      w  rTP                  T	4       T'       g   K.  \#        T P
                  RT\        T	4      Y4       KR  	  R #   \(        P*                   d8    T P                  '       d!   \	        RYT3,          T P
                  R7         R # i ; i)NzSUPBOOK:r   ru  rF  rG  znum_sheets = %d:r
  r_  Ns   z(SUPBOOK[%d]: internal 3D refs; %d sheetsz    _all_sheets_mapr^  s    :zSUPBOOK[%d]: add-in functionsr/  z#SUPBOOK[%d]: DDE/OLE document = %r
zSUPBOOK[%d]: url = %r
zK*** WARNING: unpack failure in sheet %d of %d in SUPBOOK record for file %rz-  sheetx=%d namelen=%d name=%r (next pos=%d)
rs   )r   r+  r   r,   r   r+   rx  rB   r   r   SUPBOOK_INTERNALr   r   rl  r   rk  SUPBOOK_DDEOLEr<   SUPBOOK_EXTERNALr   structerror)
rf   r  rm  
num_sheetssbnurlr  r   r  shnames
   &&        rK   handle_supbookBook.handle_supbook>  sG   ""4(++!+*4<<0$3t94<<@D$s),Q/
(:5DLLI!!q 9#&6D#'+':':Q'>D$@CCTT[_[g[gh+T-A-AU9++&3D#'+':':Q'>D$U:S@t||T,T1Q??&4D#WT\\+QSV\"2B'@#Kz"A7!L v&tWT\\+[]^`cdj`kmsy # << 	 >>>e#./!\\
 	s   J$$&K0 K0/K0c                   V P                  4        \        R VR,          4      ^ ,          p\        V^V P                  ^R7      pV P                  pW0P
                  V,          8X  g   Q hV ;P                  ^,          un        V P                  pV^,
          \        V4      ,
          p\        '       d   \        V P                  RWFW#4       V P                  4        \        '       d)   \        RV P                  ,          V P                  R7       V P                  P                  R4       V P!                  VRR7       \        '       d#   \        R	V P                  V P                  R7       WR,           V n        R# )
<i:Nr_  Nr/  z'SHEETHDR %d at posn %d: len=%d name=%r
z SHEETHDR: xf epilogue flag is %dr   NF)r$  z"SHEETHDR: posn after get_sheet() =)r4  r   r5  r6  r   r?   r   rB   r   r<   r+   r   r   r  r@   r+  r   )rf   r  	sheet_lenr   r'  BOF_posnposns   &&     rK   handle_sheethdrBook.handle_sheethdrm  s   
 	4b*1-	"4DMM!D
&&..w7777!>>!|c$i'5'$,,(RT[cly##%5%:T=S=SSZ^ZfZfg%w515%<dnnSWS_S_`!-rQ   c                ~    \        R V4      ^ ,          p\        '       d   \        RW P                  R7       W n        R# )r  zSHEETSOFFSET:r   N)r   r   r   r+   r8  )rf   r  r  s   && rK   handle_sheetsoffsetBook.handle_sheetsoffset  s+    dD!!$5%LLA!rQ   c                   \         '       d"   \        R V P                  R7       \        4       p\	        V4      pV.p\        RVR,          4      ^ ,          p\         '       g   V P                  ^8  d   \        V P                  RV4        V P                  \        4      w  rgpVf   M=W7,          p\         ^8  d   \        V P                  RWs4       VP                  V4       K[  \        WE4      w  V n        pV P                  '       d   Wn        \         '       d3   \        4       p	\        RV	X,
          3,          V P                  R7       R# R# )zSST Processingr   r  r_  r   NzSST: unique strings: %d
Nz'CONTINUE: adding %d bytes to SST -> %d
z SST processing took %.2f seconds)r   r   r+   r   rB   r   r,   r<   r  rw  r+  unpack_SST_tabler   r/   r   )
rf   r  rF   nbtstrlistuniquestringsr  nb
rt_runlistrH   s
   &&        rK   
handle_sstBook.handle_sst  s    5"6B$i&tT#Y/25T^^q(DLL"=}M!>>{KNDd|ICz&PRTZNN4 *:7*R'Z*4'5B4R{BV rQ   c                   ^ pV P                   ^P8  d<   V P                  '       g   RV n        Wn        R# \	        V^ V P                  ^R7      pM \        V^ ^R7      pV'       d-   \        V P                  R\        V4      V P                  V4       VP                  4       pW0n        R#   \         d     \        TP                  4       ^ ^R7      p Lui ; i)r   TNr/  z!WRITEACCESS: %d bytes; raw=%s %r
)r;   r6  r   rU  r5  r:  UnicodeDecodeErrorstripr<   r+   rB   rV  )rf   r  r   rX  s   &&  rK   handle_writeaccessBook.handle_writeaccess  s    r!===%)"!% q$--BDA%dAa8 '$,,(LcRViY]YkYkmqr{{} & A%djjlAa@As   B* *'CCc                   \         P                  ! V 4        V P                  4       w  rp\        '       d   \	        RV,          V P
                  R7       V\        8X  d   V P                  V4       K\  V\        8X  g   V\        8X  d   V P                  V4       K  V\        8X  d   V P                  V4       K  V\        8X  d   V P                  V4       K  V\        8X  d   V P!                  V4       K  V\"        8X  d   V P%                  V4       K  V\&        8X  d   V P)                  V4       EK  V\*        8X  d   V P-                  V4       EK;  V\.        8X  d   V P1                  V4       EKZ  V\2        8X  d   V P5                  V4       EKy  V\6        8X  d   V P9                  V4       EK  V\:        8X  d   V P=                  V4       EK  V\>        8X  d   V PA                  V4       EK  V\B        8X  d   V PE                  V4       EK  V\F        8X  d   V PI                  V4       EK  V\J        8X  d   V PM                  V4       EK3  V\N        8X  d   V PQ                  V4       EKR  V\R        8X  d   V PU                  V4       EKq  V^,          ^	8X  dG   V PV                  '       d5   \Y        V P
                  RV PZ                  V,
          ^,
          WV4       EK  V\\        8X  d   V P_                  4        V Pa                  4        V Pc                  4        V Pd                  '       g   V Pg                  4        V Ph                  ^-8X  d/   \        '       d#   \	        RV PZ                  V P
                  R7       R# EKf  )re  z$parse_globals: record code is 0x%04xr   z5*** Unexpected BOF at posn %d: 0x%04x len=%d data=%r
zglobal EOF: positionN)5r   r*  r  r   r   r+   XL_SSTr  XL_FONTXL_FONT_B3B4handle_font	XL_FORMAThandle_formatXL_XF	handle_xfXL_BOUNDSHEETrC  XL_DATEMODErg  XL_CODEPAGEr[  
XL_COUNTRYrb  XL_EXTERNNAMErq  XL_EXTERNSHEETr  XL_FILEPASSr  XL_WRITEACCESSr  XL_SHEETSOFFSETr  XL_SHEETHDRr  
XL_SUPBOOKr  XL_NAMEr  
XL_PALETTEhandle_paletteXL_STYLEhandle_styler,   r<   r   XL_EOFxf_epiloguer  palette_epiloguer6  r4  r;   )rf   rcr  r  s   &   rK   r>   Book.parse_globals  sw    	""4(#446BueBRGdll[V|%w""4  &y""4(ut$%&&t,{"$$T*{"$$T*z!##D)}$&&t,~%''-{"$$T*~%''-&((.{"$$T*z!##D)w  &z!##D)x!!$'daDNNN&^NNV+a/TC  "##%%%'}}}((*$$*ue$:DNNQUQ]Q]^  rQ   c                ^    V P                   WV,            pV\        V4      ,           V n        V# r   )r   rB   r   )rf   r  r  r  s   &&& rK   r   	Book.read  s(    xxJ's4yrQ   c           
     X   \         '       d   \        R V,          V P                  R7       R pV P                  pV P	                  4       pV\
        8X  d	   V! R4       V\        9  d#   V! RV P                  W3^,            ,          4       V P	                  4       pV\
        8X  d	   V! R4       ^Tu;8:  d   ^8:  g   M V! RWT3,          4       R\        ^ \        V,          V,
          4      ,          pV P                  V P                  V4      p\         '       d   \        V P                  RV4       \        V4      V8  d	   V! R	4       Wv,          pV^,	          p\        R
VR,          4      w  r\         '       d!   \        RWIV
3,          V P                  R7       V P                  ^,
          V,
          p\         '       d    \        RW3,          V P                  R7       ^ ;p;rV^8X  dX   \        R
VR,          4      w  rV	R8X  d   ^PpMNV	R8X  d   VR8  g   VR9   d   ^2pM6^FpM3^ ^^^R^R^R^(/P                  V	^ 4      pMVR9   d   ^^(^^^ ^/V,          pV^(8X  d   V
\        8X  d   ^-p\         '       g   V P                   ^8  d"   \        RWIWW3,          V P                  R7       V
\"        8H  ;'       g    V^-8H  ;'       d
    V
\        8H  pV\"        8X  d	   V'       g   W8X  d   V# V^28  d   V
\$        8X  d   V# V^28  d   V
R8X  d	   V! R4       V! RWIWW3,          4       R# )zreqd: 0x%04xr   c                 &    \        R V ,           4      h)z%Unsupported format, or corrupt file: )r8   )r  s   &rK   	bof_errorBook.getbof.<locals>.bof_error  s    CcIJJrQ   z$Expected BOF record; met end of filezExpected BOF record; found %rz)Incomplete BOF record[1]; met end of filez.Invalid length (%d) for BOF record type 0x%04x    z
getbof(): data=%r
z)Incomplete BOF record[2]; met end of filer  r^  z5getbof(): op=0x%04x version2=0x%04x streamtype=0x%04xz+getbof(): BOF found at offset %d; savpos=%dr  i   i   i  i   i   i   zHBOF: op=0x%04x vers=0x%04x stream=0x%04x buildid=%d buildyr=%d -> BIFF%d   z%Workspace file -- no spreadsheet datazXBOF not workbook/worksheet: op=0x%04x vers=0x%04x strm=0x%04x build=%d year=%d -> BIFF%dN)il	  i  i  )r_  r
  r   )r   r   r+   r   r  r  bofcodesr   rm   boflenr   r<   rB   r   r;  XL_WORKBOOK_GLOBALS_4Wr,   r7   r!  )rf   
rqd_streamr  savposopcoder  paddingr  version1version2
streamtype
bof_offsetversionbuildyeargot_globalss   &&              rK   r6   Book.getbof  s    5%3$,,G	K!V<=!5q8QQR!VABV!r!@"#$ #a&!899yy05'$,,(?Ft9vABQ;%eT#Y75IZ017;||E^^a'&0
5?&'-1\\;!"""%t S	2KE6!V#$;%+="= G G BBBBB #h"  ++Rr44X>Gb=Z+AAG5DNNa'\ZFGMQ\\[ $77 D DrMBBj,BB 	--+*BZNR<J,6Nb=Z61=>fDBC	
rQ   )7r   r   r   r   r   r   r   r   r   r   r   r@   r?   r   r   r   r8  r   r   r   r   r  r  r  r   r   r   rO  r   ra  rf  r6  r.   r   r  r  r   r/   r+   r   r  r  r   rC   r0   r   r1   r   r   r   r-   rU  r,   r   r  r`  g      rt   )Eru   rv   rw   rx   ry   rC   rf  r;   r   rO  r6  ra  r   rU  r  r   r  r   r   r   r   r5   rD   r   rc   r   r   r   r   r   r   rE   r   r   r  r  r   sysstdoutr4   r   r  r  r  r   rA   r=   rC  rH  r4  r[  rb  rg  rq  r  r  r  r  r  r  r  r  r  r  r>   r   r6   r   r   r   s   @rK   r3   r3     s     G H
 L M H H I  #I I G K J: N  J N  	#B)	+	,$. (+.!  HB %) ZZ1t'+%*$!&057rr	4$	$*$29h/+Z#!T12f1.:xH!T5-z^.*"W2$>@
J
 J
rQ   r3   c                     T pVR ,          '       d   VR 8  d
   VR,          p^pM^ pV^,          pVR,          '       d   V^8  d
   VR,          p^pM^ pW$W53# )i   i   i @  r  rr   )inrowincoloutrowrelrowoutcolrelcols   &&    rK   expand_cell_addressr1  F  sa    Fv~~U?eOFT\Fv~~S=cMF6))rQ   c                     V ^ 8  g   Q h\        R4      p \        V ^4      w  r4W,          V,           pV'       g   V# V^,
          p K3  )r   rP   )r   divmod)colx_A2Zr   quotrems   &&   rK   colnamer8  X  sF    1992D
4$	y4KaxrQ   c                    V'       d    R RV ^ 8  ,          \        V 4      3,          pMRV ^,           3,          pV'       d'   R RV^ 8  ,          \        V4      3,          pWT,           # R\        V4      ,           pWT,           # )z(*%s%d)z+-z$%d$)absr8  )rowxr4  r.  r0  rowpartcolparts   &&&&  rK   display_cell_addressr?  b  sr    tD1H~s4y9946)#tD1H~s4y99  %rQ   c                l   ^ p\        V 4      pV ^ ,          p\        V4      p^p. pVP                  p/ p	\        p
\        p\        pRp\        V4       EFU  pV
! RWFV^,            4      ^ ,          pV^,          pV! WF,          4      pV^,          p^ p^ pV^,          '       d#   V
! RWFV^,            4      ^ ,          pV^,          pV^,          '       d#   V
! RWFV^,            4      ^ ,          pV^,          p\        R4      p^ p VV,
          pV^,          '       dN   V! WV,
          ^,	          V4      pWFV^V,          ,            p V\        VR4      ,          pT^T,          ,          pM6V! WV,
          V4      pWFVV,            pV\        VV4      ,          pVV,          pVV,          pVV8X  d   M/V^,          pW,          p\        V4      pV! V^ ,          4      p^pK  V'       dq   . p\        V4       FQ  pWe8X  d   ^ pV^,          pW,          p\        V4      pVP                  V
! RWFV^,            4      4       V^,          pKS  	  VV	\        V4      &   VV,          pWe8  d;   We,
          pV^,          pW#8  d   W,          p\        V4      pMW^,
          8X  g   Q hV! V4       EKX  	  Wy3#    h ; i)zReturn list of stringslatin_1rF  r  rP   rL  r  )rB   r+  r   rk   r  r   r   rR  )datatabnstringsdatainxndatasr  datalenr  strings	strappendrichtext_runslocal_unpack	local_minlocal_BYTES_ORDrA  	_unused_incharsoptionsrtcountphoszaccstrgcharsgot	charsneed
charsavailrawstrgrunsrunindexs   &&                        rK   r  r  m  s   G\F1:D$iG
CGIMLIOGH%	dDSUO4Q7q!$),qT>>"4#a%9!<G1HCT>> tA7:E1HC!"%)I~~&!';YG
3q|#34ww<<G q|# 'w}i@
3z>277G44z!
"H6!qLG#D$iG%d1g.GCD"7O>CqLG"+D!$iGLQ@Aq , +/M#g,'u>-CqLG'd) qL000'M &N !!_ s   J00J3)P   F   2   -   (            )ABCDEFGHIJKLMNOPQRSTUVWXYZ)+
__future__r   r  rP   r   r   r   biffhformulatimemachinetimer   ImportErrorr	   r   
empty_cellr   r   r  r   SUPBOOK_UNKr  r  rl  r  r9   _code_from_builtin_namer  code_from_builtin_nameitems_bin_bicr   r(  r)  rL   
BaseObjectrN   r3   r1  r8  r?  r  rr   rQ   rK   <module>rp     sw  
 &  ( (   +!
 
	 	QVWXQY N/5       )//1JD$4 D4 D#'4 #'4 	 2
 	$'#!jjA$((,&+u%16AHL`: L`^t
: t
p!*$	U"{*  +*+s   C- -C=<C=