����JFIF���������
1#@!#!123s
D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
proc
/
self
/
root
/
opt
/
alt
/
python34
/
lib64
/
python3.4
/
__pycache__
/
Filename :
zipfile.cpython-34.pyc
back
Copy
� j f���������������$���@���s��d��Z��d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l �Z �d�d�l �Z �d�d�l�Z�y�d�d�l�Z�e�j �Z �Wn!�e�k �r��d�Z�e�j �Z �Yn�Xy�d�d�l�Z�Wn�e�k �r��d�Z�Yn�Xy�d�d�l�Z�Wn�e�k �rd�Z�Yn�Xd�d�d�d�d�d�d �d �d�d�d �d�g�Z�Gd�d����d�e���Z�Gd�d����d�e���Z�e�Z�Z�d�d�>d�Z�d�d�>d�Z�d�d�>d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z �d�Z!�d�Z"�d�Z#�d�Z$�e �j%�e#���Z&�d�Z'�d�Z(�d�Z)�d�Z*�d�Z+�d �Z,�d!�Z-�d"�Z.�d�Z/�d#�Z0�d$�Z1�d%�Z2�e �j%�e1���Z3�d�Z4�d�Z5�d�Z6�d�Z7�d�Z8�d �Z9�d!�Z:�d"�Z;�d�Z<�d#�Z=�d&�Z>�d'�Z?�d�Z@�d(�ZA�d�ZB�d)�ZC�d�ZD�d*�ZE�d+�ZF�d,�ZG�d-�ZH�e �j%�eG���ZI�d�ZJ�d�ZK�d�ZL�d�ZM�d�ZN�d �ZO�d!�ZP�d"�ZQ�d�ZR�d#�ZS�d&�ZT�d'�ZU�d.�ZV�d/�ZW�e �j%�eV���ZX�d0�ZY�d1�ZZ�e �j%�eY���Z[�d�Z\�d�Z]�d�Z^�d�Z_�d�Z`�d �Za�d!�Zb�d"�Zc�d�Zd�d#�Ze�d2�d3����Zf�d4�d ����Zg�d5�d6����Zh�d7�d8����Zi�Gd9�d����d�ej���Zk�Gd:�d;����d;���Zl�Gd<�d=����d=���Zm�Gd>�d?����d?���Zn�i�d@�d�6dA�d�6dB�d�6dB�d�6dB�d�6dB�d �6dC�d!�6dD�d"�6dE�d�6dF�d#�6dC�d&�6dG�d�6dH�d�6dI�d+�6dJ�dK�6dL�dM�6dN�dO�6Zo�dP�dQ����Zp�dR�dS����Zq�dT�dU����Zr�GdV�dW����dW�e�js���Zt�GdX�d����d���Zu�GdY�d ����d �eu���Zv�d�dZ�d[���Zw�ex�d\�k�rew����n��d�S)]zP Read and write ZIP files. XXX references to utf-8 need further investigation. �����N� BadZipFile� BadZipfile�error� ZIP_STORED�ZIP_DEFLATED� ZIP_BZIP2�ZIP_LZMA� is_zipfile�ZipInfo�ZipFile� PyZipFile�LargeZipFilec���������������@���s���e��Z�d��Z�d�S)r���N)�__name__� __module__�__qualname__��r���r����,/opt/alt/python34/lib64/python3.4/zipfile.pyr���'���s���c���������������@���s���e��Z�d��Z�d�Z�d�S)r ���zu Raised when writing a zipfile, the zipfile requires ZIP64 extensions and those extensions are disabled. N)r���r���r����__doc__r���r���r���r���r ���+���s��������������������������������-����.����?���s���<4s4H2LHs���PK������������������������� ���z<4s4B4HL2L5H2Ls���PK� �������� ���������������z<4s2B4HL2L2Hs���PKz<4sLQLs���PKz <4sQ2H2L4Qs���PKc�������������C���s-���y�t��|����r�d�SWn�t�k �r(�Yn�Xd�S)NTF)�_EndRecData�OSError)�fpr���r���r����_check_zipfile����s���� r.���c�������������C���sh���d�}�yI�t��|��d���r*�t�d�|����}�n$�t�|��d�����}�t�|���}�Wd�QXWn�t�k �rc�Yn�X|�S)z�Quickly see if a file is a ZIP file by checking the magic number. The filename argument may be a file or file-like object too. F�readr-����rbN)�hasattrr.����openr,���)�filename�resultr-���r���r���r���r �������s���� c�������������C���sr��y�|��j��|�t�d���Wn�t�k �r0�|�SYn�X|��j�t���}�t�|���t�k�rV�|�St�j�t�|���\�}�}�}�}�|�t�k�r��|�S|�d�k�s��|�d�k�r��t �d�����n��|��j��|�t�t �d���|��j�t ���}�t�|���t �k�r��|�St�j�t�|���\ �}�}�} �} �}�}�} �}�}�}�|�t�k�r(|�S|�|�t �<|�|�t�<|�|�t�<| �|�t�<|�|�t�<|�|�t�<|�|�t�<|�S)zM Read the ZIP64 end-of-archive records and use that to update endrec r���r���r���z3zipfiles that span multiple disks are not supported)�seek�sizeEndCentDir64Locatorr,���r/����len�struct�unpack�structEndArchive64Locator�stringEndArchive64Locatorr����sizeEndCentDir64�structEndArchive64�stringEndArchive64�_ECD_SIGNATURE�_ECD_DISK_NUMBER�_ECD_DISK_START�_ECD_ENTRIES_THIS_DISK�_ECD_ENTRIES_TOTAL� _ECD_SIZE�_ECD_OFFSET)�fpin�offset�endrec�dataZsigZdisknoZreloffZdisksZsz�create_versionZread_versionZdisk_numZdisk_dirZdircountZ dircount2ZdirsizeZ diroffsetr���r���r���� _EndRecData64����s6���� 0 rK���c������� ������C���s���|��j��d�d���|��j����}�y�|��j��t�d���Wn�t�k �rI�d�SYn�X|��j����}�t�|���t�k�r��|�d�d���t�k�r��|�d �d���d�k�r��t�j�t �|���}�t �|���}�|�j�d���|�j�|�t���t�|��t�|���St �|�d �t�d���}�|��j��|�d���|��j����}�|�j�t���}�|�d�k�r�|�|�|�t���}�t�|���t�k�rYd�St �t�j�t �|�����}�|�t�}�|�|�t�|�t�|���}�|�j�|���|�j�|�|���t�|��|�|�|�|���Sd�S)z�Return data from the "End of Central Directory" record, or None. The data is a list of the nine items in the ZIP "End of central dir" record followed by a tenth item, the file seek offset of this record.r���r���Nr ���s����������r���r������i���)r5����tell�sizeEndCentDirr,���r/���r7����stringEndArchiver8���r9����structEndArchive�list�appendrK����max�rfind�_ECD_COMMENT_SIZE) rF���ZfilesizerI���rH���ZmaxCommentStart�startZrecDataZcommentSize�commentr���r���r���r+�������s>���� r+���c���������������@���sU���e��Z�d��Z�d�Z�d"�Z�d�d#�d�d���Z�d�d�d���Z�d�d����Z�d �d!����Z�d�S)$r ���z>Class with attributes describing each file in the ZIP archive.� orig_filenamer3���� date_time� compress_typerX����extra� create_systemrJ����extract_version�reserved� flag_bits�volume� internal_attr� external_attr� header_offset�CRC� compress_size� file_size� _raw_timeZNoName���r���r���c�������������C���s&��|�|��_��|�j�t�d�����}�|�d�k�r=�|�d�|���}�n��t�j�d�k�rs�t�j�|�k�rs�|�j�t�j�d���}�n��|�|��_�|�|��_�|�d�d�k��r��t�d�����n��t �|��_ �d�|��_�d�|��_�t �j�d�k�r��d�|��_�n �d�|��_�t�|��_�t�|��_�d�|��_�d�|��_�d�|��_�d�|��_�d�|��_�d��S)Nr����/i���z+ZIP does not support timestamps before 1980rL����win32r���)rY����find�chr�os�sep�replacer3���rZ���� ValueErrorr���r[���rX���r\����sys�platformr]����DEFAULT_VERSIONrJ���r^���r_���r`���ra���rb���rc���)�selfr3���rZ���Z null_byter���r���r����__init__<��s.���� zZipInfo.__init__Nc�������������C���s��|��j��}�|�d�d�d�>|�d�d�>B|�d�B}�|�d�d�>|�d �d�>B|�d�d�B}�|��j�d �@rs�d�}�}�}�n�|��j�}�|��j�}�|��j�}�|��j�}�d�} �|�d�k�r��|�t�k�p��|�t�k�}�n��|�r��d�} �|�t�j�| �d�t�j �| ���d �|�|���}�n��|�t�k�s|�t�k�rA|�s,t �d �����n��d�}�d�}�t�} �n��|��j�t �k�rbt�t�| ���} �n!�|��j�t�k�r�t�t�| ���} �n��t�| �|��j���|��_�t�| �|��j���|��_�|��j����\�}�}�t�j�t�t�|��j�|��j�|�|��j�|�|�|�|�|�t�|���t�|���� �} �| �|�|�S)z'Return the per-file header as a string.r���i���r$���r���r!���r���r���r&���r ���r���Nz<HHQQz'Filesize would require ZIP64 extensionsl������)rZ���r`���re���rf���rg���r\����ZIP64_LIMITr8����pack�calcsizer ���� ZIP64_VERSIONr[���r���rT���� BZIP2_VERSIONr����LZMA_VERSIONr^���rJ����_encodeFilenameFlags�structFileHeader�stringFileHeaderr_���r7���)ru����zip64�dt�dosdate�dostimere���rf���rg���r\����min_version�fmtr3���r`����headerr���r���r���� FileHeaderf��sF���� && # zZipInfo.FileHeaderc�������������C���sS���y�|��j��j�d���|��j�f�SWn/�t�k �rN�|��j��j�d���|��j�d�Bf�SYn�Xd��S)N�asciizutf-8i���)r3����encoder`����UnicodeEncodeError)ru���r���r���r���r}������s���� zZipInfo._encodeFilenameFlagsc�������������C���s���|��j��}�t�j�}�x�t�|���d�k�r�|�d�|�d��d�����\�}�}�|�d�k�r|�d�k�rz�|�d�|�d�d�����}�nx�|�d�k�r��|�d�|�d�d �����}�nP�|�d �k�r��|�d�|�d�d�����}�n(�|�d �k�r��f��}�n�t�d�|�f�����d �}�|��j�d�k�r!|�|�|��_�|�d�7}�n��|��j�d�k�rJ|�|�|��_�|�d�7}�n��|��j�d�k�r|��j�}�|�|�|��_�|�d�7}�qn��|�|�d�d����}�q�Wd��S)Nr ���z<HHr�������z<QQQ����r���z<QQr���r���z<Qr���r���zCorrupt extra field %s����������������)r����r����)r\���r8���r9���r7����RuntimeErrorrg���rf���rd���)ru���r\���r9���Ztp�lnZcounts�idx�oldr���r���r����_decodeExtra���s4���� zZipInfo._decodeExtra)z orig_filenamezfilenamez date_timez compress_typezcommentzextraz create_systemzcreate_versionzextract_versionzreservedz flag_bitszvolumez internal_attrz external_attrz header_offsetzCRCz compress_sizez file_sizez _raw_time)ri���r���r���r���r���r���) r���r���r���r���� __slots__rv���r����r}���r����r���r���r���r���r ���#��s0���������������������*.c���������������@���sX���e��Z�d��Z�d�Z�d�d����Z�d�Z�d�d����Z�d�d����Z�d �d ����Z�d�d����Z �d�S) � _ZipDecryptera��Class to handle decryption of files stored within a ZIP archive. ZIP supports a password-based form of encryption. Even though known plaintext attacks have been found against it, it is still useful to be able to get data out of such a file. Usage: zd = _ZipDecrypter(mypwd) plain_char = zd(cypher_char) plain_text = map(zd, cypher_text) c��������������C���s����d�}��d�g�d�}�xh�t��d���D]Z�}�|�}�xA�t��d���D]3�}�|�d�@r^�|�d�?d�@|��A}�q9�|�d�?d�@}�q9�W|�|�|�<q �W|�S)z�Generate a CRC-32 table. ZIP encryption uses the CRC32 one-byte primitive for scrambling some internal keys. We noticed that a direct implementation is faster than relying on binascii.crc32(). l��� q[�r�������r���r���i���)�range)Zpoly�table�i�crc�jr���r���r����_GenerateCRCTable���s���� z_ZipDecrypter._GenerateCRCTableNc�������������C���s���|�d�?d�@|��j��|�|�Ad�@AS)z(Compute the CRC32 primitive on one byte.r���i��������)�crctable)ru���Zchr����r���r���r����_crc32���s����z_ZipDecrypter._crc32c�������������C���s^���t��j�d��k�r!�t��j����t��_�n��d�|��_�d�|��_�d�|��_�x�|�D]�}�|��j�|���qC�Wd��S)NixV4i�gE#i�xV4)r����r����r�����key0�key1�key2�_UpdateKeys)ru����pwd�pr���r���r���rv������s���� z_ZipDecrypter.__init__c�������������C���sr���|��j��|�|��j���|��_�|��j�|��j�d�@d�@|��_�|��j�d�d�d�@|��_�|��j��|��j�d�?d�@|��j���|��_�d��S)Nr����l������i�r���r����)r����r����r����r����)ru����cr���r���r���r�������s����z_ZipDecrypter._UpdateKeysc�������������C���sM���t��|�t���s�t���|��j�d�B}�|�|�|�d�Ad�?d�@A}�|��j�|���|�S)zDecrypt a single character.r���r���r���r����)� isinstance�int�AssertionErrorr����r����)ru���r�����kr���r���r����__call__���s ���� z_ZipDecrypter.__call__) r���r���r���r���r����r����r����rv���r����r����r���r���r���r���r�������s��� r����c���������������@���s@���e��Z�d��Z�d�d����Z�d�d����Z�d�d����Z�d�d����Z�d �S) �LZMACompressorc�������������C���s ���d��|��_��d��S)N)�_comp)ru���r���r���r���rv������s����zLZMACompressor.__init__c�������������C���sf���t��j�i�t��j�d�6��}�t��j�t��j�d�t��j�t��j�|���g��|��_�t�j�d�d�d�t �|�����|�S)N�id�filtersz<BBHr$���r ���) �lzmaZ_encode_filter_properties�FILTER_LZMA1r����� FORMAT_RAW�_decode_filter_propertiesr����r8���rx���r7���)ru���Zpropsr���r���r����_init��s����zLZMACompressor._initc�������������C���s9���|��j��d��k�r)�|��j����|��j��j�|���S|��j��j�|���S)N)r����r�����compress)ru���rI���r���r���r���r������s����zLZMACompressor.compressc�������������C���s3���|��j��d��k�r&�|��j����|��j��j����S|��j��j����S)N)r����r�����flush)ru���r���r���r���r���� ��s����zLZMACompressor.flushN)r���r���r���rv���r����r����r����r���r���r���r���r�������s���r����c���������������@���s(���e��Z�d��Z�d�d����Z�d�d����Z�d�S)�LZMADecompressorc�������������C���s���d��|��_��d�|��_�d�|��_�d��S)NrL���F)�_decomp�_unconsumed�eof)ru���r���r���r���rv�����s���� zLZMADecompressor.__init__c���������� ���C���s����|��j��d��k�r��|��j�|�7_�t�|��j���d�k�r7�d�St�j�d�|��j�d�d�����\�}�t�|��j���d�|�k�rv�d�St�j�t�j�d�t�j�t�j �|��j�d�d�|�����g��|��_��|��j�d�|�d����}�|��`�n��|��j��j �|���}�|��j��j�|��_�|�S)Nr ���rL���z<Hr���r����)r����r����r7���r8���r9���r����r����r����r����r����� decompressr����)ru���rI���Zpsizer4���r���r���r���r������s����"# zLZMADecompressor.decompressN)r���r���r���rv���r����r���r���r���r���r������s���r����ZstoreZshrink�reduceZimplode�tokenizeZdeflateZ deflate64Zbzip2r����ZterseZlz77����Zwavpack�a���Zppmd�b���c�������������C���s����|��t��k�r�nx�|��t�k�r3�t�s��t�d�����q��nT�|��t�k�rW�t�s��t�d�����q��n0�|��t�k�r{�t�s��t�d�����q��n�t�d�����d��S)Nz.Compression requires the (missing) zlib modulez-Compression requires the (missing) bz2 modulez.Compression requires the (missing) lzma modulez(That compression method is not supported)r���r����zlibr����r����bz2r���r����)�compressionr���r���r����_check_compressionC��s����r����c�������������C���sV���|��t��k�r%�t�j�t�j�t�j�d���S|��t�k�r;�t�j����S|��t�k�rN�t ����Sd��Sd��S)Nr(���i�) r���r����ZcompressobjZZ_DEFAULT_COMPRESSIONZDEFLATEDr���r����Z BZ2Compressorr���r����)r[���r���r���r����_get_compressorV��s���� r����c�������������C���s����|��t��k�r�d��S|��t�k�r)�t�j�d���S|��t�k�r?�t�j����S|��t�k�rR�t����St �j �|����}�|�r��t�d�|��|�f�����n�t�d�|��f�����d��S)Nr(���zcompression type %d (%s)zcompression type %di�)r���r���r����Z decompressobjr���r����ZBZ2Decompressorr���r�����compressor_names�get�NotImplementedError)r[���Zdescrr���r���r����_get_decompressorb��s���� r����c�������������������s����e��Z�d��Z�d�Z�d�Z�d�Z�e�j�d���Z�d�d�d�d ���Z �d�d �d���Z �d�d�d ���Z�d�d����Z�d�d�d���Z �d�d����Z�d�d����Z�d�d����Z�d�d����Z����f�d�d����Z����S) � ZipExtFilezZFile-like object for reading an archive member. Is returned by ZipFile.open(). r���r���i���s*���^(?P<chunk>[^\r\n]+)|(?P<newline>\n|\r\n?)NFc�������������C���s����|�|��_��|�|��_�|�|��_�|�j�|��_�|�j�|��_�|�j�|��_�t �|��j���|��_ �d�|��_�d�|��_�d�|��_ �d�|�k�|��_�d��|��_�|��j�d��k �r��|��j�d�8_�n��|�|��_�|�j�|��_�t�|�d���r��|�j�|��_�t�d���d�@|��_�n �d��|��_�d��S)NFrL���r����Ur���re���l������)�_fileobj� _decrypter�_close_fileobjr[����_compress_typerf����_compress_leftrg����_leftr����� _decompressor�_eof�_readbuffer�_offset� _universal�newlines�moder3����namer1���re���� _expected_crc�crc32�_running_crc)ru���Zfileobjr�����zipinfoZ decrypter� close_fileobjr���r���r���rv������s(���� zZipExtFile.__init__c�������������C���s���|��j��rd�|�d�k��rd�|��j�j�d�|��j���d�}�|�d�k�rd�|��j�|��j�|���}�|�|��_�|�Sn��|��j��s��t�j�j�|��|���Sd�}�x|�d�k��s��t�|���|�k��r�|��j�d���}�|�d�k�r��|�S|��j �j �|���}�|�j�d���}�|�d�k �rM|��j�d�k�rg��|��_�n��|�|��j�k�r0|��j�j �|���n��|��j�t�|���7_�|�d�S|�j�d���}�|�d�k�r�|�d�|�t�|�����}�n��|��j�t�|���7_�|�|�7}�q��W|�S) zrRead and return a line from the stream. If limit is specified, at most limit bytes will be read. r���s��� r���rL���r����newlineN�chunk)r����r����rl���r�����io�BufferedIOBase�readliner7����peek�PATTERN�search�groupr����rS���)ru����limitr�����lineZ readahead�matchr����r����r���r���r���r�������s8���� ! zZipExtFile.readlinec�������������C���s����|�t��|��j���|��j�k�r��|��j�|���}�t��|���|��j�k�ri�|�|��j�|��j�d���|��_�d�|��_�q��|��j�t��|���8_�n��|��j�|��j�|��j�d���S)z6Returns buffered bytes without advancing the position.Nr���i���)r7���r����r����r/���)ru����nr����r���r���r���r�������s����zZipExtFile.peekc�������������C���s���d�S)NTr���)ru���r���r���r����readable���s����zZipExtFile.readablec�������������C���sp��|�d�k�s�|�d�k��rj�|��j��|��j�d���}�d�|��_��d�|��_�x#�|��j�se�|�|��j�|��j���7}�qC�W|�S|�|��j�}�|�t�|��j����k��r��|��j��|��j�|���}�|�|��_�|�S|�t�|��j����}�|��j��|��j�d���}�d�|��_��d�|��_�x�|�d�k�rk|��j�rk|��j�|���}�|�t�|���k��rN|�|��_��|�|��_�|�|�d�|���7}�Pn��|�|�7}�|�t�|���8}�q��W|�S)z�Read and return up to n bytes. If the argument is omitted, None, or negative, data is read and returned until EOF is reached.. Nr���rL���)r����r����r�����_read1�MAX_Nr7���)ru���r�����buf�endrI���r���r���r���r/������s4���� zZipExtFile.readc�������������C���sa���|��j��d��k�r�d��St�|�|��j���d�@|��_�|��j�r]�|��j�|��j��k�r]�t�d�|��j�����n��d��S)Nl������zBad CRC-32 for file %r)r����r����r����r����r���r����)ru����newdatar���r���r����_update_crc��s ����zZipExtFile._update_crcc�������������C���s|��|�d�k�s�|�d�k��rz�|��j��|��j�d���}�d�|��_��d�|��_�x3�|��j�su�|��j�|��j���}�|�rC�|�|�7}�PqC�qC�W|�S|�|��j�}�|�t�|��j����k��r��|��j��|��j�|���}�|�|��_�|�S|�t�|��j����}�|��j��|��j�d���}�d�|��_��d�|��_�|�d�k�rxxo�|��j�st|��j�|���}�|�t�|���k��r]|�|��_��|�|��_�|�|�d�|���7}�Pn��|�r |�|�7}�Pq q Wn��|�S)z7Read up to n bytes with at most one read() system call.Nr���rL���)r����r����r����r����r����r7���)ru���r����r����rI���r����r���r���r����read1��s>���� zZipExtFile.read1c�������������C���s���|��j��s�|�d�k�r�d�S|��j�t�k�ri�|��j�j�}�|�t�|���k�rx�|�|��j�|�t�|�����7}�qx�n�|��j�|���}�|��j�t�k�r��|��j�d�k�|��_��n��|��j�t�k�rt �|�|��j ���}�|��j�j�|�|���}�|��j�j�p��|��j�d�k�o��|��j�j�|��_��|��j��rO|�|��j�j ����7}�qOn0�|��j�j�|���}�|��j�j�pI|��j�d�k�|��_��|�d��|��j���}�|��j�t�|���8_�|��j�d�k�r�d�|��_��n��|��j�|���|�S)Nr���rL���T)r����r����r���r����Zunconsumed_tailr7����_read2r���r����rT���� MIN_READ_SIZEr����r����r����r����r����)ru���r����rI���r���r���r���r����4��s2����# zZipExtFile._read1c�������������C���s����|��j��d�k�r�d�St�|�|��j���}�t�|�|��j����}�|��j�j�|���}�|��j��t�|���8_��|�sm�t���n��|��j�d��k �r��t �t �|��j�|�����}�n��|�S)Nr���rL���)r����rT���r�����minr����r/���r7����EOFErrorr�����bytes�map)ru���r����rI���r���r���r���r����X��s���� zZipExtFile._read2c���������� ������s2���z�|��j��r�|��j�j����n��Wd��t����j����Xd��S)N)r����r�����close�super)ru���)� __class__r���r���r����h��s���� zZipExtFile.close����i���@���r����)r���r���r���r���r����r�����re�compiler����rv���r����r����r����r/���r����r����r����r����r����r���r���)r����r���r����s��s��� 2 ! %$r����c���������������@���sx��e��Z�d��Z�d�Z�d�Z�d�Z�d�e�d�d�d���Z�d�d����Z�d �d ����Z �d�d����Z �d �d����Z�d�d����Z�d�d�d���Z �d�d����Z�d�d����Z�d�d����Z�e�d�d������Z�e�j�d�d������Z�d�d�d���Z�d�d�d�d���Z�d�d�d �d!���Z�d�d�d�d"�d#���Z�e�d$�d%������Z�d&�d'����Z�d(�d)����Z�d�d�d*�d+���Z�d�d,�d-���Z�d.�d/����Z�d0�d1����Z�d�S)2r���a��� Class with methods to open, read, write, close, list zip files. z = ZipFile(file, mode="r", compression=ZIP_STORED, allowZip64=True) file: Either the path to the file, or a file-like object. If it is a path, the file will be opened and closed by ZipFile. mode: The mode can be either read "r", write "w" or append "a". compression: ZIP_STORED (no compression), ZIP_DEFLATED (requires zlib), ZIP_BZIP2 (requires bz2) or ZIP_LZMA (requires lzma). allowZip64: if True ZipFile will create files with ZIP64 extensions when needed, otherwise it will raise an exception when this would be necessary. N�rTc�������������C���s6��|�d�k�r�t��d�����n��t�|���|�|��_�d�|��_�d�|��_�i��|��_�g��|��_�|�|��_�|�j�d�d���d�|��_ �}�d �|��_ �d �|��_�t�|�t ���r0d�|��_�|�|��_�i�d�d�6d�d�6d �d�6}�y�t�j�|�|�|���|��_�WqWt�k �r,|�d�k�r%d�}�}�t�j�|�|�|���|��_�n����YqWXn'�d�|��_�|�|��_�t�|�d�d ���|��_�y��|�d�k�rs|��j����n��|�d�k�r�d�|��_�np�|�d�k�r�y$�|��j����|��j�j�|��j�d���Wq�t�k �r�|��j�j�d�d���d�|��_�Yq�Xn�t��d�����Wn3�|��j�}�d �|��_�|��j�s*|�j����n�����Yn�Xd �S)z>Open the ZIP file with mode read "r", write "w" or append "a".r���w�az(ZipFile() requires mode "r", "w", or "a"Fr����b��NrL���r0����wbzr+br���r����Tr���zMode must be "r", "w" or "a")r��r��r��)r����r�����_allowZip64� _didModify�debug� NameToInfo�filelistr����rp���r����r�����_commentr�����str�_filePassedr3���r����r2���r-���r,����getattr�_RealGetContentsr5���� start_dirr���r����)ru����filer����r����� allowZip64�keyZmodeDictr-���r���r���r���rv������sZ���� zZipFile.__init__c�������������C���s���|��S)Nr���)ru���r���r���r���� __enter__���s����zZipFile.__enter__c�������������C���s���|��j�����d��S)N)r����)ru����type�value� tracebackr���r���r����__exit__���s����zZipFile.__exit__c�������������C���s���|��j��}�y�t�|���}�Wn�t�k �r9�t�d�����Yn�X|�sO�t�d�����n��|��j�d�k�rk�t�|���n��|�t�}�|�t�}�|�t�|��_ �|�t �|�|�}�|�t�t�k�r��|�t �t�8}�n��|��j�d�k�r��|�|�}�t�d�|�|�|���n��|�|�|��_�|�j�|��j�d���|�j�|���}�t�j�|���}�d�}�xx|�|�k��r�|�j�t���} �t�| ���t�k�rqt�d�����n��t�j�t�| ���} �| �t�t�k�r�t�d�����n��|��j�d�k�r�t�| ���n��|�j�| �t���} �| �d�}�|�d �@r�| �j�d ���} �n�| �j�d���} �t�| ���}�|�j�| �t���|�_�|�j�| �t ���|�_!�| �t"�|�_#�| �d�d���\�|�_$�|�_%�|�_&�|�_'�|�_(�|�_)�} �}�|�_*�|�_+�|�_,�|�j&�t-�k�r�t.�d �|�j&�d�����n��| �d�d���\�|�_/�|�_0�|�_1�| �|�_2�|�d�?d�|�d�?d�@|�d�@| �d�?| �d�?d�@| �d�@d�f�|�_3�|�j4����|�j#�|�|�_#�|��j5�j6�|���|�|��j7�|�j8�<|�t�| �t�| �t�| �t �}�|��j�d�k�r5t�d�|���q5q5Wd�S)z/Read in the table of contents for the ZIP file.zFile is not a zip filer���r���zgiven, inferred, offsetr���zTruncated central directoryz&Bad magic number for central directoryr!���i���zutf-8�cp437r���zzip file version %.1fr%���r(���r*���r$���i���r���r&���r����totalN)9r-���r+���r,���r���r ���printrD���rE����_ECD_COMMENTr��� _ECD_LOCATIONr?���r>���r<���r6���r��r5���r/���r�����BytesIO�sizeCentralDirr7���r8���r9����structCentralDir� _CD_SIGNATURE�stringCentralDir�_CD_FILENAME_LENGTH�decoder ����_CD_EXTRA_FIELD_LENGTHr\����_CD_COMMENT_LENGTHrX����_CD_LOCAL_HEADER_OFFSETrd���rJ���r]���r^���r_���r`���r[���re���rf���rg����MAX_EXTRACT_VERSIONr����ra���rb���rc���rh���rZ���r����r��rS���r ��r3���)ru���r-���rH���Zsize_cdZ offset_cd�concatZinferredrI���r���centdirr3����flags�x�t�dr���r���r���r�����sp���� L" & "zZipFile._RealGetContentsc�������������C���s���d�d����|��j��D��S)z+Return a list of file names in the archive.c�������������S���s���g��|��]�}�|�j����q�Sr���)r3���)�.0rI���r���r���r���� <listcomp>��s��� �z$ZipFile.namelist.<locals>.<listcomp>)r��)ru���r���r���r����namelist��s����zZipFile.namelistc�������������C���s���|��j��S)zJReturn a list of class ZipInfo instances for files in the archive.)r��)ru���r���r���r����infolist��s����zZipFile.infolistc�������������C���sf���t��d�d �d�|��xK�|��j�D]@�}�d�|�j�d�d���}�t��d �|�j�|�|�j�f�d�|��q�Wd�S)z+Print a table of contents for the zip file.z%-46s %19s %12s� File Name�Modified �Sizer��z%d-%02d-%02d %02d:%02d:%02dNr"���z %-46s %s %12d)r4��r5��r6��)r��r��rZ���r3���rg���)ru���r���zinfoZdater���r���r����printdir!��s���� zZipFile.printdirc�������������C���sr���d�}�xe�|��j��D]Z�}�y8�|��j�|�j�d�����}�x�|�j�|���rF�q4�WWd�QXWq�t�k �ri�|�j�SYq�Xq�Wd�S)z%Read all the files and check the CRC.r���r���r��Ni���)r��r2���r3���r/���r���)ru���Z chunk_sizer7���fr���r���r����testzip*��s���� zZipFile.testzipc�������������C���s5���|��j��j�|���}�|�d�k�r1�t�d�|�����n��|�S)z,Return the instance of ZipInfo given 'name'.Nz(There is no item named %r in the archive)r ��r�����KeyError)ru���r�����infor���r���r����getinfo7��s ����zZipFile.getinfoc�������������C���sN���|�r/�t��|�t���r/�t�d�t�|�������n��|�rA�|�|��_�n �d�|��_�d�S)z)Set default password for encrypted files.zpwd: expected bytes, got %sN)r����r����� TypeErrorr��r����)ru���r����r���r���r����setpassword@��s ����zZipFile.setpasswordc�������������C���s���|��j��S)z.The comment text associated with the ZIP file.)r��)ru���r���r���r���rX���I��s����zZipFile.commentc�������������C���s����t��|�t���s(�t�d�t�|�������n��t�|���t�k�rp�d�d��l�}�|�j�d�t�d�d��|�d��t���}�n��|�|��_�d�|��_ �d��S)Nzcomment: expected bytes, got %sr���z3Archive comment is too long; truncating to %d bytes� stacklevelr���T) r����r����r>��r��r7����ZIP_MAX_COMMENT�warnings�warnr��r��)ru���rX���rB��r���r���r���rX���N��s���� c�������������C���s,���|��j��|�d�|�����}�|�j����SWd�QXd�S)z)Return file bytes (as a string) for name.r��N)r2���r/���)ru���r����r����r-���r���r���r���r/���[��s����zZipFile.readc���������� ���C���s5��|�d�k�r�t��d�����n��d�|�k�rI�d�d�l�}�|�j�d�t�d���n��|�rx�t�|�t���rx�t�d �t�|�������n��|��j�s��t��d �����n��|��j �r��|��j�}�n�t �j�|��j�d���}�ySt�|�t ���r��|�}�n�|��j�|���}�|�j�|�j�d���|�j�t���}�t�|���t�k�r't�d�����n��t�j�t�|���}�|�t�t�k�rXt�d �����n��|�j�|�t���}�|�t�r�|�j�|�t���n��|�j�d�@r�t�d�����n��|�j�d�@r�t�d�����n��|�j�d�@r�|�j�d���} �n�|�j�d���} �| �|�j�k�rt�d�|�j�|�f�����n��|�j�d�@} �d�}�| �r�|�sE|��j �}�n��|�s^t��d�|�����n��t!�|���}�|�j�d���}�t"�t#�|�|�d�d�������} �|�j�d�@r�|�j$�d�?d�@}�n�|�j%�d�?d�@}�| �d�|�k�r�t��d�|�����q�n��t&�|�|�|�|�d�|��j ��SWn!�|��j �s)|�j'����n�����Yn�Xd�S) z#Return file-like object for 'name'.r��r�����rUz&open() requires mode "r", "U", or "rU"r���Nz'U' mode is deprecatedr���zpwd: expected bytes, got %sz3Attempt to read ZIP archive that was already closedr0���zTruncated file headerz Bad magic number for file header� ���z$compressed patched data (flag bit 5)�@���zstrong encryption (flag bit 6)i���zutf-8r��z/File name in directory %r and header %r differ.r���z6File %s is encrypted, password required for extractionr���r���r����r����r&���zBad password for filer����)r��r����rD��)(r����rB��rC���DeprecationWarningr����r����r>��r��r-���r��r����r2���r3���r ���r=��r5���rd���r/����sizeFileHeaderr7���r���r8���r9���r~���� _FH_SIGNATUREr����_FH_FILENAME_LENGTH�_FH_EXTRA_FIELD_LENGTHr`���r����r%��rY���r����r����rR���r����rh���re���r����r����)ru���r����r����r����rB��Zzef_filer7��Zfheader�fnameZ fname_strZis_encryptedZzdr�����hZ check_byter���r���r���r2���`��sz���� zZipFile.openc�������������C���sO���t��|�t���s!�|��j�|���}�n��|�d�k�r<�t�j����}�n��|��j�|�|�|���S)a#��Extract a member from the archive to the current working directory, using its full name. Its file information is extracted as accurately as possible. `member' may be a filename or a ZipInfo object. You can specify a different directory using `path'. N)r����r ���r=��rn����getcwd�_extract_member)ru����member�pathr����r���r���r����extract���s ����zZipFile.extractc�������������C���sC���|�d�k�r�|��j�����}�n��x!�|�D]�}�|��j�|�|�|���q"�Wd�S)z�Extract all members from the archive to the current working directory. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by namelist(). N)r2��rR��)ru���rQ��Zmembersr����r����r���r���r���� extractall���s���� zZipFile.extractallc�������������C���s����|��j��}�|�s=�d�}�t�j�|�d�t�|�����}�|�|��_��n��|�j�|���}�d�d����|�j�|���D��}�|�j�d�d����|�D����}�|�S)z;Replace bad characters and remove trailing dots from parts.z:<>|"?*�_c�������������s���s���|��]�}�|�j��d����Vq�d�S)�.N)�rstrip)r0��r-��r���r���r���� <genexpr>���s����z1ZipFile._sanitize_windows_name.<locals>.<genexpr>c�������������s���s���|��]�}�|�r�|�Vq�d��S)Nr���)r0��r-��r���r���r���rW�����s����)�!_windows_illegal_name_trans_tabler ��� maketransr7���� translate�split�join)�cls�arcname�pathsepr����Zillegalr���r���r����_sanitize_windows_name���s���� zZipFile._sanitize_windows_namec����������������s���|�j��j�d�t�j�j���}�t�j�j�rH�|�j�t�j�j�t�j�j���}�n��t�j�j�|���d�}�d�t�j�j�t�j�j�f����t�j�j�j ����f�d�d����|�j �t�j�j���D����}�t�j�j�d�k�r��|��j�|�t�j�j���}�n��t�j�j �|�|���}�t�j�j�|���}�t�j�j �|���}�|�r?t�j�j�|���r?t�j�|���n��|�j��d �d�k�rxt�j�j�|���stt�j�|���n��|�S|��j�|�d�|���/�}�t�|�d�����}�t�j�|�|���Wd �QXWd �QX|�S)zbExtract the ZipInfo object 'member' to a physical file on the path targetpath. rj���r���r��c�������������3���s!���|��]�}�|����k�r�|�Vq�d��S)Nr���)r0��r-��)�invalid_path_partsr���r���rW�����s����z*ZipFile._extract_member.<locals>.<genexpr>�\r����r��Nr����)r3���rp���rn���rQ��ro����altsep� splitdrive�curdir�pardirr\��r[��r`���normpath�dirname�exists�makedirs�isdir�mkdirr2����shutilZcopyfileobj)ru���rP��Z targetpathr����r^��Z upperdirs�source�targetr���)ra��r���rO�����s*����!7zZipFile._extract_memberc�������������C���s����|�j��|��j�k�r;�d�d�l�}�|�j�d�|�j��d�d��n��|��j�d�k�rY�t�d�����n��|��j�sq�t�d �����n��t�|�j���|��j �s��d�}�t �|��j���t�k�r��d �}�n0�|�j �t�k�r��d�}�n�|�j�t�k�r��d�}�n��|�r��t�|�d �����q��n��d�S)z6Check for errors before writing a file to the archive.r���NzDuplicate name: %rr@��r���r��r��z write() requires mode "w" or "a"z4Attempt to write ZIP archive that was already closedzFiles countZFilesizezZipfile sizez would require ZIP64 extensions)r��r��)r3���r ��rB��rC��r����r����r-���r����r[���r��r7���r���ZIP_FILECOUNT_LIMITrg���rw���rd���r ���)ru���r7��rB���requires_zip64r���r���r����_writecheck��s(���� zZipFile._writecheckc���������� ���C���s��|��j��s�t�d�����n��t�j�|���}�t�j�|�j���}�t�j�|�j���}�|�d�d���}�|�d�k�rp�|�}�n��t�j �j �t�j �j�|���d���}�x0�|�d�t�j�t�j �f�k�r��|�d�d���}�q��W|�r��|�d�7}�n��t�|�|���}�|�d�d�@d�>|�_�|�rt�|�_�n$�|�d�k�r)|��j�|�_�n �|�|�_�|�j�|�_�d�|�_�|��j��j����|�_�|�j�t�k�rz|�j�d �O_�n��|��j�|���d �|��_�|�r�d�|�_�d�|�_�d�|�_�|�j�d�O_�|��j�j�|���|�|��j�|�j �<|��j��j!�|�j"�d�����d�St#�|�j���} �t$�|�d������} �d�|�_�}�d�|�_�}�|��j%�oQ|�j�d �t&�k�} �|��j��j!�|�j"�| �����d�}�xx�| �j'�d���}�|�s�Pn��|�t(�|���}�t)�|�|���d�@}�| �r�| �j*�|���}�|�t(�|���}�n��|��j��j!�|���qvWWd�QX| �r2| �j+����}�|�t(�|���}�|��j��j!�|���|�|�_�n �|�|�_�|�|�_�|�|�_�| �r�|��j%�r�|�t&�k�rxt�d�����n��|�t&�k�r�t�d�����q�n��|��j��j����}�|��j��j,�|�j�d���|��j��j!�|�j"�| �����|��j��j,�|�d���|��j�j�|���|�|��j�|�j �<d�S)zLPut the bytes from filename into the archive under the name arcname.z7Attempt to write to ZIP archive that was already closedr���r"���Nr���rj���i����r���r���TFr0���g�������?i���r���l������z*File size has increased during compressingz-Compressed size larger than uncompressed sizei� ��)-r-���r����rn����stat�S_ISDIR�st_mode�time� localtime�st_mtimerQ��rg��rd��ro���rc��r ���rc���r���r[���r�����st_sizerg���r`���rN���rd���r���rr��r��rf���re���r��rS���r ��r3����writer����r����r2���r��rw���r/���r7���r����r����r����r5���)ru���r3���r^��r[����strk���mtimerZ���r7��Zcmprr-���re���rf���r����rg���r����Zpositionr���r���r���rz��'��s����� " z ZipFile.writec�������������C���su��t��|�t���r!�|�j�d���}�n��t��|�t���s��t�d�|�d�t�j�t�j������d�d�����}�|��j�|�_�|�j�d�d�k�r��d�|�_ �|�j �d �O_ �q��d�|�_ �n�|�}�|��j �s��t�d�����n��t�|���|�_ �|��j �j����|�_�|�d�k �r��|�|�_�n��|�j�t�k�r|�j�d�O_�n��|��j�|���d �|��_�t�|���d�@|�_�t�|�j���}�|�r�|�j�|���|�j����}�t�|���|�_�n�|�j �|�_�|�j �t�k�p�|�j�t�k�}�|�r�|��j�r�t�d�����n��|��j �j�|�j�|�����|��j �j�|���|�j�d�@rD|�rd�n�d�}�|��j �j�t�j �|�|�j�|�j�|�j �����n��|��j �j����|��j!�j"�|���|�|��j#�|�j�<d�S)a��Write a file into the archive. The contents is 'data', which may be either a 'str' or a 'bytes' instance; if it is a 'str', it is encoded as UTF-8 first. 'zinfo_or_arcname' is either a ZipInfo instance or the name of the file in the archive.zutf-8r3���rZ���Nr"���r���rj���i�A��r���i���z7Attempt to write to ZIP archive that was already closedr���Tl������z'Filesize would require ZIP64 extensionsr���z<LQQz<LLLr����i���Ai���)$r����r ��r����r ���rv��rw��r����r[���r3���rc���r-���r����r7���rg���rN���rd���r���r`���rr��r��r����re���r����r����r����rf���rw���r��r ���rz��r����r8���rx���r��rS���r ��)ru���Zzinfo_or_arcnamerI���r[���r7���cor����r����r���r���r����writestr���sR����" zZipFile.writestrc�������������C���s���|��j�����d�S)z2Call the "close()" method in case the user forgot.N)r����)ru���r���r���r����__del__���s����zZipFile.__del__c����������"���C���s��|��j��d�k�r�d�Sz�|��j�d�k�r�|��j�r�|��j��j����}�x|��j�D]}�|�j�}�|�d�d�d�>|�d�d�>B|�d �B}�|�d �d�>|�d�d�>B|�d�d �B}�g��}�|�j�t�k�s��|�j�t�k�r��|�j �|�j���|�j �|�j���d �}�d �}�n�|�j�}�|�j�}�|�j �t�k�r/|�j �|�j ���d �} �n �|�j �} �|�j�} �d�}�|�r�t�j �d�d�t�|���d�d�t�|���|���| �} �t�}�n��|�j�t�k�r�t�t�|���}�n!�|�j�t�k�r�t�t�|���}�n��t�|�|�j���}�t�|�|�j���} �y��|�j����\�}�}�t�j �t�t�| �|�j�|�|�j�|�|�j�|�|�|�j�|�|�t�|���t�| ���t�|�j���d�|�j�|�j �| ���}�Wn��t!�k �rt"�t�t�| �|�j�|�|�j�|�j#�|�j�|�|�|�j�|�|�t�|�j$���t�| ���t�|�j���d�|�j�|�j �| �f�d�t%�j&�����Yn�X|��j��j'�|���|��j��j'�|���|��j��j'�| ���|��j��j'�|�j���qG�W|��j��j����}�t�|��j���}�|�|�}�|�}�d�}�|�t(�k�r�d�}�n*�|�t�k�r�d�}�n�|�t�k�r�d�}�n��|�r}|��j)�s�t*�|�d�����n��t�j �t+�t,�d�d�d�d�d�|�|�|�|���}�|��j��j'�|���t�j �t-�t.�d�|�d���}�|��j��j'�|���t/�|�d���}�t/�|�d ���}�t/�|�d ���}�n��t�j �t0�t1�d�d�|�|�|�|�t�|��j2���� �}�|��j��j'�|���|��j��j'�|��j2���|��j��j3����n��Wd�|��j��}�d�|��_��|��j4�s|�j5����n��Xd�S)zJClose the file, and for mode "w" and "a" write the ending records.Nr��r��r���i���r$���r���r!���r���r���r&���r ���l������z<HH�Qr���r��zFiles countzCentral directory offsetzCentral directory sizez would require ZIP64 extensions�,���r���i����)r��r��)6r-���r����r��rN���r��rZ���rg���rw���rf���rS���rd���r\���r8���rx���r7���rz���r[���r���rT���r{���r���r|���r^���rJ���r}���r!��r#��r]���r_���re���rX���rb���rc���rG��r��r`���r3���rr����stderrrz��rp��r��r ���r=���r>���r:���r;���r����rQ���rP���r��r����r��r����)ru���Zpos1r7��r����r����r����r\���rg���rf���rd���Z extra_datar����r^���rJ���r3���r`���r+��Zpos2ZcentDirCountZcentDirSizeZ centDirOffsetrq��Zzip64endrecZzip64locrecrH���r-���r���r���r���r�������s����� && ! z ZipFile.close) r���r���r���r���r-���rX��r���rv���r��r��r��r2��r3��r8��r:��r=��r?���propertyrX����setterr/���r2���rR��rS���classmethodr`��rO��rr��rz��r~��r��r����r���r���r���r���r���p��s4���AN `'[8c���������������@���sL���e��Z�d��Z�d�Z�d�e�d�d �d�d���Z�d�d�d �d ���Z�d�d����Z�d�S)r���zDClass to create ZIP archives with Python library files and packages.r��Tr���c���������� ���C���s/���t��j�|��|�d�|�d�|�d�|��|�|��_�d��S)Nr����r����r��)r���rv���� _optimize)ru���r��r����r����r���optimizer���r���r���rv���4��s����zPyZipFile.__init__r��Nc�������������C���s���|�rU�|�|���rU�|��j��rQ�t�j�j�|���r4�d�n�d�}�t�d�|�|�f���n��d�St�j�j�|���\�}�}�t�j�j�|���rXt�j�j�|�d���}�t�j�j�|���rh|�r��d�|�|�f�}�n�|�}�|��j��r��t�d�|�d�|���n��|��j�|�d �d���|���\�}�} �|��j��rt�d�| ���n��|��j �|�| ���t�j �|���} �| �j�d���x| �D]}�t�j�j�|�|���}�t�j�j�|���\�} �}�t�j�j�|���r�t�j�j�t�j�j�|�d�����ra|��j �|�|�d�|��qaqR|�d �k�rR|�r|�|���r|��j��rRt�d�|���qRqRn��|��j�|�d �d���|���\�}�} �|��j��rNt�d�| ���n��|��j �|�| ���qRqRWq�|��j��r�t�d�|���n��xDt�j �|���D]��}�t�j�j�|�|���}�t�j�j�|���\�} �}�|�d �k�r�|�r|�|���r|��j��r�t�d�|���q�q�n��|��j�|�d �d���|���\�}�} �|��j��r>t�d�| ���n��|��j �|�| ���q�q�Wnp�|�d�d���d �k�r}t�d�����n��|��j�|�d �d���|���\�}�} �|��j��r�t�d�| ���n��|��j �|�| ���d�S)a���Add all files from "pathname" to the ZIP archive. If pathname is a package directory, search the directory and all package subdirectories recursively for all *.py and enter the modules into the archive. If pathname is a plain directory, listdir *.py and enter all modules. Else, pathname must be a Python *.py file and the module will be put into the archive. Added modules are always module.pyo or module.pyc. This method will compile the module.py into module.pyc if necessary. If filterfunc(pathname) is given, it is called with every argument. When it is False, the file or directory is skipped. rQ��r��z%s "%s" skipped by filterfuncNz__init__.pyz%s/%szAdding package in�asr���r���ZAdding� filterfuncz.pyzfile "%s" skipped by filterfunczAdding files from directoryz.Files added with writepy() must end with ".py"zAdding file���r���r���r���r���)r ��rn���rQ��rk��r��r[��r\���isfile� _get_codenamerz���listdir�remove�splitext�writepyr����)ru����pathname�basenamer���Zlabel�dirr����ZinitnamerL��r^��Zdirlistr3���rQ���rootZextr���r���r���r���:��sv���� " ! " zPyZipFile.writepyc����������������sz��d����f�d�d���}�|�d�}�|�d�}�|�d�}�t��j�j�|�d���}�t��j�j�|�d���}����j�d �k�r�t�j�j�|���r��t�j�|���j�t�j�|���j�k�r��|�} �} �qAt�j�j�|���r��t�j�|���j�t�j�|���j�k�r��|�} �} �qAt�j�j�|���r7t�j�|���j�t�j�|���j�k�r7|�} �|�} �qAt�j�j�|���r|t�j�|���j�t�j�|���j�k�r||�} �|�} �qA|�|���r�t �r�|�n�|�} �t �r�|�n�|�} �qA|�} �} �n�����j�d �k�r�|�} �|�} �n�|�} �|�} �t�j�j�| ���ot�j�| ���j�t�j�|���j�k�sA|�|�d ����j��sA|�} �} �qAn��t�j�j �| ���d�}�|�rpd�|�|�f�}�n��| �|�f�S)a���Return (filename, archivename) for the path. Given a module name path, return the correct file path and archive name, compiling if necessary. For example, given /python/lib/string, return (/python/lib/string.pyc, string). r���c����������������s����d�d��l��}����j�r%�t�d�|����n��y�|�j�|��d�d�d�|��Wn9�|�j�k �r}�}�z�t�|�j���d�SWYd��d��}�~�Xn�Xd�S)Nr���Z Compiling�doraiseTr���F)� py_compiler ��r��r����PyCompileError�msg)r��r���r����err)ru���r���r����_compile���s���� z)PyZipFile._get_codename.<locals>._compilez.pyz.pycz.pyoTFr���r���z%s/%sr����r����)� importlib�util�cache_from_sourcer���rn���rQ��r���rs��rx��� __debug__r[��)ru���r���r���r���Zfile_pyZfile_pycZfile_pyoZpycache_pycZpycache_pyor^��rL��Zarchivenamer���)ru���r���r������sL���� $ $ $ $ $zPyZipFile._get_codenamer����)r���r���r���r���r���rv���r���r���r���r���r���r���r���1��s ���Qc����������������s���d�d��l��}�|�j�d���}�|��d��k�r=�t�j�d�d����}��n��|��sT�|��d�d�k�rn�t�|���t�j�d���n��|��d�d�k�r��t�|����d�k�r��t�|���t�j�d���n��t�|��d�d �����}�|�j����Wd��QXn�|��d�d�k�r`t�|����d�k�rt�|���t�j�d���n��t�|��d�d �����}�|�j ����}�Wd��QX|�rSt�d �j �|�����n��t�d���na|��d�d�k�r�t�|����d�k�r�t�|���t�j�d���n��t�|��d�d �����}�|�j�|��d���Wd��QXn��|��d�d�k�r�t�|����d�k��rt�|���t�j�d���n�����f�d �d�������t�|��d�d������}�x��|��d�d����D]s�}�t�j �j�|���}�|�s�t�j �j�t�j �j�|�����}�n��|�d�t�j�t�j�f�k�r�d�}�n�����|�|�|���qAWWd��QXn��d��S)Nr���aE�� Usage: zipfile.py -l zipfile.zip # Show listing of a zipfile zipfile.py -t zipfile.zip # Test if a zipfile is valid zipfile.py -e zipfile.zip target # Extract zipfile into target dir zipfile.py -c zipfile.zip src ... # Create zipfile from sources r����-l�-c�-e�-tr���r��z.The following enclosed file is corrupted: {!r}zDone testingr���c����������������s����t��j�j�|���r(�|��j�|�|�t���nv�t��j�j�|���r��|�rS�|��j�|�|���n��xH�t��j�|���D]4�}����|��t��j�j�|�|���t��j�j�|�|�����qc�Wn��d��S)N)rn���rQ��r���rz��r���rk��r���r\��)�zfrQ���zippathZnm)�addToZipr���r���r������s����zmain.<locals>.addToZipr��r��)r���r���r���r���)�textwrap�dedentrr����argvr���exitr7���r���r8��r:���formatrS��rn���rQ��r���rh��re��rf��)�argsr���ZUSAGEr���ZbadfilerQ��r���r���)r���r����main���sT���� ! r����__main__)yr���r����rn���r�����importlib.utilr���rr���rv��rs��rm��r8���Zbinasciir����r�����ImportErrorr����r�����__all__� Exceptionr���r ���r���r���rw���rp��rA��r���r���r���r���rt���rz���r{���r|���r)��rQ���rP���ry���rO���r?���r@���rA���rB���rC���rD���rE���rV���r��r��r!��r#��r ��r"��Z_CD_CREATE_VERSIONZ_CD_CREATE_SYSTEMZ_CD_EXTRACT_VERSIONZ_CD_EXTRACT_SYSTEMZ _CD_FLAG_BITSZ_CD_COMPRESS_TYPEZ_CD_TIMEZ_CD_DATEZ_CD_CRCZ_CD_COMPRESSED_SIZEZ_CD_UNCOMPRESSED_SIZEr$��r&��r'��Z_CD_DISK_NUMBER_STARTZ_CD_INTERNAL_FILE_ATTRIBUTESZ_CD_EXTERNAL_FILE_ATTRIBUTESr(��r~���r���rH��rI��Z_FH_EXTRACT_VERSIONZ_FH_EXTRACT_SYSTEMZ_FH_GENERAL_PURPOSE_FLAG_BITSZ_FH_COMPRESSION_METHODZ_FH_LAST_MOD_TIMEZ_FH_LAST_MOD_DATEZ_FH_CRCZ_FH_COMPRESSED_SIZEZ_FH_UNCOMPRESSED_SIZErJ��rK��r:���r;���r6���r=���r>���r<���Z_CD64_SIGNATUREZ_CD64_DIRECTORY_RECSIZEZ_CD64_CREATE_VERSIONZ_CD64_EXTRACT_VERSIONZ_CD64_DISK_NUMBERZ_CD64_DISK_NUMBER_STARTZ_CD64_NUMBER_ENTRIES_THIS_DISKZ_CD64_NUMBER_ENTRIES_TOTALZ_CD64_DIRECTORY_SIZEZ_CD64_OFFSET_START_CENTDIRr.���r ���rK���r+����objectr ���r����r����r����r����r����r����r����r����r����r���r���r���r���r���r���r���r����<module>���s"�� +=�= �������B