D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
usr
/
lib
/
python3.8
/
__pycache__
/
Filename :
zipimport.cpython-38.pyc
back
Copy
U �������g-x����������������������@���sR��d�Z�ddlZddlmZmZ�ddlZddlZddlZddl Z ddl Z ddlZddgZej Z ejdd��ZG�dd��de�Zi�Zee �ZdZd Zd ZG�dd��d�Ze d�d d fe d�dd fddfZdd��Zdd��Zdd��Zdd��ZdZdadd��Z dd��Z!dd ��Z"d!d"��Z#ee#j$�Z%d#d$��Z&d%d&��Z'd'd(��Z(d)d*��Z)d+d,��Z*d-d.��Z+G�d/d0��d0�Z,dS�)1aP��zipimport provides support for importing Python modules from Zip archives. This module exports three objects: - zipimporter: a class; its constructor takes a path to a Zip archive. - ZipImportError: exception raised by zipimporter objects. It's a subclass of ImportError, so it can be caught as ImportError, too. - _zip_directory_cache: a dict, mapping archive paths to zip directory info dicts, as used in zipimporter._files. It is usually not needed to use the zipimport module explicitly; it is used by the builtin import mechanism for sys.path items that are paths to Zip archives. �����N)�_unpack_uint16�_unpack_uint32�ZipImportError�zipimporter����c�������������������@���s���e�Zd�ZdS�)r���N)�__name__� __module__�__qualname__��r ���r ����/usr/lib/python3.8/zipimport.pyr���!���s�������s���PKi����c�������������������@���sl���e�Zd�ZdZdd��Zddd�Zddd�Zd d ��Zdd��Zd d��Z dd��Z dd��Zdd��Zdd��Z dd��ZdS�)r���a���zipimporter(archivepath) -> zipimporter object Create a new zipimporter instance. 'archivepath' must be a path to a zipfile, or to a specific path inside a zipfile. For example, it can be '/tmp/myimport.zip', or '/tmp/myimport.zip/mydirectory', if mydirectory is a valid directory inside the archive. 'ZipImportError is raised if 'archivepath' doesn't point to a valid Zip archive. The 'archive' attribute of zipimporter objects contains the name of the zipfile targeted. c�������������� ���C���s$��t�|t�sdd�l}|�|�}|s,td|d��tr<|�tt�}g�}zt� |�}W�nH�t tfk r����t�|�\}}||kr�td|d��|}|� |��Y�q@X�|jd@�dkr�td|d��q�q@zt|�}W�n$�tk r����t|�}|t|<�Y�nX�||�_||�_tj|d�d�d����|�_|�j�r |��jt7��_d�S�)Nr���zarchive path is empty��pathznot a Zip filei����i�������)� isinstance�str�os�fsdecoder����alt_path_sep�replace�path_sep�_bootstrap_external� _path_stat�OSError� ValueError�_path_split�append�st_mode�_zip_directory_cache�KeyError�_read_directory�_files�archive� _path_join�prefix)�selfr���r���r$����st�dirname�basename�filesr ���r ���r����__init__?���s:���� zzipimporter.__init__Nc�����������������C���sN���t�|�|�}|dk r|�g�fS�t|�|�}t|�|�rFd|�j��t��|���gfS�dg�fS�)a���find_loader(fullname, path=None) -> self, str or None. Search for a module specified by 'fullname'. 'fullname' must be the fully qualified (dotted) module name. It returns the zipimporter instance itself if the module was found, a string containing the full path name if it's possibly a portion of a namespace package, or None otherwise. The optional 'path' argument is ignored -- it's there for compatibility with the importer protocol. N)�_get_module_info�_get_module_path�_is_dirr"���r���)r%����fullnamer����mi�modpathr ���r ���r����find_loaderm���s���� zzipimporter.find_loaderc�����������������C���s���|���||�d�S�)a���find_module(fullname, path=None) -> self or None. Search for a module specified by 'fullname'. 'fullname' must be the fully qualified (dotted) module name. It returns the zipimporter instance itself if the module was found, or None if it wasn't. The optional 'path' argument is ignored -- it's there for compatibility with the importer protocol. r���)r1���)r%���r.���r���r ���r ���r����find_module����s���� zzipimporter.find_modulec�����������������C���s���t�|�|�\}}}|S�)z�get_code(fullname) -> code object. Return the code object for the specified module. Raise ZipImportError if the module couldn't be found. ��_get_module_code�r%���r.����code� ispackager0���r ���r ���r����get_code����s����zzipimporter.get_codec�����������������C���sv���t�r|�t�t�}|}|�|�jt��r:|t|�jt��d��}z|�j|�}W�n �tk rh���tdd|��Y�nX�t |�j|�S�)z�get_data(pathname) -> string with file data. Return the data associated with 'pathname'. Raise OSError if the file wasn't found. Nr�����) r���r���r���� startswithr"����lenr!���r���r���� _get_data)r%����pathname�key� toc_entryr ���r ���r����get_data����s����zzipimporter.get_datac�����������������C���s���t�|�|�\}}}|S�)zjget_filename(fullname) -> filename string. Return the filename for the specified module. r3���r5���r ���r ���r����get_filename����s����zzipimporter.get_filenamec�����������������C���s����t�|�|�}|dkr$td|��|d��t|�|�}|r@t�|d�}n |��d�}z|�j|�}W�n�tk rn���Y�dS�X�t|�j|�� ��S�)z�get_source(fullname) -> source string. Return the source code for the specified module. Raise ZipImportError if the module couldn't be found, return None if the archive does contain the module, but has no source for it. N�can't find module ��name�__init__.py�.py) r+���r���r,���r���r#���r!���r���r<���r"����decode)r%���r.���r/���r����fullpathr?���r ���r ���r���� get_source����s���� zzipimporter.get_sourcec�����������������C���s(���t�|�|�}|dkr$td|��|d��|S�)z�is_package(fullname) -> bool. Return True if the module specified by fullname is a package. Raise ZipImportError if the module couldn't be found. NrB���rC���)r+���r���)r%���r.���r/���r ���r ���r���� is_package����s���� zzipimporter.is_packagec�����������������C���s����t�|�|�\}}}tj�|�}|dks.t|t�s@t|�}|tj|<�|�|_zT|rlt|�|�}t� |�j |�}|g|_t|d�s|t |_ t�|j||��t||j��W�n���tj|=���Y�nX�ztj|�}W�n$�tk r����td|�d���Y�nX�t�d||��|S�)z�load_module(fullname) -> module. Load the module specified by 'fullname'. 'fullname' must be the fully qualified (dotted) module name. It returns the imported module, or raises ZipImportError if it wasn't found. N�__builtins__zLoaded module z not found in sys.moduleszimport {} # loaded from Zip {})r4����sys�modules�getr����_module_type� __loader__r,���r���r#���r"����__path__�hasattrrK����_fix_up_module�__dict__�execr����ImportError� _bootstrap�_verbose_message)r%���r.���r6���r7���r0����modr���rH���r ���r ���r����load_module����s0���� zzipimporter.load_modulec�����������������C���sX���z|���|�sW�dS�W�n�tk r*���Y�dS�X�tjsNddlm}�|�t��dt_t|�|�S�)z�Return the ResourceReader for a package in a zip file. If 'fullname' is a package within the zip file, return the 'ResourceReader' object for the package. Otherwise return None. Nr���)�ResourceReaderT)rJ���r����_ZipImportResourceReader�_registered� importlib.abcr[����register)r%���r.���r[���r ���r ���r����get_resource_reader��s���� zzipimporter.get_resource_readerc�����������������C���s���d|�j���t��|�j��d�S�)Nz<zipimporter object "z">)r"���r���r$���)r%���r ���r ���r����__repr__"��s����zzipimporter.__repr__)N)N)r���r���r ����__doc__r*���r1���r2���r8���r@���rA���rI���rJ���rZ���r`���ra���r ���r ���r ���r���r���-���s���. &z__init__.pycTrE���F)z.pycTF)rF���FFc�����������������C���s���|�j�|�d�d��S�)N�.����)r$���� rpartition)r%���r.���r ���r ���r���r,���4��s����r,���c�����������������C���s���|t��}||�jkS��N)r���r!���)r%���r����dirpathr ���r ���r���r-���8��s����r-���c�����������������C���s8���t�|�|�}tD�]$\}}}||�}||�jkr|��S�qd�S�rf���)r,����_zip_searchorderr!���)r%���r.���r����suffix� isbytecoder7���rH���r ���r ���r���r+���A��s���� r+���c�������������� ���C���s���zt��|��}W�n&�tk r4���td|���|�d��Y�nX�|����z$|�t�d��|���}|�t�}W�n&�tk r����td|���|�d��Y�nX�t|�tkr�td|���|�d��|d�d��t k�r�z|�dd��|���}W�n&�tk r����td|���|�d��Y�nX�t |t�t�d�}z|�|��|���}W�n(�tk �rJ���td|���|�d��Y�nX�|�t �}|dk��rrtd|���|�d��|||t���}t|�tk�r�td|���|�d��|t|��|�}t |d d ���}t |d d���} ||k��r�td|���|�d��|| k��r td |���|�d��||8�}|| �} | dk��r6td|���|�d��i�}d}z|�|��W�n(�tk �rt���td|���|�d��Y�nX�|�d�}t|�dk��r�td��|d�d��dk�r��q�t|�dk�r�td��t|dd���} t|dd ���}t|d d���}t|dd ���}t |d d���}t |dd���}t |dd���}t|dd���}t|dd���}t|dd���}t |dd���}||�|�}|| k�r�td|���|�d��|| 7�}z|�|�}W�n(�tk �r����td|���|�d��Y�nX�t|�|k�r�td|���|�d��z2t|�||���||�k�r*td|���|�d��W�n(�tk �rT���td|���|�d��Y�nX�| d@��rj|���}n6z|�d�}W�n&�tk �r����|�d��t�}Y�nX�|�dt�}t�|�|�}||||||||f}|||<�|d 7�}�qvW�5�Q�R�X�t�d!||���|S�)"Nzcan't open Zip file: r ���rd����can't read Zip file: ����r���znot a Zip file: zcorrupt Zip file: ������������zbad central directory size: zbad central directory offset: z&bad central directory size or offset: �.����EOF read where not expecteds���PK����� �������������������� ����"����*���zbad local header offset: i����ascii�latin1�/r���z!zipimport: found {} names in {!r})�_io� open_coder���r����seek�END_CENTRAL_DIR_SIZE�tell�readr;����STRING_END_ARCHIVE�max�MAX_COMMENT_LEN�rfindr����EOFErrorr���rG����UnicodeDecodeError� translate�cp437_tabler���r���r���r#���rW���rX���)r"����fp�header_position�buffer� file_size�max_comment_start�data�pos�header_size� header_offset� arc_offsetr)����count�flags�compress�time�date�crc� data_size� name_size� extra_size�comment_size�file_offsetrD���r����tr ���r ���r���r ���`��s����� ��� � � � r ���u���� !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ c������������������C���sl���t�rt�d��td��da�z<zddlm}��W�n&�tk rR���t�d��td��Y�nX�W�5�da�X�t�d��|�S�)Nzzipimport: zlib UNAVAILABLE�)can't decompress data; zlib not availableTFr����� decompresszzipimport: zlib available)�_importing_zlibrW���rX���r����zlibr����� Exceptionr����r ���r ���r����_get_decompress_func���s���� r����c�������������� ���C���s���|\}}}}}}}} |dk�r$t�d��t�|����} z| �|��W�n&�tk rf���t�d|���|�d��Y�nX�| �d�}t|�dkr�td��|d�d��dkr�t�d |���|�d��t|d d���}t|dd���} d|�| �}||7�}z| �|��W�n(�tk �r���t�d|���|�d��Y�nX�| �|�}t|�|k�r4td��W�5�Q�R�X�|dk�rL|S�z t ��}W�n�t k �rt���t�d ��Y�nX�||d�S�)Nr���znegative data sizerk���r ���rw���rq���rl���s���PKzbad local file header: ����rv���zzipimport: can't read datar����i�)r���r~���r���r����r���r����r;���r����r���r����r����)r"���r?����datapathr����r����r����r����r����r����r����r����r����r����r����r�����raw_datar����r ���r ���r���r<�����s>���� r<���c�����������������C���s���t�|�|��dkS�)Nr���)�abs)�t1�t2r ���r ���r���� _eq_mtimeA��s����r����c�����������������C���s<��||d�}zt��|||�}W�n�tk r2���Y�d�S�X�|d@�dk}|r�|d@�dk}tjdkr�|shtjdkr�t|�|�} | d�k r�t�t�j| �} zt��|| ||��W�n�tk r����Y�d�S�X�nTt |�|�\}}|�r t t|dd���|�r�t|dd ���|k�r t� d |����d�S�t�|d d����} t| t��s8td|�d���| S�) N)rD���r���r���r���rd����never�alwaysrr���rm���rn���zbytecode is stale for zcompiled module z is not a code object)r���� _classify_pycrV����_imp�check_hash_based_pycs�_get_pyc_source�source_hash�_RAW_MAGIC_NUMBER�_validate_hash_pyc�_get_mtime_and_size_of_sourcer����r���rW���rX����marshal�loadsr���� _code_type� TypeError)r%���r=���rH���r.���r�����exc_detailsr����� hash_based�check_source�source_bytesr�����source_mtime�source_sizer6���r ���r ���r����_unmarshal_codeK��sX����� �� ����� ���r����c�����������������C���s���|���dd�}�|���dd�}�|�S�)Ns��� ���� ���� )r���)�sourcer ���r ���r����_normalize_line_endings~��s����r����c�����������������C���s���t�|�}t||�ddd�S�)NrU���T)�dont_inherit)r�����compile)r=���r����r ���r ���r����_compile_source���s����r����c�����������������C���sD���t��|�d?�d�|�d?�d@�|�d@�|d?�|d?�d@�|d@�d�d d d f �S�) N� ���i��������������������?���rd���r���)r�����mktime)�dr����r ���r ���r����_parse_dostime���s���� ���r����c�������������� ���C���st���zR|dd���dkst��|d�d��}|�j|�}|d�}|d�}|d�}t||�|fW�S��tttfk rn���Y�dS�X�d�S�)Nr�����c�or������������)r���r���)�AssertionErrorr!���r����r���� IndexErrorr����)r%���r���r?���r����r�����uncompressed_sizer ���r ���r���r�������s���� r����c�����������������C���sV���|dd���dkst��|d�d��}z|�j|�}W�n�tk rD���Y�d�S�X�t|�j|�S�d�S�)Nr���r����)r����r!���r���r<���r"���)r%���r���r?���r ���r ���r���r�������s����r����c�������������� ���C���s����t�|�|�}tD�]�\}}}||�}tjd|�jt|dd��z|�j|�}W�n�tk rX���Y�qX�|d�}t|�j|�} |r�t |�|||| �} n t || �} | d�kr�q|d�}| ||f��S�qtd|��|d��d�S�)Nz trying {}{}{}rd���)� verbosityr���rB���rC���)r,���rh���rW���rX���r"���r���r!���r���r<���r����r����r���)r%���r.���r���ri���rj���r7���rH���r?���r0���r����r6���r ���r ���r���r4������s$���� r4���c�������������������@���s<���e�Zd�ZdZdZdd��Zdd��Zdd��Zd d ��Zdd��Z d S�)r\���z�Private class used to support ZipImport.get_resource_reader(). This class is allowed to reference all the innards and private parts of the zipimporter. Fc�����������������C���s���||�_�||�_d�S�rf���)r���r.���)r%���r���r.���r ���r ���r���r*������s����z!_ZipImportResourceReader.__init__c�����������������C���s\���|�j��dd�}|��d|���}ddlm}�z||�j�|��W�S��tk rV���t|��Y�nX�d�S�)Nrc���r}���r���)�BytesIO)r.���r����ior����r���r@���r����FileNotFoundError)r%����resource�fullname_as_pathr���r����r ���r ���r���� open_resource���s����z&_ZipImportResourceReader.open_resourcec�����������������C���s���t��d�S�rf���)r����)r%���r����r ���r ���r���� resource_path���s����z&_ZipImportResourceReader.resource_pathc�����������������C���sH���|�j��dd�}|��d|���}z|�j�|��W�n�tk rB���Y�dS�X�dS�)Nrc���r}���FT)r.���r���r���r@���r���)r%���rD���r����r���r ���r ���r����is_resource���s����z$_ZipImportResourceReader.is_resourcec����������� ��� ���c���s����ddl�m}�||�j�|�j��}|�|�jj�}|jdks:t�|j }t ��}|�jjD�]f}z||��|�}W�n�tk r|���Y�qNY�nX�|j j}t |�dkr�|jV��qN||krN|�|��|V��qNd�S�)Nr���)�PathrE���)�pathlibr����r���rA���r.����relative_tor"���rD���r�����parent�setr!���r���r;����add) r%���r����� fullname_path� relative_path�package_path�subdirs_seen�filename�relative�parent_namer ���r ���r����contents���s"���� z!_ZipImportResourceReader.contentsN) r���r���r ���rb���r]���r*���r����r����r����r����r ���r ���r ���r���r\������s��� r\���)-rb����_frozen_importlib_externalr���r���r����_frozen_importlibrW���r����r~���r����rL���r�����__all__r����path_separatorsr���rV���r���r����typerO���r����r����r����r���rh���r,���r-���r+���r ���r����r����r����r<���r����r�����__code__r����r����r����r����r����r����r4���r\���r ���r ���r ���r����<module>���sX������ ~�. .