
    Ύi
                         d Z ddlZddlmZmZ ddlmZ  e            Zd Z	eddd	Z
d
 ZedddZd Zd Zd Zd Zd ZdS )z5Simplified function-based API for importlib.resources    N   )as_filefiles)TraversalErrorc                 H    t          | |                              d          S )z8Open for binary reading the *resource* within *package*.rb)_get_resourceopenanchor
path_namess     R/var/www/icac/venv/lib/python3.11/site-packages/importlib_resources/_functional.pyopen_binaryr      s     ,,11$777    strictencodingerrorsc                r    t          ||          }t          | |          }|                    d||          S )z6Open for text reading the *resource* within *package*.rr   )_get_encoding_argr	   r
   r   r   r   r   resources        r   	open_textr      s8     X66HVZ00H==x=???r   c                 F    t          | |                                          S )zARead and return contents of *resource* within *package* as bytes.)r	   
read_bytesr   s     r   read_binaryr      s    ,,77999r   c                p    t          ||          }t          | |          }|                    ||          S )z?Read and return contents of *resource* within *package* as str.r   )r   r	   	read_textr   s        r   r   r      s9     X66HVZ00Hx???r   c                 <    t          t          | |                    S )z@Return the path to the *resource* as an actual file system path.)r   r	   r   s     r   pathr!   #   s    =44555r   c                 j    	 t          | |                                          S # t          $ r Y dS w xY w)zjReturn ``True`` if there is a resource named *name* in the package,

    Otherwise returns ``False``.
    F)r	   is_filer   r   s     r   is_resourcer$   (   sE    
VZ0088:::   uus   !$ 
22c                     t          j        dt          d           d t          | |                                          D             S )zReturn an iterable over the named resources within the package.

    The iterable returns :class:`str` resources (e.g. files).
    The iterable does not recurse into subdirectories.
    zPimportlib.resources.contents is deprecated. Use files(anchor).iterdir() instead.r   )
stacklevelc              3   $   K   | ]}|j         V  d S )N)name).0r   s     r   	<genexpr>zcontents.<locals>.<genexpr>?   s$      VVhHMVVVVVVr   )warningswarnDeprecationWarningr	   iterdirr   s     r   contentsr/   3   sU     M	/	    WV-
*K*K*S*S*U*UVVVVr   c                 `    |t           u r$t          |           dk    rt          d          dS |S )Nr   z5'encoding' argument required with multiple path nameszutf-8)_MISSINGlen	TypeError)r   r   s     r   r   r   B   sA    
 8z??QG   7Or   c                 R    | t          d           t          |           j        | S )Nz)anchor must be module or string, got None)r3   r   joinpathr   s     r   r	   r	   Q   s,    ~CDDD!5==!:..r   )__doc__r+   _commonr   r   abcr   objectr1   r   r   r   r   r!   r$   r/   r   r	    r   r   <module>r;      s	   ; ;  # # # # # # # #      6888 8 8
 -5X @ @ @ @ @: : :
 -5X @ @ @ @ @6 6 6
  W W W  / / / / /r   