%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/mako/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyc

�
�ǚPc@snddlmZmZejd�ZejZeddd�defd��YZdefd	��YZ	d
S(i����(t
exceptionstutils
mako.cachetbeakersmako.ext.beaker_cachetBeakerCacheImpltCachecBs�eZdZdZdZdZd�Zd�Zd�Z	d�Z
d�ZeZd�Z
d�Zd�Zd	�Zd
�Zd�ZRS(
s�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.

    cGset|t�r|rdS||_|jj|_|jj|_i|_|j	|jj
�|_dS(N(t
isinstancet
basestringttemplatetmodulet__name__tidt_modified_timet	starttimet_def_regionst
_load_implt
cache_impltimpl(tselfRtargs((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyt__init__@s		cCstj|�|�S(N(t_cache_pluginstload(Rtname((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyRKscKs|j||d|�S(scRetrieve a value from the cache, using the given creation function
        to generate a new value.N(t_ctx_get_or_createtNone(Rtkeytcreation_functiontkw((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyt
get_or_createNscKs5|jjs|�S|jj|||j||��S(scRetrieve a value from the cache, using the given creation function
        to generate a new value.(Rt
cache_enabledRRt
_get_cache_kw(RRRtcontextR((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyRTs
cKs&|jj|||j|d��dS(s�Place a value in the cache.

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

        N(RtsetRR(RRtvalueR((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyR _s	cKs|jj||j|d��S(sFRetrieve 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(RtgetRR(RRR((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyR"qs
cKs#|jj||j|d��dS(sFInvalidate 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(Rt
invalidateRR(RRR((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyR#}s
cCs|jddd�dS(sWInvalidate the cached content of the "body" method for this
        template.

        trender_bodyt__M_defnameN(R#(R((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pytinvalidate_body�scCs|jd|dd|�dS(s`Invalidate the cached content of a particular ``<%def>`` within this
        template.

        s	render_%sR%N(R#(RR((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pytinvalidate_def�scCs|j|d|�dS(sNInvalidate 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.

        R%N(R#(RR((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pytinvalidate_closure�scCs�|jdd�}|s:|jjj�}|j|�nK||jkrY|j|}n,|jjj�}|j|�||j|<|r�|jjr�|j�}|j	d|�n|S(NR%R(
tpopRRt
cache_argstcopytupdateR
Rtpass_contextt
setdefault(RRRtdefnamettmpl_kw((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyR�s

N(R	t
__module__t__doc__RRR
RRRRRR tputR"R#R&R'R(R(((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyRs 
										
t	CacheImplcBsAeZdZd�ZeZd�Zd�Zd�Zd�Z	RS(s:Provide a cache implementation for use by :class:`.Cache`.cCs
||_dS(N(tcache(RR5((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyR�scKs
t��dS(s7Retrieve 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.

        N(tNotImplementedError(RRRR((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyR�scKs
t��dS(s�Place a value in the cache.

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

        N(R6(RRR!R((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyR �scKs
t��dS(s�Retrieve a value from the cache.

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

        N(R6(RRR((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyR"�scKs
t��dS(s�Invalidate a value in the cache.

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

        N(R6(RRR((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyR#�s(
R	R1R2RtFalseR-RR R"R#(((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyR4�s			
		N(
tmakoRRtPluginLoaderRtregistertregister_plugintobjectRR4(((s;/opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyt<module>s
	�

Zerion Mini Shell 1.0