Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/dogpile/cache/__pycache__/proxy.cpython-39.pyc
Ðазад
a t�h{ � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z dd lm Z dd lmZ ddlmZ ddlm Z d dlmZ G dd� de �ZdS )a Proxy Backends ------------------ Provides a utility and a decorator class that allow for modifying the behavior of different backends without altering the class itself or having to extend the base backend. .. versionadded:: 0.5.0 Added support for the :class:`.ProxyBackend` class. � )�annotations)�Mapping)�Optional)�Sequence� )�BackendFormatted)�BackendSetType)�CacheBackend)� CacheMutex)�KeyType)�SerializedReturnType� )�Selfc @ s� e Zd ZdZdd� Zddd�dd�Zd d d�dd �Zd ddd�dd�Zd dd�dd�Zddd�dd�Z ddd�dd�Z ddd�dd�Zd d d�d!d"�Zd d#d�d$d%�Z dd&d�d'd(�Zd d)dd�d*d+�Zd,dd�d-d.�Zd/S )0�ProxyBackenda� A decorator class for altering the functionality of backends. Basic usage:: from dogpile.cache import make_region from dogpile.cache.proxy import ProxyBackend class MyFirstProxy(ProxyBackend): def get_serialized(self, key): # ... custom code goes here ... return self.proxied.get_serialized(key) def get(self, key): # ... custom code goes here ... return self.proxied.get(key) def set(self, key, value): # ... custom code goes here ... self.proxied.set(key) class MySecondProxy(ProxyBackend): def get_serialized(self, key): # ... custom code goes here ... return self.proxied.get_serialized(key) def get(self, key): # ... custom code goes here ... return self.proxied.get(key) region = make_region().configure( 'dogpile.cache.dbm', expiration_time = 3600, arguments = { "filename":"/path/to/cachefile.dbm" }, wrap = [ MyFirstProxy, MySecondProxy ] ) Classes that extend :class:`.ProxyBackend` can be stacked together. The ``.proxied`` property will always point to either the concrete backend instance or the next proxy in the chain that a method can be delegated towards. .. versionadded:: 0.5.0 c O s d S �N� )�self�arg�kwr r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/dogpile/cache/proxy.py�__init__N s zProxyBackend.__init__r r )�backend�returnc C s"