Your IP : 3.133.124.80


Current Path : /opt/alt/python310/lib64/python3.10/importlib/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/importlib/__pycache__/readers.cpython-310.pyc

o

6��f�@sxddlZddlZddlZddlmZdd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej	�Z
Gdd
�d
ej�ZdS)�N�)�abccCsttj�|��S�N)�iter�collections�OrderedDict�fromkeys)�items�r
�8/opt/alt/python310/lib64/python3.10/importlib/readers.py�remove_duplicates�rc@�$eZdZdd�Zdd�Zdd�ZdS)�
FileReadercCst�|j�j|_dSr)�pathlib�Path�path�parent)�self�loaderr
r
r�__init__szFileReader.__init__cC�t|j�|��S�z{
        Return the file system path to prevent
        `resources.path()` from creating a temporary
        copy.
        ��strr�joinpath�r�resourcer
r
r�
resource_path�zFileReader.resource_pathcC�|jSr�r�rr
r
r�files�zFileReader.filesN��__name__�
__module__�__qualname__rrr#r
r
r
rrsrcs4eZdZdd�Z�fdd�Zdd�Zdd�Z�ZS)	�	ZipReadercCs4|�d�\}}}|j�dd�|d|_|j|_dS)N�.�\�/)�
rpartition�prefix�replace�archive)rr�module�_�namer
r
rrszZipReader.__init__c
s6zt��|�WSty}zt|jd��d}~ww�Nr)�super�
open_resource�KeyError�FileNotFoundError�args)rr�exc��	__class__r
rr6!s��zZipReader.open_resourcecCs|���|�}|��o|��Sr)r#r�is_file�exists)rr�targetr
r
r�is_resource'szZipReader.is_resourcecCst�|j|j�Sr)�zipfilerr0r.r"r
r
rr#-r
zZipReader.files)r&r'r(rr6r@r#�
__classcell__r
r
r;rr)s
r)c@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
e
Zdd�Ze
dd��Zdd�ZdS)�MultiplexedPathz�
    Given a series of Traversable objects, implement a merged
    version of the interface across all objects. Useful for
    namespace packages which may be multihomed at a single
    name.
    cGsHtttjt|���|_|jsd}t|��tdd�|jD��s"td��dS)Nz.MultiplexedPath must contain at least one pathcss�|]}|��VqdSr)�is_dir��.0rr
r
r�	<genexpr>>s�z+MultiplexedPath.__init__.<locals>.<genexpr>z)MultiplexedPath only supports directories)	�list�maprrr�_pathsr8�all�NotADirectoryError)r�paths�messager
r
rr9s�zMultiplexedPath.__init__ccsB�g}|jD]}|��D]}|j|vrq|�|j�|VqqdSr)rJ�iterdirr3�append)rZvisitedr�filer
r
rrOAs�

��zMultiplexedPath.iterdircC�t|�d����Nz is not a file�r8r"r
r
r�
read_bytesJ�zMultiplexedPath.read_bytescOrRrSrT�rr9�kwargsr
r
r�	read_textMrVzMultiplexedPath.read_textcC�dS)NTr
r"r
r
rrDP�zMultiplexedPath.is_dircCrZ)NFr
r"r
r
rr=Sr[zMultiplexedPath.is_filecCs.|��D]}|j|kr|Sq|jd|Sr4)rOr3rJ)r�childrQr
r
rrVs

�zMultiplexedPath.joinpathcOrRrSrTrWr
r
r�open`rVzMultiplexedPath.opencCs|jdjSr4)rJr3r"r
r
rr3cszMultiplexedPath.namecCs"d�dd�|jD��}d|�d�S)Nz, css�|]	}d|�d�VqdS)�'Nr
rEr
r
rrGhs�z+MultiplexedPath.__repr__.<locals>.<genexpr>zMultiplexedPath(�))�joinrJ)rrMr
r
r�__repr__gszMultiplexedPath.__repr__N)r&r'r(�__doc__rrOrUrYrDr=r�__truediv__r]�propertyr3rar
r
r
rrC1s	
rCc@r)�NamespaceReadercCs&dt|�vr
td��tt|��|_dS)NZ
NamespacePathzInvalid path)r�
ValueErrorrCrHr)r�namespace_pathr
r
rrmszNamespaceReader.__init__cCrrrrr
r
rrrrzNamespaceReader.resource_pathcCr rr!r"r
r
rr#zr$zNamespaceReader.filesNr%r
r
r
rrelsre)rrAr�rrZTraversableResourcesrr)ZTraversablerCrer
r
r
r�<module>s;

?>