| Server IP : 93.86.61.54 / Your IP : 216.73.216.156 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/mako/__pycache__/ |
Upload File : |
o
�p�^8 � @ sX d dl mZ d dl mZ e�d�ZejZeddd� G dd� de�ZG d d
� d
e�Z dS )� )�compat)�utilz
mako.cache�beakerzmako.ext.beaker_cache�BeakerCacheImplc @ s� e Zd ZdZdZ dZ dZ dd� Zdd� Zdd� Z d d
� Z
dd� ZeZ d
d� Z
dd� Zdd� Zdd� Zdd� Zdd� 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 G sH t |tj�r
|r
d S || _|jj| _|jj| _i | _ | �
| jj�| _d S �N)
�
isinstancer �string_types�template�module�__name__�id�_modified_time� starttime�_def_regions�
_load_impl�
cache_impl�impl)�selfr
�args� r �,/usr/lib/python3/dist-packages/mako/cache.py�__init__B s
zCache.__init__c C s t �|�| �S r )�_cache_plugins�load�r �namer r r r M s zCache._load_implc K s | 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�kwr r r �
get_or_createP s zCache.get_or_createc K s, | j js|� S | jj||fi | �||���S )r )r
�
cache_enabledr r# �
_get_cache_kw)r r r! �contextr"