관리-도구
편집 파일: resources.cpython-310.opt-1.pyc
o 6��fI � @ s� d dl Z d dlZddlmZ ddlmZmZ ddlmZ d dlm Z d dl mZ d dlm Z d d lmZmZ d d lmZ d dlmZ d dlmZmZmZ d d lmZ d dlmZmZ d dlmZ d dlmZ g d�Z ee!ef Z"ee!e j#f Z$de"de$defdd�Z% d3de"de$de!de!def dd�Z&de"de$de'fdd�Z( d3de"de$de!de!de!f dd �Z)de"de$dd!fd"d#�Z*d$d%� Z+d&d'� Z,d(d)� Z-de"d*e!de.fd+d,�Z/de"dee! fd-d.�Z0ed/d0� �Z1e1�2e�d1d2� �Z3dS )4� N� )�_common)�as_file�files)�ResourceReader)�suppress)�ResourceLoader)� ModuleSpec)�BytesIO� TextIOWrapper)�Path)� ModuleType)�ContextManager�Iterable�Union)�cast)�BinaryIO�TextIO)�Sequence)�singledispatch)�Package�Resourcer r �contentsr �is_resource�open_binary� open_text�path�read_binary� read_text�package�resource�returnc C s& t �|�}t �| �} t �| �}|dur|�|�S tt| j�}|jdur'|j}n|j dur8t j�t j� |j ��g}|D ]N}t j�||�}z t|dd�W S ty� tt|j�}d}t|jd�rztt�� |�|�}W d � n1 suw Y |dur�t|� Y S Y q:w t|�d|j����)zDReturn a file-like object opened for binary reading of the resource.N�rb)�mode�get_dataz resource not found in )r �normalize_path�get_package�get_resource_reader� open_resourcer r �__spec__�submodule_search_locations�origin�osr �dirname�abspath�join�open�OSErrorr �loader�hasattrr r$ r �FileNotFoundError�name) r r �reader�spec�pathsZpackage_path� full_pathr2 �data� r; �:/opt/alt/python310/lib64/python3.10/importlib/resources.pyr ( s4 ���r �utf-8�strict�encoding�errorsc C s t t| |�||d�S )zBReturn a file-like object opened for text reading of the resource.)r? r@ )r r )r r r? r@ r; r; r<