https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/django/core/cache/backends/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/django/core/cache/backends/base.pyc
�
r�\c@s�dZddlmZddlZddlmZmZddlmZdefd��YZ	defd	��YZ
e�Zd
Z
d�Zd�Zd
efd��YZdS(uBase Cache class.i����(tunicode_literalsN(tImproperlyConfiguredtDjangoRuntimeWarning(timport_by_pathtInvalidCacheBackendErrorcBseZRS((t__name__t
__module__(((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pyR
stCacheKeyWarningcBseZRS((RR(((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pyRsi�cCsd|||fS(u�
    Default function to generate keys.

    Constructs the key used by all other methods. By default it prepends
    the `key_prefix'. KEY_FUNCTION can be used to specify an alternate
    function with custom key making behavior.
    u%s:%s:%s((tkeyt
key_prefixtversion((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytdefault_key_funcscCs-|dk	r)t|�r|St|�SntS(u^
    Function to decide which key function to use.

    Defaults to ``default_key_func``.
    N(tNonetcallableRR(tkey_func((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytget_key_func%s

t	BaseCachecBs�eZd�Zdd�Zedd�Zddd�Zedd�Zdd�Z	dd�Z
dd�Zddd	�Zddd
�Z
d�Zedd�Zdd
�Zd�Zd�Zddd�Zddd�Zd�ZRS(cCsZ|jd|jdd��}yt|�}Wnttfk
rMd}nX||_|jdi�}|jd|jdd��}yt|�|_Wn ttfk
r�d|_nX|jd|jdd	��}yt|�|_Wn ttfk
rd	|_nX|jd
d�|_|jdd
�|_t	|jdd��|_dS(NutimeoutuTIMEOUTi,uOPTIONSumax_entriesuMAX_ENTRIESucull_frequencyuCULL_FREQUENCYiu
KEY_PREFIXuuVERSIONiuKEY_FUNCTION(tgettintt
ValueErrort	TypeErrortdefault_timeoutt_max_entriest_cull_frequencyR	R
RRR(tselftparamsttimeouttoptionstmax_entriestcull_frequency((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pyt__init__4s(
	

cCs4|dkr|j}n|j||j|�}|S(utConstructs the key used by all other methods. By default it
        uses the key_func to generate a key (which, by default,
        prepends the `key_prefix' and 'version'). An different key
        function can be provided at the time of cache construction;
        alternatively, you can subclass the cache backend to provide
        custom key making behavior.
        N(RR
RR	(RRR
tnew_key((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytmake_keyMscCs
t�dS(u
        Set a value in the cache if the key does not already exist. If
        timeout is given, that timeout will be used for the key; otherwise
        the default cache timeout will be used.

        Returns True if the value was stored, False otherwise.
        N(tNotImplementedError(RRtvalueRR
((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytadd[scCs
t�dS(u�
        Fetch a given key from the cache. If the key does not exist, return
        default, which itself defaults to None.
        N(R!(RRtdefaultR
((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pyRescCs
t�dS(u�
        Set a value in the cache. If timeout is given, that timeout will be
        used for the key; otherwise the default cache timeout will be used.
        N(R!(RRR"RR
((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytsetlscCs
t�dS(u@
        Delete a key from the cache, failing silently.
        N(R!(RRR
((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytdeletesscCsIi}x<|D]4}|j|d|�}|dk	r
|||<q
q
W|S(u/
        Fetch a bunch of keys from the cache. For certain backends (memcached,
        pgsql) this can be *much* faster when fetching multiple values.

        Returns a dict mapping each key in keys to its value. If the given
        key is missing, it will be missing from the response dict.
        R
N(RR(RtkeysR
tdtktval((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytget_manyys
cCs|j|d|�dk	S(uN
        Returns True if the key is in the cache and has not expired.
        R
N(RR(RRR
((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pythas_key�sicCsX|j|d|�}|dkr4td|��n||}|j||d|�|S(us
        Add delta to value in the cache. If the key does not exist, raise a
        ValueError exception.
        R
uKey '%s' not foundN(RRRR%(RRtdeltaR
R"t	new_value((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytincr�s
cCs|j||d|�S(uz
        Subtract delta from value in the cache. If the key does not exist, raise
        a ValueError exception.
        R
(R/(RRR-R
((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytdecr�scCs
|j|�S(uN
        Returns True if the key is in the cache and has not expired.
        (R,(RR((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pyt__contains__�scCs=x6|j�D](\}}|j||d|d|�q
WdS(uM
        Set a bunch of values in the cache at once from a dict of key/value
        pairs.  For certain backends (memcached), this is much more efficient
        than calling set() multiple times.

        If timeout is given, that timeout will be used for the key; otherwise
        the default cache timeout will be used.
        RR
N(titemsR%(RtdataRR
RR"((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytset_many�s	cCs(x!|D]}|j|d|�qWdS(u�
        Set a bunch of values in the cache at once.  For certain backends
        (memcached), this is much more efficient than calling delete() multiple
        times.
        R
N(R&(RR'R
R((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytdelete_many�s
cCs
t�dS(u+Remove *all* values from the cache at once.N(R!(R((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytclear�scCst|�tkr/tjd|tft�nxI|D]A}t|�dks`t|�dkr6tjd|t�q6q6WdS(u�
        Warn about keys that would not be portable to the memcached
        backend. This encourages (but does not force) writing backend-portable
        cache code.

        uGCache key will cause errors if used with memcached: %s (longer than %s)i!iuOCache key contains characters that will cause errors if used with memcached: %rN(tlentMEMCACHE_MAX_KEY_LENGTHtwarningstwarnRtord(RRtchar((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytvalidate_key�s	


$	cCs�|dkr|j}n|j|d|�}|dkrLtd|��n|j||d||�|j|d|�||S(u_Adds delta to the cache version for the supplied key. Returns the
        new version.
        R
uKey '%s' not foundN(RR
RRR%R&(RRR-R
R"((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytincr_version�scCs|j|||�S(ugSubstracts delta from the cache version for the supplied key. Returns
        the new version.
        (R>(RRR-R
((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytdecr_version�scKsdS(uClose the cache connectionN((Rtkwargs((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pytclose�sN(RRRRR tDEFAULT_TIMEOUTR#RR%R&R+R,R/R0R1R4R5R6R=R>R?RA(((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pyR3s$	
					(t__doc__t
__future__RR9tdjango.core.exceptionsRRtdjango.utils.module_loadingRRRtobjectRBR8RRR(((sA/tmp/pip-install-XxeQeY/django/django/core/cache/backends/base.pyt<module>s			

https://t.me/AnonymousX5 - 2025