관리-도구
편집 파일: _adapters.cpython-38.pyc
U +�e� � @ sd d dl mZ d dlmZ ddlmZ G dd� d�ZG dd� d�Zdd d�ZG dd � d �Z dd� Z dS )� )�suppress)� TextIOWrapper� )�abcc @ s( e Zd ZdZdd� fdd�Zdd� ZdS ) �SpecLoaderAdapterz> Adapt a package spec to adapt the underlying loader. c C s | j S �N)�loader��spec� r �K/opt/hc_python/lib/python3.8/site-packages/importlib_resources/_adapters.py�<lambda> � zSpecLoaderAdapter.<lambda>c C s || _ ||�| _d S r )r r )�selfr �adapterr r r �__init__ s zSpecLoaderAdapter.__init__c C s t | j|�S r )�getattrr �r �namer r r �__getattr__ s zSpecLoaderAdapter.__getattr__N)�__name__� __module__�__qualname__�__doc__r r r r r r r s r c @ s e Zd ZdZdd� Zdd� ZdS )�TraversableResourcesLoaderz9 Adapt a loader to provide TraversableResources. c C s || _ d S r r �r r r r r r s z#TraversableResourcesLoader.__init__c C s t | j��� S r )�CompatibilityFilesr �_nativer r r r �get_resource_reader s z.TraversableResourcesLoader.get_resource_readerN)r r r r r r r r r r r s r �rc O s8 |dkrt | f|�|�S |dkr$| S td|� d���d S )Nr �rbzInvalid mode value 'z"', only 'r' and 'rb' are supported)r � ValueError)�file�mode�args�kwargsr r r �_io_wrapper s r&