HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //var/opt/nydus/ops/importlib_resources/__pycache__/_py2.cpython-39.pyc
a

�,�h��@s�ddlZddlZddlmZddlmZddlmZddlm	Z	m
Z
mZdd�Z
d	d
�Zdd�Zd
d�Zddd�Zdd�Zd dd�Zdd�Zdd�Zdd�Zdd�ZdS)!�N�)�_common)�FileNotFoundError)�
import_module)�BytesIO�
TextIOWrapper�opencCst|t�s|St|�S)z)If name is a string, resolve to a module.)�
isinstance�
basestringr��name�r
�I/opt/nydus/tmp/pip-target-wkfpz8uv/lib/python/importlib_resources/_py2.py�_resolve
s
rcCs$t|�}t|d�s td�|���|S)��Normalize a path by ensuring it is a string.

    If the resulting string contains path separators, an exception is raised.
    �__path__z{!r} is not a package)r�hasattr�	TypeError�format)�package�moduler
r
r�_get_packages
rcCs.t|�}tj�|�\}}|r*td�|���|S)rz{!r} must be only a file name)�str�os�path�split�
ValueErrorr)rZstr_path�parent�	file_namer
r
r�_normalize_paths
rc	Cs�t|�}t|�}tj�|j�}tj�||�}tj�|�}zt|d�WSt	y�z*|j
}|t|j�dd�}|�
|�}Wn0t	tfy�|j}d�||�}t|��Yn0t|�YS0dS)zDReturn a file-like object opened for binary reading of the resource.�rbrNz{!r} resource not found in {!r})rrrr�dirname�__file__�join�abspath�io_open�IOError�
__loader__�len�archive�get_data�AttributeError�__name__rrr)	r�resource�package_path�
relative_path�	full_path�loader�data�package_name�messager
r
r�open_binary(s&�r5�utf-8�strictcCstt||�||d�S)zBReturn a file-like object opened for text reading of the resource.)�encoding�errors)rr5)rr-r8r9r
r
r�	open_textFs�r:cCs6t||��}|��Wd�S1s(0YdS)z+Return the binary contents of the resource.N)r5�read)rr-�fpr
r
r�read_binaryLsr=cCs:t||||��}|��Wd�S1s,0YdS)z�Return the decoded string of the resource.

    The decoding-related arguments have the same semantics as those of
    bytes.decode().
    N)r:r;)rr-r8r9r<r
r
r�	read_textRsr>cCst�t|��S�N)r�from_packager�rr
r
r�files\srBcCs,t|��t|��}|��s"t|��t�|�S)akA context manager providing a file path object to the resource.

    If the resource does not already exist on its own on the file system,
    a temporary file will be created. If the file was created, the file
    will be deleted upon exiting the context manager (no exception is
    raised if the file was deleted prior to the context manager
    exiting).
    )rB�joinpathr�is_filerr�as_file)rr-rr
r
rr`s	rc
Cszt|�}t|�ztt|��}Wn:tyZ}z"|jtjtjfvrD�WYd}~dSd}~00||vrhdSt�	|�|�
�S)zUTrue if name is a resource inside package.

    Directories are *not* resources.
    NF)rr�set�contents�OSError�errno�ENOENT�ENOTDIRrr@rD)rr�package_contents�errorr
r
r�is_resourceosrNcCs$t|�}tdd�t�|���D��S)z�Return an iterable of entries in `package`.

    Note that not all entries are resources.  Specifically, directories are
    not considered resources.  Use `is_resource()` on each entry returned here
    to check if it is a resource or not.
    css|]}|jVqdSr?r)�.0�itemr
r
r�	<genexpr>��zcontents.<locals>.<genexpr>)r�listrr@�iterdirrAr
r
rrG�srG)r6r7)r6r7)rrI�rZ_compatr�	importlibr�iorrrr%rrrr5r:r=r>rBrrNrGr
r
r
r�<module>s