�
<��g^ � �b � d dl mZ G d� d� � Z G d� d� � Z G d� de� � ZdS ) � )�dequec �2 � e Zd ZdZd� Zd� Zd� Zd� Zd d�ZdS )
�Transactiona Filesystem transaction write context
Gathers files for deferred commit or discard, so that several write
operations can be finalized semi-atomically. This works by having this
instance as the ``.transaction`` attribute of the given filesystem
c �: � || _ t � � | _ dS )�O
Parameters
----------
fs: FileSystem instance
N)�fsr �files)�selfr �kwargss �b/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/fsspec/transaction.py�__init__zTransaction.__init__ s � � ����W�W��
�
�
� c �. � | � � � | S �N)�start�r
s r � __enter__zTransaction.__enter__ s � ��
�
�����r c � � | � |du �� � | j r!d| j _ d| j _ d| _ dS dS )z;End transaction and commit, if exit is not due to exceptionN)�commitF)�completer �_intrans�_transaction)r
�exc_type�exc_val�exc_tbs r �__exit__zTransaction.__exit__ sP � �
�
�
�X��-�
�.�.�.��7� �$�D�G��#'�D�G� ��D�G�G�G� � r c �D � t � � | _ d| j _ dS )z&Start a transaction on this FileSystemTN)r r r r r s r r zTransaction.start"