§
    r�’jm  ã            
       ód  — d dl Z d dlZd dlZd dlZddlmZ ddlmZmZm	Z	m
Z
mZmZmZmZmZmZ ddlmZmZmZ ddlmZ ddlT ddlmZmZ dd	lmZ dd
lmZm Z m!Z! dddddddœZ"dZ# e$ e%e¦  «         e%e#¦  «        ¦  «        Z&dd„Z'dej(        d dddddddf
d„Z)ej(        dfd„Z*ej(        fd„Z+dS )é    Né   )Útimemachine)
ÚXL_CELL_BLANKÚXL_CELL_BOOLEANÚXL_CELL_DATEÚXL_CELL_EMPTYÚXL_CELL_ERRORÚXL_CELL_NUMBERÚXL_CELL_TEXTÚ	XLRDErrorÚbiff_text_from_numÚerror_text_from_code)ÚBookÚcolnameÚopen_workbook_xls)Ú	SIGNATURE)Ú*)Ú__VERSION__Ú__version__)Ú
empty_cell)ÚXLDateErrorÚxldate_as_datetimeÚxldate_as_tuplez	Excel xlszExcel 2007 xlsb filezExcel xlsx filezOpenoffice.org ODS filezUnknown ZIP filezUnknown file type)ÚxlsÚxlsbÚxlsxÚodsÚzipNs   PKc                 ó  — |r|dt           …         }nat          j                             | ¦  «        } t	          | d¦  «        5 }|                     t           ¦  «        }ddd¦  «         n# 1 swxY w Y   |                     t          ¦  «        rdS |                     t          ¦  «        r\t          j
        |rt          j        |¦  «        n| ¦  «        }d„ |                     ¦   «         D ¦   «         }d|v rdS d|v rdS d	|v rd
