�
<��g� � � � d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlm Z ej
d� � Z G d� de� � Zd� Z
dd�ZdS )
� N)�MutableMapping)�cached_property)� url_to_fszfsspec.mappingc � � e Zd ZdZdd�Zed� � � Zd� Zdd�Zd � Z d
� Z
d� Zd� Zdd
�Z
dd�Zd� Zd� Zd� Zd� Zd� Zd� ZdS )�FSMapa� Wrap a FileSystem instance as a mutable wrapping.
The keys of the mapping become files under the given root, and the
values (which must be bytes) the contents of those files.
Parameters
----------
root: string
prefix for all the files
fs: FileSystem instance
check: bool (=True)
performs a touch at the location, to check for write access.
Examples
--------
>>> fs = FileSystem(**parameters) # doctest: +SKIP
>>> d = FSMap('my-data/path/', fs) # doctest: +SKIP
or, more likely
>>> d = fs.get_mapper('my-data/path/')
>>> d['loc1'] = b'Hello World' # doctest: +SKIP
>>> list(d.keys()) # doctest: +SKIP
['loc1']
>>> d['loc1'] # doctest: +SKIP
b'Hello World'
FNc �J � || _ |� |� � | _ |� t j |d� � � � d d� | _ |�t t t f}|| _ || _
|| _ |r4| j � |� � s| j �
|� � |ri| j � |� � st d|� d�� � �| j � |dz � � | j � |dz � � d S d S )N�x�����zPath z9 does not exist. Create with the ``create=True`` keywordz/a)�fs�_strip_protocol�root� posixpath�join�_root_key_to_str�FileNotFoundError�IsADirectoryError�NotADirectoryError�missing_exceptions�check�create�exists�mkdir�
ValueError�touch�rm)�selfr
r r r r s �^/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/fsspec/mapping.py�__init__zFSMap.__init__) s2 � �����&�&�t�,�,�� � "� 2� 2�9�>�$��3L�3L� M� M�c�r�c� R����%�!�!�"�"��
#5�����
����� $��7�>�>�$�'�'�
$���
�
�d�#�#�#�� $��7�>�>�$�'�'�
� �9�D� 9� 9� 9�� � �
�G�M�M�$��+�&�&�&��G�J�J�t�d�{�#�#�#�#�#� $� $� c �<