o
    }¨Êh6  ã                   @   s�   d dl mZ d dlZddlmZmZmZmZ zd dlm	Z	m
Z
mZ W n	 ey+   Y nw G dd„ deƒZeG dd	„ d	eƒƒZG d
d„ deƒZdS )é    )Úabsolute_importNé   )ÚABCÚFileNotFoundErrorÚruntime_checkableÚProtocol)ÚBinaryIOÚIterableÚTextc                   @   sH   e Zd ZdZejdd„ ƒZejdd„ ƒZejdd„ ƒZejdd	„ ƒZ	d
S )ÚResourceReaderzDAbstract base class for loaders to provide resource reading support.c                 C   ó   t ‚)zÑReturn an opened, file-like object for binary reading.

        The 'resource' argument is expected to represent only a file name.
        If the resource cannot be found, FileNotFoundError is raised.
        ©r   ©ÚselfÚresource© r   úI/var/www/html/env/lib/python3.10/site-packages/importlib_resources/abc.pyÚopen_resource   s   zResourceReader.open_resourcec                 C   r   )zçReturn the file system path to the specified resource.

        The 'resource' argument is expected to represent only a file name.
        If the resource does not exist on the file system, raise
        FileNotFoundError.
        r   r   r   r   r   Úresource_path   s   zResourceReader.resource_pathc                 C   r   )zjReturn True if the named 'path' is a resource.

        Files are resources, directories are not.
        r   ©r   Úpathr   r   r   Úis_resource,   s   zResourceReader.is_resourcec                 C   r   )z+Return an iterable of entries in `package`.r   ©r   r   r   r   Úcontents5   s   zResourceReader.contentsN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚabcÚabstractmethodr   r   r   r   r   r   r   r   r      s    


r   c                   @   s’   e Zd ZdZejdd„ ƒZejdd„ ƒZejddd„ƒZejd	d
„ ƒZ	ejdd„ ƒZ
ejdd„ ƒZejdd„ ƒZejddd„ƒZejdd„ ƒZdS )ÚTraversablezt
    An object with a subset of pathlib.Path methods suitable for
    traversing directories and opening files.
    c                 C   ó   dS )z3
        Yield Traversable objects in self
        Nr   r   r   r   r   ÚiterdirC   ó    zTraversable.iterdirc                 C   r!   ©z0
        Read contents of self as bytes
        Nr   r   r   r   r   Ú
read_bytesI   r#   zTraversable.read_bytesNc                 C   r!   r$   r   )r   Úencodingr   r   r   Ú	read_textO   r#   zTraversable.read_textc                 C   r!   )z.
        Return True if self is a dir
        Nr   r   r   r   r   Úis_dirU   r#   zTraversable.is_dirc                 C   r!   )z/
        Return True if self is a file
        Nr   r   r   r   r   Úis_file[   r#   zTraversable.is_filec                 C   r!   ©z2
        Return Traversable child in self
        Nr   ©r   Úchildr   r   r   Újoinpatha   r#   zTraversable.joinpathc                 C   r!   r*   r   r+   r   r   r   Ú__truediv__g   r#   zTraversable.__truediv__Úrc                 O   r!   )zý
        mode may be 'r' or 'rb' to open as text or binary. Return a handle
        suitable for reading (same as pathlib.Path.open).

        When opening as text, accepts encoding parameters such as those
        accepted by io.TextIOWrapper.
        Nr   )r   ÚmodeÚargsÚkwargsr   r   r   Úopenm   r#   zTraversable.openc                 C   r!   )zM
        The base name of this object without any parent references.
        Nr   r   r   r   r   Únamew   r#   zTraversable.name©N)r/   )r   r   r   r   r   r   r"   r%   r'   r(   r)   r-   r.   r3   Úabstractpropertyr4   r   r   r   r   r    <   s(    





	r    c                   @   s:   e Zd Zejdd„ ƒZdd„ Zdd„ Zdd„ Zd	d
„ Z	dS )ÚTraversableResourcesc                 C   r!   )z3Return a Traversable object for the loaded package.Nr   r   r   r   r   Úfiles€   r#   zTraversableResources.filesc                 C   s   |   ¡  |¡ d¡S )NÚrb)r8   r-   r3   r   r   r   r   r   „   s   z"TraversableResources.open_resourcec                 C   s   t |ƒ‚r5   r   r   r   r   r   r   ‡   s   z"TraversableResources.resource_pathc                 C   s   |   ¡  |¡ ¡ S r5   )r8   r-   r)   r   r   r   r   r   Š   s   z TraversableResources.is_resourcec                 C   s   dd„ |   ¡  ¡ D ƒS )Nc                 s   s   � | ]}|j V  qd S r5   )r4   )Ú.0Úitemr   r   r   Ú	<genexpr>Ž   s   € z0TraversableResources.contents.<locals>.<genexpr>)r8   r"   r   r   r   r   r   �   s   zTraversableResources.contentsN)
r   r   r   r   r   r8   r   r   r   r   r   r   r   r   r7      s    
r7   )Ú
__future__r   r   Ú_compatr   r   r   r   Útypingr   r	   r
   ÚImportErrorr   r    r7   r   r   r   r   Ú<module>   s    ÿ.B