dircache.cpython-312.pyc•4.53 kB
�
lMg�
� �: � d dl Z d dlmZ d dlmZ G d� de� Zy)� N)�MutableMapping)� lru_cachec �N � e Zd ZdZ dd�Zd� Zd� Zd� Zd� Zd� Z d � Z
d
� Zd� Zy)
�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 � _ |r t |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 �<