B
    5d-                 @   s   d dl Z d dlZd dlZd dlZejejejdZdZdZ	e
 ZejddZeekrnedde  d	eejd
e	iZedkreejdeed< ee f eZdd ZdS )    N)LFUZLRUTTLi     ZPREMAILER_CACHEr   z7Unsupported cache implementation. Available options: %s/maxsizeZPREMAILER_CACHE_MAXSIZEr   ZPREMAILER_CACHE_TTLZttlc              K   s   dd }|S )Nc                s(   t jttdt  fdd}|S )N)lockc                 s
    | |S )N )argskwargs)funcr   3/tmp/pip-unpacked-wheel-am_d5cqw/premailer/cache.pyinner,   s    z0function_cache.<locals>.decorator.<locals>.inner)
cachetoolscachedcachecache_access_lock	functoolswraps)r   r   r   )r   r   	decorator+   s    z!function_cache.<locals>.decoratorr   )optionsr   r   r   r   function_cache*   s    r   )r   os	threadingr   ZLFUCacheZLRUCacheZTTLCacheZCACHE_IMPLEMENTATIONSZTTL_CACHE_TIMEOUTZDEFAULT_CACHE_MAXSIZERLockr   environgetZ
cache_type
ValueErrorjoinkeysintZcache_init_optionsr   r   r   r   r   r   <module>   s(   
