File: //usr/local/lib/python3.6/site-packages/importlib_resources/__pycache__/abc.cpython-36.pyc
3
LBj. � @ sh d dl Z d dlmZmZmZ ddlmZmZ G dd� de jd�Z eG dd � d e��Z
G d
d� de �ZdS )� N)�BinaryIO�Iterable�Text� )�runtime_checkable�Protocolc @ sj e Zd ZdZejeed�dd��Zejeed�dd��Z ejee
d�dd ��Zejee
d
�dd��Zd
S )�ResourceReaderzDAbstract base class for loaders to provide resource reading support.)�resource�returnc C s t �dS )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.
N)�FileNotFoundError)�selfr � r
�F/tmp/pip-build-44150kxb/importlib-resources/importlib_resources/abc.py�
open_resource
s
zResourceReader.open_resourcec C s t �dS )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.
N)r )r r r
r
r �
resource_path s zResourceReader.resource_path)�pathr
c C s t �dS )zjReturn True if the named 'path' is a resource.
Files are resources, directories are not.
N)r )r r r
r
r �is_resource# s zResourceReader.is_resource)r
c C s t �dS )z+Return an iterable of entries in `package`.N)r )r r
r
r �contents+ s zResourceReader.contentsN)�__name__�
__module__�__qualname__�__doc__�abc�abstractmethodr r r r �boolr r �strr r
r
r
r r s r )� metaclassc @ s� e Zd ZdZejdd� �Zdd� Zddd�Zeje d �d
d��Z
eje d �dd
��Zejdd� �Zdd� Z
ejddd��Zejed �dd��ZdS )�Traversablezt
An object with a subset of pathlib.Path methods suitable for
traversing directories and opening files.
c C s dS )z3
Yield Traversable objects in self
Nr
)r r
r
r �iterdir8 s zTraversable.iterdirc C s | j d��
}|j� S Q R X dS )z0
Read contents of self as bytes
�rbN)�open�read)r �strmr
r
r �
read_bytes>