
    3~h                     R    d dl mZ  G d d      Z G d d      Z G d d      Zd Zy	)
   )get_singletonc                       e Zd ZdZd Zd Zy)
JustInTimezL
    A strategy that ensures the file exists right before it's needed.

    c                 $    |j                          y Ngenerateselffiles     g/var/www/peopleoo.sandbox-dev.co.uk/venv/lib/python3.12/site-packages/imagekit/cachefiles/strategies.pyon_existence_requiredz JustInTime.on_existence_required
           c                 $    |j                          y r   r   r
   s     r   on_content_requiredzJustInTime.on_content_required   r   r   N)__name__
__module____qualname____doc__r   r    r   r   r   r      s    
r   r   c                       e Zd ZdZd Zd Zy)
Optimisticz
    A strategy that acts immediately when the source file changes and assumes
    that the cache files will not be removed (i.e. it doesn't ensure the
    cache file exists when it's accessed).

    c                 $    |j                          y r   r   r
   s     r   on_source_savedzOptimistic.on_source_saved   r   r   c                      y)NFr   r
   s     r   should_verify_existencez"Optimistic.should_verify_existence   s    r   N)r   r   r   r   r   r   r   r   r   r   r      s    r   r   c                       e Zd Zd Zy)DictStrategyc                 N    |j                         D ]  \  }}t        | ||        y r   )itemssetattr)r   	callbackskvs       r   __init__zDictStrategy.__init__!   s(    OO% 	 DAqD!Q	 r   N)r   r   r   r&   r   r   r   r   r       s     r   r   c                     t        | t              rt        | d      } | S t        | t              rt	        |       } | S t        |       r |        } | S )Nzcache file strategy)
isinstancestrr   dictr   callable)strategys    r   load_strategyr-   &   sS    (C  +@A
 O	 
Hd	#) O 
(	:Or   N)utilsr   r   r   r   r-   r   r   r   <module>r/      s+    !
 
    r   