
     d.                         d dl Z d dlmZmZmZ ddlmZmZ  G d de j                  Z	e G d d	e                      Z
 G d
 de	          ZdS )    N)BinaryIOIterableText   )runtime_checkableProtocolc                       e Zd ZdZej        dedefd            Zej        dedefd            Z	ej        dede
fd            Zej        dee         fd            Zd	S )
ResourceReaderzDAbstract base class for loaders to provide resource reading support.resourcereturnc                     t           )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.
        FileNotFoundErrorselfr   s     sC:\Users\ChattiNader\Documents\MyHotelMatch\api\dev\Lib\site-packages\setuptools/_vendor/importlib_resources/abc.pyopen_resourcezResourceReader.open_resource
   s
          c                     t           )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.
        r   r   s     r   resource_pathzResourceReader.resource_path   s
      r   pathc                     t           )zjReturn True if the named 'path' is a resource.

        Files are resources, directories are not.
        r   r   r   s     r   is_resourcezResourceReader.is_resource#   s
      r   c                     t           )z+Return an iterable of entries in `package`.r   r   s    r   contentszResourceReader.contents+   s
      r   N)__name__
__module____qualname____doc__abcabstractmethodr   r   r   r   boolr   r   strr    r   r   r
   r
      s        NN	 d 	 x 	  	  	  	  	
 d 
 t 
  
  
  
  	            	 (3-            r   r
   )	metaclassc                       e Zd ZdZej        d             Zd ZddZej        de	fd            Z
ej        de	fd            Zej        d	             Zd
 Zej        dd            Zej        defd            ZdS )Traversablezt
    An object with a subset of pathlib.Path methods suitable for
    traversing directories and opening files.
    c                     dS )z3
        Yield Traversable objects in self
        Nr&   r   s    r   iterdirzTraversable.iterdir8         r   c                     |                      d          5 }|                                cddd           S # 1 swxY w Y   dS )z0
        Read contents of self as bytes
        rbNopenread)r   strms     r   
read_byteszTraversable.read_bytes>   s     YYt__ 	99;;	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   7;;Nc                     |                      |          5 }|                                cddd           S # 1 swxY w Y   dS )z/
        Read contents of self as text
        )encodingNr/   )r   r5   r2   s      r   	read_textzTraversable.read_textE   s     YYY)) 	T99;;	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   8<<r   c                     dS )z4
        Return True if self is a directory
        Nr&   r   s    r   is_dirzTraversable.is_dirL   r,   r   c                     dS )z/
        Return True if self is a file
        Nr&   r   s    r   is_filezTraversable.is_fileR   r,   r   c                     dS )2
        Return Traversable child in self
        Nr&   r   childs     r   joinpathzTraversable.joinpathX   r,   r   c                 ,    |                      |          S )r<   )r?   r=   s     r   __truediv__zTraversable.__truediv__^   s     }}U###r   rc                     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kwargss       r   r0   zTraversable.opend   r,   r   c                     dS )zM
        The base name of this object without any parent references.
        Nr&   r   s    r   namezTraversable.namen   r,   r   N)rB   )r   r   r    r!   r"   r#   r+   r3   r6   r$   r8   r:   r?   rA   r0   abstractpropertyr%   rH   r&   r   r   r)   r)   1   s3        
 	  
      	    
 	    
 	  
$ $ $ 	    	c      r   r)   c                   J    e Zd ZdZej        d             Zd Zd Zd Z	d Z
dS )TraversableResourceszI
    The required interface for providing traversable
    resources.
    c                     dS )z3Return a Traversable object for the loaded package.Nr&   r   s    r   fileszTraversableResources.files{   r,   r   c                 v    |                                                      |                              d          S )Nr.   )rN   r?   r0   r   s     r   r   z"TraversableResources.open_resource   s,    zz||$$X..33D999r   c                      t          |          rI   r   r   s     r   r   z"TraversableResources.resource_path   s    )))r   c                 t    |                                                      |                                          S rI   )rN   r?   r:   r   s     r   r   z TraversableResources.is_resource   s*    zz||$$T**22444r   c                 b    d |                                                                  D             S )Nc              3   $   K   | ]}|j         V  d S rI   )rH   ).0items     r   	<genexpr>z0TraversableResources.contents.<locals>.<genexpr>   s$      ==d	======r   )rN   r+   r   s    r   r   zTraversableResources.contents   s*    ==djjll&:&:&<&<====r   N)r   r   r    r!   r"   r#   rN   r   r   r   r   r&   r   r   rL   rL   u   s|         
 	B B B: : :* * *5 5 5> > > > >r   rL   )r"   typingr   r   r   _compatr   r   ABCMetar
   r)   rL   r&   r   r   <module>rZ      s    



 + + + + + + + + + + 0 0 0 0 0 0 0 0'  '  '  '  ' s{ '  '  '  ' T @ @ @ @ @( @ @ @F> > > > >> > > > > >r   