HEX
Server: LiteSpeed
System: Linux ws4.angoweb.net 5.14.0-611.13.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 11 04:57:59 EST 2025 x86_64
User: tswangoe (2287)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/mako/ext/__pycache__/beaker_cache.cpython-37.pyc
B

M�,G%���@sZdZddlmZddlmZyddlmZWndZYnXdZda	Gdd	�d	e�Z
dS)
z<Provide a :class:`.CacheImpl` for the Beaker caching system.�)�
exceptions)�	CacheImpl)�cacheFTNcsHeZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	�Z
S)�BeakerCacheImplz�A :class:`.CacheImpl` provided for the Beaker caching system.

    This plugin is used by default, based on the default
    value of ``'beaker'`` for the ``cache_impl`` parameter of the
    :class:`.Template` or :class:`.TemplateLookup` classes.

    csLtst�d��tdkr8d|jjkr0|jjdant��att	|��
|�dS)Nz8Can't initialize Beaker plugin; Beaker is not installed.�manager)�
has_beakerrZRuntimeException�
_beaker_cache�template�
cache_args�beaker_cacheZCacheManager�superr�__init__)�selfr)�	__class__��F/opt/alt/python37/lib/python3.7/site-packages/mako/ext/beaker_cache.pyr
 szBeakerCacheImpl.__init__cKs�|�dd�}d|kr$|�d�|d<n|jjjr<|jjj|d<d|krN|�d�|�d�dkrdd|d<d|kr�|�d�}tj|jj|f|�}ntj|jjf|�}d	|jj	i}|r�||d
<||fS)N�timeout�dirZdata_dirr�typeZ	memcachedz
ext:memcached�region�	starttime�
expiretime)
�poprr	Zmodule_directory�getrZget_cache_region�idZ	get_cacher)r�kwrrrr
rrr�
_get_cache-s"


zBeakerCacheImpl._get_cachecKs&|jf|�\}}|j|fd|i|��S)NZ
createfunc)rr)r�keyZcreation_functionrrrrr�
get_or_createDszBeakerCacheImpl.get_or_createcKs$|jf|�\}}|j||f|�dS)N)r�put)rr�valuerrrrrrHszBeakerCacheImpl.putcKs|jf|�\}}|j|f|�S)N)rr)rrrrrrrrLszBeakerCacheImpl.getcKs"|jf|�\}}|j|f|�dS)N)rZremove_value)rrrrrrr�
invalidatePszBeakerCacheImpl.invalidate)�__name__�
__module__�__qualname__�__doc__r
rrrrr!�
__classcell__rr)rrrs
r)r%�makorZ
mako.cacherZbeakerrrrrrrrrr�<module>s