File: //opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyo
�
�ǚPc           @   sn   d  d l  m Z m Z e j d � Z e j Z e d d d � d e f d �  �  YZ d e f d	 �  �  YZ	 d
 S(   i����(   t
   exceptionst   utils
   mako.cachet   beakers   mako.ext.beaker_cachet   BeakerCacheImplt   Cachec           B   s�   e  Z d  Z d Z d Z d Z d �  Z d �  Z d �  Z	 d �  Z
 d �  Z e Z d �  Z
 d �  Z d �  Z d	 �  Z d
 �  Z d �  Z RS(
   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.
    c         G   se   t  | t � r | r d  S| |  _ | j j |  _ | j j |  _ i  |  _ |  j	 |  j j
 � |  _ d  S(   N(   t
   isinstancet
   basestringt   templatet   modulet   __name__t   idt   _modified_timet	   starttimet   _def_regionst
   _load_implt
   cache_implt   impl(   t   selfR   t   args(    (    s;   /opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyt   __init__@   s    		c         C   s   t  j | � |  � S(   N(   t   _cache_pluginst   load(   R   t   name(    (    s;   /opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyR   K   s    c         K   s   |  j  | | d | � S(   sc   Retrieve a value from the cache, using the given creation function
        to generate a new value.N(   t   _ctx_get_or_createt   None(   R   t   keyt   creation_functiont   kw(    (    s;   /opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyt
   get_or_createN   s    c         K   s5   |  j  j s | �  S|  j j | | |  j | | � � S(   sc   Retrieve a value from the cache, using the given creation function
        to generate a new value.(   R   t
   cache_enabledR   R   t
   _get_cache_kw(   R   R   R   t   contextR   (    (    s;   /opt/alt/python27/lib/python2.7/site-packages/mako/cache.pyR   T   s
    c         K   s&