o
    ]fx
                     @   sL   d Z ddlZddlZddlmZ ddlmZ ee	Z
G dd deeZdS )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                   @   s2   e Zd ZdZdddejdfddZedd	 Zd
S )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                 C   s.   t j| |d tj| |||||d || _d S )N)default_timeout)	cache_dir	thresholdr   modehash_method)r   __init__CachelibFileSystemCacheignore_errors)selfr   r   r   r   r   r    r   _/home/ubuntu/webapp/venv/lib/python3.10/site-packages/flask_caching/backends/filesystemcache.pyr	   -   s   

	zFileSystemCache.__init__c                 C   s8   | d|d  |t|d |d d | |i |S )Nr   	CACHE_DIRCACHE_THRESHOLDCACHE_IGNORE_ERRORS)r   r   )insertupdatedict)clsappconfigargskwargsr   r   r   factoryC   s   zFileSystemCache.factoryN)	__name__
__module____qualname____doc__hashlibmd5r	   classmethodr   r   r   r   r   r      s    
r   )r   r   loggingcachelibr   r
   flask_caching.backends.baser   	getLoggerr   loggerr   r   r   r   <module>   s    
