shell bypass 403
�
|��g � � � d dl mZ ej d� Zej Z eddd� G d� d� Z G d� d � Zy
)� )�utilz
mako.cache�beakerzmako.ext.beaker_cache�BeakerCacheImplc �j � e Zd ZdZdZ dZ dZ d� Zd� Zd� Z d� Z
d� ZeZ d� Z
d � Zd
� Zd� Zd� Zd
� Zy)�Cachea� Represents a data content cache made available to the module
space of a specific :class:`.Template` object.
.. versionadded:: 0.6
:class:`.Cache` by itself is mostly a
container for a :class:`.CacheImpl` object, which implements
a fixed API to provide caching services; specific subclasses exist to
implement different
caching strategies. Mako includes a backend that works with
the Beaker caching system. Beaker itself then supports
a number of backends (i.e. file, memory, memcached, etc.)
The construction of a :class:`.Cache` is part of the mechanics
of a :class:`.Template`, and programmatic access to this
cache is typically via the :attr:`.Template.cache` attribute.
Nc � � t |t � r|ry || _ |j j | _ |j j | _ i | _ | j | j j � | _ y �N)�
isinstance�str�template�module�__name__�id�_modified_time� starttime�_def_regions�
_load_impl�
cache_impl�impl)�selfr �argss �9/opt/hc_python/lib/python3.12/site-packages/mako/cache.py�__init__zCache.__init__A s^ � � �h��$��� ��
��/�/�*�*���!���7�7�������O�O�D�M�M�$<�$<�=�� � c �6 � t j |� | � S r )�_cache_plugins�load�r �names r r zCache._load_implL s � ��"�"�4�(��.�.r c �, � | j ||dfi |��S )�cRetrieve a value from the cache, using the given creation function
to generate a new value.N)�_ctx_get_or_create�r �key�creation_function�kws r �
get_or_createzCache.get_or_createO s! � � '�t�&�&�s�,=�t�J�r�J�Jr c � � | j j s |� S | j j ||fi | j ||� ��S )r! )r �
cache_enabledr r'