3
W>p_6                 @   s   d dl mZ d dlZddlmZmZmZmZ yd dlm	Z	m
Z
mZ W n ek
rX   Y nX 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   s   t dS )zReturn 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.
        N)r   )selfresource r   /home/aldo/Documentos/tesis/tesis/device auto/pruebas pulsar/pruebaclonado/envClonado/lib/python3.6/site-packages/importlib_resources/abc.pyopen_resource   s    zResourceReader.open_resourcec             C   s   t dS )zReturn 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.
        N)r   )r   r   r   r   r   resource_path   s    zResourceReader.resource_pathc             C   s   t dS )zjReturn True if the named 'path' is a resource.

        Files are resources, directories are not.
        N)r   )r   pathr   r   r   is_resource,   s    zResourceReader.is_resourcec             C   s   t dS )z+Return an iterable of entries in `package`.N)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   s   dS )z3
        Yield Traversable objects in self
        Nr   )r   r   r   r   iterdirC   s    zTraversable.iterdirc             C   s   dS )z0
        Read contents of self as bytes
        Nr   )r   r   r   r   
read_bytesI   s    zTraversable.read_bytesNc             C   s   dS )z0
        Read contents of self as bytes
        Nr   )r   encodingr   r   r   	read_textO   s    zTraversable.read_textc             C   s   dS )z.
        Return True if self is a dir
        Nr   )r   r   r   r   is_dirU   s    zTraversable.is_dirc             C   s   dS )z/
        Return True if self is a file
        Nr   )r   r   r   r   is_file[   s    zTraversable.is_filec             C   s   dS )z2
        Return Traversable child in self
        Nr   )r   childr   r   r   joinpatha   s    zTraversable.joinpathc             C   s   dS )z2
        Return Traversable child in self
        Nr   )r   r"   r   r   r   __truediv__g   s    zTraversable.__truediv__rc             O   s   dS )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   s    zTraversable.openc             C   s   dS )zM
        The base name of this object without any parent references.
        Nr   )r   r   r   r   namew   s    zTraversable.name)N)r%   )r   r   r   r   r   r   r   r   r   r    r!   r#   r$   r)   abstractpropertyr*   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   s   dS )z3Return a Traversable object for the loaded package.Nr   )r   r   r   r   files   s    zTraversableResources.filesc             C   s   | j  j|jdS )Nrb)r-   r#   r)   )r   r   r   r   r   r      s    z"TraversableResources.open_resourcec             C   s   t |d S )N)r   )r   r   r   r   r   r      s    z"TraversableResources.resource_pathc             C   s   | j  j|j S )N)r-   r#   r!   )r   r   r   r   r   r      s    z TraversableResources.is_resourcec             C   s   dd | j  j D S )Nc             s   s   | ]}|j V  qd S )N)r*   ).0itemr   r   r   	<genexpr>   s    z0TraversableResources.contents.<locals>.<genexpr>)r-   r   )r   r   r   r   r      s    zTraversableResources.contentsN)
r   r   r   r   r   r-   r   r   r   r   r   r   r   r   r,      s
   r,   )
__future__r   r   _compatr   r   r   r   typingr   r	   r
   ImportErrorr   r   r,   r   r   r   r   <module>   s   .B