S dS dS )a\  
    Inspect the content at the supplied path or the :class:`bytes` content provided
    and return the file's type as a :class:`str`, or ``None`` if it cannot
    be determined.

    :param path:
      A :class:`string <str>` path containing the content to inspect.
      ``~`` will be expanded.

    :param content:
      The :class:`bytes` content to inspect.

    :returns:
       A :class:`str`, or ``None`` if the format cannot be determined.
       The return value can always be looked up in :data:`FILE_FORMAT_DESCRIPTIONS`
       to return a human-readable description of the format found.
    NÚrbr   c                 ó`   — i | ]+}|                      d d¦  «                             ¦   «         |“Œ,S )ú\ú/)ÚreplaceÚlower)Ú.0Únames     ú;C:\Projects\DSCons\.venv\Lib\site-packages\xlrd\__init__.pyú
<dictcomp>z"inspect_format.<locals>.<dictcomp>H   sD   € ð 6ð 6ð 6Ø#ð  Ÿ<š<¨¨cÑ2Ô2×8Ò8Ñ:Ô:¸Dð 6ð 6ð 6ó    zxl/workbook.xmlr   zxl/workbook.binr   zcontent.xmlr   r   )Ú	PEEK_SIZEÚosÚpathÚ
expanduserÚopenÚreadÚ
startswithÚXLS_SIGNATUREÚZIP_SIGNATUREÚzipfileÚZipFiler   ÚBYTES_IOÚnamelist)r-   ÚcontentÚpeekÚfÚzfÚcomponent_namess         r(   Úinspect_formatr=   &   s^  € ð$ ð %Ø�z�	�zÔ"ˆˆåŒw×!Ò! $Ñ'Ô'ˆÝ�$˜ÑÔð 	% Ø—6’6�)Ñ$Ô$ˆDð	%ð 	%ð 	%ñ 	%ô 	%ð 	%ð 	%ð 	%ð 	%ð 	%ð 	%øøøð 	%ð 	%ð 	%ð 	%ð ‡‚•}Ñ%Ô%ð Øˆuà‡‚•}Ñ%Ô%ð ÝŒ_¸gÐO�[Ô1°'Ñ:Ô:Ð:È4ÑPÔPˆð
6ð 6Ø')§{¢{¡}¤}ð6ñ 6ô 6ˆð  Ð/Ð/Ø�6Ø Ð/Ð/Ø�6Ø˜OÐ+Ð+Ø�5Øˆuðð s   ÁA)Á)A-Á0A-TFc
                 ó¢   — t          | |¦  «        }
|
r#|
dk    rt          t          |
         dz   ¦  «        ‚t          | |||||||||	¬¦
  «
        }|S )a¢	  
    Open a spreadsheet file for data extraction.

    :param filename: The path to the spreadsheet file to be opened.

    :param logfile: An open file to which messages and diagnostics are written.

    :param verbosity: Increases the volume of trace material written to the
                      logfile.

    :param use_mmap:

      Whether to use the mmap module is determined heuristically.
      Use this arg to override the result.

      Current heuristic: mmap is used if it exists.

    :param file_contents:

      A string or an :class:`mmap.mmap` object or some other behave-alike
      object. If ``file_contents`` is supplied, ``filename`` will not be used,
      except (possibly) in messages.

    :param encoding_override:

      Used to overcome missing or bad codepage information
      in older-version files. See :doc:`unicode`.

    :param formatting_info:

      The default is ``False``, which saves memory.
      In this case, "Blank" cells, which are those with their own formatting
      information but no data, are treated as empty by ignoring the file's
      ``BLANK`` and ``MULBLANK`` records.
      This cuts off any bottom or right "margin" of rows of empty or blank
      cells.
      Only :meth:`~xlrd.sheet.Sheet.cell_value` and
      :meth:`~xlrd.sheet.Sheet.cell_type` are available.

      When ``True``, formatting information will be read from the spreadsheet
      file. This provides all cells, including empty and blank cells.
      Formatting information is available for each cell.

      Note that this will raise a NotImplementedError when used with an
      xlsx file.

    :param on_demand:

      Governs whether sheets are all loaded initially or when demanded
      by the caller. See :doc:`on_demand`.

    :param ragged_rows:

      The default of ``False`` means all rows are padded out with empty cells so
      that all rows have the same size as found in
      :attr:`~xlrd.sheet.Sheet.ncols`.

      ``True`` means that there are no empty cells at the ends of rows.
      This can result in substantial memory savings if rows are of widely
      varying sizes. See also the :meth:`~xlrd.sheet.Sheet.row_len` method.


    :param ignore_workbook_corruption:

      This option allows to read corrupted workbooks.
      When ``False`` you may face CompDocError: Workbook corruption.
      When ``True`` that exception will be ignored.

    :returns: An instance of the :class:`~xlrd.book.Book` class.
    r   z; not supported)
ÚfilenameÚlogfileÚ	verbosityÚuse_mmapÚfile_contentsÚencoding_overrideÚformatting_infoÚ	on_demandÚragged_rowsÚignore_workbook_corruption)r=   r   ÚFILE_FORMAT_DESCRIPTIONSr   )r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   Úfile_formatÚbks               r(   Úopen_workbookrL   T   s|   € õd ! ¨=Ñ9Ô9€Kð ð Q�{ eÒ+Ð+ÝÕ0°Ô=Ð>OÑOÑPÔPÐPå	ØØØØØ#Ø+Ø'ØØØ#=ð
ñ 
ô 
€Bð €Ir*   c                 óš   — ddl m} t          ¦   «         }|                     | |¬¦  «          ||j        |j        |j        d||¦  «         dS )a  
    For debugging: dump an XLS file's BIFF records in char & hex.

    :param filename: The path to the file to be dumped.
    :param outfile: An open file, to which the dump is written.
    :param unnumbered: If true, omit offsets (for meaningful diffs).
    r   )Ú	biff_dump©r?   r@   r   N)ÚbiffhrN   r   Úbiff2_8_loadÚmemÚbaseÚ
stream_len)r?   ÚoutfileÚ
unnumberedrN   rK   s        r(   ÚdumprW   ¼   s[   € ð !Ð Ð Ð Ð Ð Ý	‰Œ€BØ‡O‚O˜X¨w€OÑ9Ô9Ð9Ø€IˆbŒf�b”g˜rœ}¨a°¸*ÑEÔEÐEÐEÐEr*   c                 ó–   — ddl m} t          ¦   «         }|                     | |¬¦  «          ||j        |j        |j        |¦  «         dS )a  
    For debugging and analysis: summarise the file's BIFF records.
    ie: produce a sorted file of ``(record_name, count)``.

    :param filename: The path to the file to be summarised.
    :param outfile: An open file, to which the summary is written.
    r   )Úbiff_count_recordsrO   N)rP   rY   r   rQ   rR   rS   rT   )r?   rU   rY   rK   s       r(   Úcount_recordsrZ   Ê   sX   € ð *Ð)Ð)Ð)Ð)Ð)Ý	‰Œ€BØ‡O‚O˜X¨w€OÑ9Ô9Ð9ØÐ�r”v˜rœw¨¬°wÑ?Ô?Ð?Ð?Ð?r*   )NN),r,   ÚpprintÚsysr4   Ú r   rP   r   r   r   r   r	   r
   r   r   r   r   Úbookr   r   r   Úcompdocr   r2   ÚformulaÚinfor   r   Úsheetr   Úxldater   r   r   rI   r3   ÚmaxÚlenr+   r=   ÚstdoutrL   rW   rZ   © r*   r(   ú<module>rh      s$  ðð 
€	€	€	Ø €€€Ø 
€
€
€
Ø €€€à Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð
 3Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø /Ð /Ð /Ð /Ð /Ð /Ø Ð Ð Ð Ø *Ð *Ð *Ð *Ð *Ð *Ð *Ð *Ø Ð Ð Ð Ð Ð Ø DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ Dð
 Ø"ØØ$ØØ
ðð Ð ð €àˆC���MÑ"Ô" C C¨Ñ$6Ô$6Ñ7Ô7€	ð+ð +ð +ð +ð\  Øœ*ØØØ $Ø$(Ø"'Ø!Ø#Ø-2ðeð eð eð eðP œ:°%ð Fð Fð Fð Fð %(¤Jð @ð @ð @ð @ð @ð @r*   