← back to Atmos Game
assets/gen/.venv/lib/python3.12/site-packages/fsspec/__pycache__/spec.cpython-312.pyc
953 lines
�
c�bj1 � �\ � d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl m
Z
d dlmZ d dl
mZ d dlmZmZ ddlmZ dd lmZmZ dd
lmZ ddlmZ ddlmZmZmZmZm Z m!Z!m"Z" ejF d
� Z$d� Z% G d� de&� Z' G d� de'�� Z( G d� dejR � Z*d� Z+y)� )�annotationsN)�ESPIPE)� has_magic)�sha256)�Any�ClassVar� )�DEFAULT_CALLBACK)�apply_config�conf)�DirCache)�Transaction)�_unstrip_protocol�glob_translate�
isfilelike�other_paths�
read_block�stringify_path�tokenize�fsspecc � � | |i |��S �N� )�cls�args�kwargss �b/Users/macstudio3/Projects/atmos-game/assets/gen/.venv/lib/python3.12/site-packages/fsspec/spec.py�
make_instancer s � ������� c �, � � e Zd ZdZ� fd�Z� fd�Z� xZS )�_Cacheda
Metaclass for caching file system instances.
Notes
-----
Instances are cached according to
* The values of the class attributes listed in `_extra_tokenize_attributes`
* The arguments passed to ``__init__``.
This creates an additional reference to the filesystem, which prevents the
filesystem from being garbage collected when all *user* references go away.
A call to the :meth:`AbstractFileSystem.clear_instance_cache` must *also*
be made for a filesystem instance to be garbage collected.
c �� �� t �| � |i |�� t j d� rt j
� | _ ni | _ t j � | _ y )N�weakref_instance_cache)
�super�__init__r �get�weakref�WeakValueDictionary�_cache�os�getpid�_pid)r r r � __class__s �r r% z_Cached.__init__5 sH �� �
���$�)�&�)� �8�8�,�-� �4�4�6�C�J��C�J��9�9�;��r c � �� � t � |� }t � fd�� j D � � }� j D �ci c] }||v s�||j |� �� }}t � dd� r/|j
dd� st � � j g|�|��i |��}n/t � � j t j � g|�|��i |��}|j dd� }t j � � j k7 r3� j j � t j � � _ |s0� j r$|� j v r|� _ � j | S t# �
� �H |i |�|��}||_ ||_ ||_ |j, r|j. rddlm} | |� � j r|s|� _ |� j |<