ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib64/python3.11/site-packages/mako/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/mako/__pycache__/cache.cpython-311.pyc

�

�܋f���ddlmZejd��ZejZeddd��Gd�d��ZGd�d	��Zd
S)�)�utilz
mako.cache�beakerzmako.ext.beaker_cache�BeakerCacheImplc�l�eZdZdZdZ	dZ	dZ	d�Zd�Zd�Z	d�Z
d�ZeZ	d�Z
d	�Zd
�Zd�Zd�Zd
�ZdS)�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|rdS||_|jj|_|jj|_i|_|�	|jj
��|_dS�N)�
isinstance�str�template�module�__name__�id�_modified_time�	starttime�_def_regions�
_load_impl�
cache_impl�impl)�selfr�argss   �A/opt/cloudlinux/venv/lib64/python3.11/site-packages/mako/cache.py�__init__zCache.__init__Ase���h��$�$�	��	��F� ��
��/�*���!��7�������O�O�D�M�$<�=�=��	�	�	�c�F�t�|��|��Sr	)�_cache_plugins�load�r�names  rrzCache._load_implLs���"�"�4�(�(��.�.�.rc�"�|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_createOs$��'�t�&�s�,=�t�J�J�r�J�J�Jrc�~�|jjs
|��S|jj||fi|�||����S)r!)r�
cache_enabledrr'�
_get_cache_kw)rr$r%�contextr&s     rr"zCache._ctx_get_or_createUs\���}�*�	'�$�$�&�&�&�&�t�y�&��"�
�
�&*�&8�&8��W�&E�&E�
�
�	
rc�V�|jj||fi|�|d����dS)��Place a value in the cache.

        :param key: the value's key.
        :param value: the value.
        :param \**kw: cache configuration arguments.

        N)r�setr*�rr$�valuer&s    rr.z	Cache.set`s8��	��	�
�c�5�A�A�D�$6�$6�r�4�$@�$@�A�A�A�A�Arc�P�|jj|fi|�|d����S)aFRetrieve a value from the cache.

        :param key: the value's key.
        :param \**kw: cache configuration arguments.  The
         backend is configured using these arguments upon first request.
         Subsequent requests that use the same series of configuration
         values will use that same backend.

        N)r�getr*�rr$r&s   rr2z	Cache.getrs0���t�y�}�S�A�A�D�$6�$6�r�4�$@�$@�A�A�Arc�T�|jj|fi|�|d����dS)aFInvalidate a value in the cache.

        :param key: the value's key.
        :param \**kw: cache configuration arguments.  The
         backend is configured using these arguments upon first request.
         Subsequent requests that use the same series of configuration
         values will use that same backend.

        N)r�
invalidater*r3s   rr5zCache.invalidate~s7��	��	��S�A�A�D�$6�$6�r�4�$@�$@�A�A�A�A�Arc�4�|�dd���dS)zWInvalidate the cached content of the "body" method for this
        template.

        �render_body��__M_defnameN�r5)rs r�invalidate_bodyzCache.invalidate_body�s ��
	
���
�=��A�A�A�A�Arc�@�|�d|zd|z���dS)z`Invalidate the cached content of a particular ``<%def>`` within this
        template.

        z	render_%sr8Nr:rs  r�invalidate_defzCache.invalidate_def�s*��	
����d�*��d�8J��K�K�K�K�Krc�4�|�||���dS)aNInvalidate a nested ``<%def>`` within this template.

        Caching of nested defs is a blunt tool as there is no
        management of scope -- nested defs that use cache tags
        need to have names unique of all other nested defs in the
        template, else their content will be overwritten by
        each other.

        r8Nr:rs  r�invalidate_closurezCache.invalidate_closure�s ��	
����$��/�/�/�/�/rc��|�dd��}|s4|jj���}|�|��nT||jvr|j|}n=|jj���}|�|��||j|<|r6|jjr*|���}|�d|��|S)Nr9r+)	�popr�
cache_args�copy�updaterr�pass_context�
setdefault)rr&r+�defname�tmpl_kws     rr*zCache._get_cache_kw�s����&�&���-�-���	1��m�.�3�3�5�5�G��N�N�2�����
��)�
)�
)��'��0�G�G��m�.�3�3�5�5�G��N�N�2����)0�D��g�&��	3�t�y�-�	3��l�l�n�n�G����y�'�2�2�2��r)r�
__module__�__qualname__�__doc__rrrrrr'r"r.�putr2r5r;r=r?r*�rrrrs��������$�D��
�B���I�	�	>�	>�	>�/�/�/�K�K�K�	
�	
�	
�	B�	B�	B��C��
B�
B�
B�
B�
B�
B�B�B�B�L�L�L�0�0�0�����rrc�6�eZdZdZd�ZdZ	d�Zd�Zd�Zd�Z	dS)	�	CacheImplz:Provide a cache implementation for use by :class:`.Cache`.c��||_dSr	)�cache)rrQs  rrzCacheImpl.__init__�s
����
�
�
rFc��t���)a7Retrieve a value from the cache, using the given creation function
        to generate a new value.

        This function *must* return a value, either from
        the cache, or via the given creation function.
        If the creation function is called, the newly
        created value should be populated into the cache
        under the given key before being returned.

        :param key: the value's key.
        :param creation_function: function that when called generates
         a new value.
        :param \**kw: cache configuration arguments.

        ��NotImplementedErrorr#s    rr'zCacheImpl.get_or_create�s�� "�#�#�#rc��t���)r-rSr/s    rr.z
CacheImpl.set�s��"�#�#�#rc��t���)z�Retrieve a value from the cache.

        :param key: the value's key.
        :param \**kw: cache configuration arguments.

        rSr3s   rr2z
CacheImpl.get����"�#�#�#rc��t���)z�Invalidate a value in the cache.

        :param key: the value's key.
        :param \**kw: cache configuration arguments.

        rSr3s   rr5zCacheImpl.invalidate�rWrN)
rrIrJrKrrEr'r.r2r5rMrrrOrO�sq������D�D�����L��$�$�$�$$�$�$�$�$�$�$�$�$�$�$rrON)�makor�PluginLoaderr�register�register_pluginrrOrMrr�<module>r]s���������"��"�<�0�0�� �)�����1�3D�E�E�E�e�e�e�e�e�e�e�e�P8$�8$�8$�8$�8$�8$�8$�8$�8$�8$r

Zerion Mini Shell 1.0