← back to Atmos Game

assets/gen/.venv/lib/python3.12/site-packages/fsspec/__pycache__/dircache.cpython-312.pyc

54 lines

�

c�bj�
��:�ddlZddlmZddlmZGd�de�Zy)�N)�MutableMapping)�	lru_cachec�N�eZdZdZ			dd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zy)
�DirCachea�
    Caching of directory listings, in a structure like::

        {"path0": [
            {"name": "path0/file0",
             "size": 123,
             "type": "file",
             ...
            },
            {"name": "path0/file1",
            },
            ...
            ],
         "path1": [...]
        }

    Parameters to this class control listing expiry or indeed turn
    caching off
    Nc���i�_i�_|rt|dz��fd���_|�_|�_|�_y)a

        Parameters
        ----------
        use_listings_cache: bool
            If False, this cache never returns items, but always reports KeyError,
            and setting items has no effect
        listings_expiry_time: int or float (optional)
            Time in seconds that a listing is considered valid. If None,
            listings do not expire.
        max_paths: int (optional)
            The number of most recent listings that are considered valid; 'recent'
            refers to when the entry was set.
        �c�<���jj|d�S�N)�_cache�pop)�key�selfs ��f/Users/macstudio3/Projects/atmos-game/assets/gen/.venv/lib/python3.12/site-packages/fsspec/dircache.py�<lambda>z#DirCache.__init__.<locals>.<lambda>3s���4�;�;�?�?�3�PT�;U�N)r�_timesr�_q�use_listings_cache�listings_expiry_time�	max_paths)rrrr�kwargss`    r�__init__zDirCache.__init__sE���*�������.�i�	�A�
�.�/U�V�D�G�"4���$8��!�"��rc�
�|j�L|jj|d�tj�z
|jkr
|j|=|j
r|j
|�|j|S)Nr)rr�get�timerrr�r�items  r�__getitem__zDirCache.__getitem__8sf���$�$�0��{�{���t�Q�'�$�)�)�+�5��9R�9R�8R�R��K�K��%��>�>��G�G�D�M��{�{�4� � rc�8�|jj�yr
)r�clear�rs rr zDirCache.clear@s�������rc�,�t|j�Sr
)�lenrr!s r�__len__zDirCache.__len__Cs���4�;�;��rc�.�	||y#t$rYywxYw)NTF)�KeyErrorrs  r�__contains__zDirCache.__contains__Fs#��	���J����	��	�s��	�c���|jsy|jr|j|�||j|<|j�"tj
�|j|<yyr
)rrrrrrr)rr
�values   r�__setitem__zDirCache.__setitem__MsS���&�&���>�>��G�G�C�L� ����C���$�$�0�#�y�y�{�D�K�K���1rc��|j|=yr
)r)rr
s  r�__delitem__zDirCache.__delitem__Vs���K�K��rc�D��t�j�}�fd�|D�S)Nc3�,�K�|]}|�vs�|���
y�wr
�)�.0�krs  �r�	<genexpr>z$DirCache.__iter__.<locals>.<genexpr>\s�����0�7�a�a�4�i��7�s�	�)�listr)r�entriess` r�__iter__zDirCache.__iter__Ys����t�{�{�#��0�7�0�0rc�T�t|j|j|jffSr
)rrrrr!s r�
__reduce__zDirCache.__reduce__^s)���
�
$�
$�d�&?�&?����P�
�	
r)TNN)
�__name__�
__module__�__qualname__�__doc__rrr r$r'r*r,r5r7r/rrrrs?���, �!��	#�:!�� ��+��1�

rr)r�collections.abcr�	functoolsrrr/rr�<module>r>s���*��\
�~�\
r