
    Ջgx
                     l    d Z ddlZddlZddlmZ ddlmZ  ej                  e	      Z
 G d dee      Zy)z
    flask_caching.backends.filesystem
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    The filesystem caching backend.

    :copyright: (c) 2018 by Peter Justin.
    :copyright: (c) 2010 by Thadeus Burgess.
    :license: BSD, see LICENSE for more details.
    N)FileSystemCache)	BaseCachec                   F    e Zd ZdZdddej
                  dfdZed        Zy)	r   a  A cache that stores the items on the file system.  This cache depends
    on being the only user of the `cache_dir`.  Make absolutely sure that
    nobody but this cache stores files there or otherwise the cache will
    randomly delete files therein.

    :param cache_dir: the directory where cache files are stored.
    :param threshold: the maximum number of items the cache stores before
                      it starts deleting some. A threshold value of 0
                      indicates no threshold.
    :param default_timeout: the default timeout that is used if no timeout is
                            specified on :meth:`~BaseCache.set`. A timeout of
                            0 indicates that the cache never expires.
    :param mode: the file mode wanted for the cache files, default 0600
    :param hash_method: Default hashlib.md5. The hash method used to
                        generate the filename for cached results.
    :param ignore_errors: If set to ``True`` the :meth:`~BaseCache.delete_many`
                          method will ignore any errors that occurred during the
                          deletion process. However, if it is set to ``False``
                          it will stop on the first error. Defaults to
                          ``False``.
    i  i,  i  Fc                 v    t        j                  | |       t        j                  | |||||       || _        y )N)default_timeout)	cache_dir	thresholdr   modehash_method)r   __init__CachelibFileSystemCacheignore_errors)selfr   r	   r   r
   r   r   s          Y/var/www/html/venv/lib/python3.12/site-packages/flask_caching/backends/filesystemcache.pyr   zFileSystemCache.__init__-   s>     	4A((+#	
 +    c                     |j                  d|d          |j                  t        |d   |d                 | |i |S )Nr   	CACHE_DIRCACHE_THRESHOLDCACHE_IGNORE_ERRORS)r	   r   )insertupdatedict)clsappconfigargskwargss        r   factoryzFileSystemCache.factoryC   sM    Avk*+ !23$%:;	
 D#F##r   N)	__name__
__module____qualname____doc__hashlibmd5r   classmethodr    r   r   r   r      s5    2 KK+, $ $r   r   )r"   r#   loggingcachelibr   r   flask_caching.backends.baser   	getLoggerr   loggerr&   r   r   <module>r,      s9   	   ? 1			8	$6$i!8 6$r   