ó
P'—^c           @   s‹   d  d l  Z  d  d l m Z d d l m Z d d l m Z d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ	 d
 e f d „  ƒ  YZ
 d „  Z d S(   iÿÿÿÿN(   t
   LazyObjecti   (   t
   force_text(   t   get_singletont
   JustInTimec           B   s    e  Z d  Z d „  Z d „  Z RS(   sL   
    A strategy that ensures the file exists right before it's needed.

    c         C   s   | j  ƒ  d  S(   N(   t   generate(   t   selft   file(    (    s@   /tmp/pip-unpacked-wheel-XxTEJK/imagekit/cachefiles/strategies.pyt   on_existence_required   s    c         C   s   | j  ƒ  d  S(   N(   R   (   R   R   (    (    s@   /tmp/pip-unpacked-wheel-XxTEJK/imagekit/cachefiles/strategies.pyt   on_content_required   s    (   t   __name__t
   __module__t   __doc__R   R   (    (    (    s@   /tmp/pip-unpacked-wheel-XxTEJK/imagekit/cachefiles/strategies.pyR      s   	t
   Optimisticc           B   s    e  Z d  Z d „  Z d „  Z RS(   sÈ   
    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         C   s   | j  ƒ  d  S(   N(   R   (   R   R   (    (    s@   /tmp/pip-unpacked-wheel-XxTEJK/imagekit/cachefiles/strategies.pyt   on_source_saved   s    c         C   s   t  S(   N(   t   False(   R   R   (    (    s@   /tmp/pip-unpacked-wheel-XxTEJK/imagekit/cachefiles/strategies.pyt   should_verify_existence    s    (   R	   R
   R   R   R   (    (    (    s@   /tmp/pip-unpacked-wheel-XxTEJK/imagekit/cachefiles/strategies.pyR      s   	t   DictStrategyc           B   s   e  Z d  „  Z RS(   c         C   s1   x* | j  ƒ  D] \ } } t |  | | ƒ q Wd  S(   N(   t   itemst   setattr(   R   t	   callbackst   kt   v(    (    s@   /tmp/pip-unpacked-wheel-XxTEJK/imagekit/cachefiles/strategies.pyt   __init__%   s    (   R	   R
   R   (    (    (    s@   /tmp/pip-unpacked-wheel-XxTEJK/imagekit/cachefiles/strategies.pyR   $   s   c         C   s^   t  |  t j ƒ r$ t |  d ƒ }  n6 t  |  t ƒ rB t |  ƒ }  n t |  ƒ rZ |  ƒ  }  n  |  S(   Ns   cache file strategy(   t
   isinstancet   sixt   string_typesR   t   dictR   t   callable(   t   strategy(    (    s@   /tmp/pip-unpacked-wheel-XxTEJK/imagekit/cachefiles/strategies.pyt   load_strategy*   s    (   R   t   django.utils.functionalR    t   libR   t   utilsR   t   objectR   R   R   R   (    (    (    s@   /tmp/pip-unpacked-wheel-XxTEJK/imagekit/cachefiles/strategies.pyt   <module>   s   