Ńň
íąMc           @   sÇ   d  d k  l  Z  d  d k l Z d  d k l Z d  d k l Z d a d Z	 d e
 f d     YZ d e f d	     YZ d
 e f d     YZ d e f d     YZ d   Z d e f d     YZ d S(   i˙˙˙˙(   t   copy(   t   ImproperlyConfigured(   t   import_module(   t   HttpRequests#   django.core.context_processors.csrft   ContextPopExceptionc           B   s   e  Z d  Z RS(   s,   pop() has been called more times than push()(   t   __name__t
   __module__t   __doc__(    (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyR      s   t   BaseContextc           B   s   e  Z d d   Z d d  Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d	   Z d
   Z d   Z d d  Z d d  Z RS(   c         C   s   |  i  |  d  S(   N(   t   _reset_dicts(   t   selft   dict_(    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyt   __init__   s    c         C   s   | p h  g |  _  d  S(   N(   t   dicts(   R
   t   value(    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyR	      s    c         C   s&   t  t t |    } |  i | _ | S(   N(   R    t   superR   R   (   R
   t	   duplicate(    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyt   __copy__   s    c         C   s   t  |  i  S(   N(   t   reprR   (   R
   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyt   __repr__   s    c         c   s#   x t  |  i  D] } | Vq Wd  S(   N(   t   reversedR   (   R
   t   d(    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyt   __iter__    s     c         C   s   h  } |  i  i |  | S(   N(   R   t   append(   R
   R   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyt   push$   s    c         C   s-   t  |  i  d j o
 t  n |  i i   S(   Ni   (   t   lenR   R   t   pop(   R
   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyR   )   s    
c         C   s   | |  i  d | <d S(   s%   Set a variable in the current contexti˙˙˙˙N(   R   (   R
   t   keyR   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyt   __setitem__.   s    c         C   s@   x- t  |  i  D] } | | j o	 | | Sq Wt |   d S(   sH   Get a variable's value, starting at the current context and going upwardN(   R   R   t   KeyError(   R
   R   R   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyt   __getitem__2   s
     c         C   s   |  i  d | =d S(   s*   Delete a variable from the current contexti˙˙˙˙N(   R   (   R
   R   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyt   __delitem__9   s    c         C   s*   x# |  i  D] } | | j o t Sq
 Wt S(   N(   R   t   Truet   False(   R
   R   R   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyt   has_key=   s
    
 	c         C   s   |  i  |  S(   N(   R"   (   R
   R   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyt   __contains__C   s    c         C   s4   x- t  |  i  D] } | | j o	 | | Sq W| S(   N(   R   R   (   R
   R   t	   otherwiseR   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyt   getF   s
     c         C   s   t  |   } | i |  | S(   s|   
        Returns a new context with the same properties, but with only the
        values given in 'values' stored.
        (   R    R	   (   R
   t   valuest   new_context(    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyt   newL   s    N(   R   R   t   NoneR   R	   R   R   R   R   R   R   R   R   R"   R#   R%   R(   (    (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyR      s   										t   Contextc           B   s5   e  Z d  Z d e d d d  Z d   Z d   Z RS(   s&   A stack container for variable contextc         C   sA   | |  _  | |  _ | |  _ t   |  _ t t |   i |  d  S(   N(   t
   autoescapet   use_l10nt   current_appt   RenderContextt   render_contextR   R*   R   (   R
   R   R+   R-   R,   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyR   W   s
    			c         C   s+   t  t |   i   } t |  i  | _ | S(   N(   R   R*   R   R    R/   (   R
   R   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyR   ^   s    c         C   s4   t  | d  p t d   n |  i i |  | S(   s=   Pushes other_dict to the stack of dictionaries in the ContextR   s6   other_dict must be a mapping (dictionary-like) object.(   t   hasattrt	   TypeErrorR   R   (   R
   t
   other_dict(    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyt   updatec   s    N(   R   R   R   R)   R    R   R   R3   (    (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyR*   U   s   	R.   c           B   s,   e  Z d  Z d   Z d   Z d d  Z RS(   sČ  
    A stack container for storing Template state.

    RenderContext simplifies the implementation of template Nodes by providing a
    safe place to store state between invocations of a node's `render` method.

    The RenderContext also provides scoping rules that are more sensible for
    'template local' variables. The render context stack is pushed before each
    template is rendered, creating a fresh scope with nothing in it. Name
    resolution fails if a variable is not found at the top of the RequestContext
    stack. Thus, variables are local to a specific template and don't affect the
    rendering of other templates as they would if they were stored in the normal
    template context.
    c         c   s!   x |  i  d D] } | Vq Wd  S(   Ni˙˙˙˙(   R   (   R
   R   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyR   y   s     c         C   s   | |  i  d j S(   Ni˙˙˙˙(   R   (   R
   R   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyR"   }   s    c         C   s'   |  i  d } | | j o	 | | S| S(   Ni˙˙˙˙(   R   (   R
   R   R$   R   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyR%      s    	N(   R   R   R   R   R"   R)   R%   (    (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyR.   j   s   		c    
      C   s  d d k  l }  t d  j oü g  } g  } | i t  | i |  i  xŔ | D]¸ } | i d  } | |  | | d } } y t |  } Wn+ t	 j
 o } t
 d | | f   n Xy t | |  }	 Wn) t j
 o t
 d | | f   n X| i |	  qM Wt |  a n t S(   Ni˙˙˙˙(   t   settingst   .i   s1   Error importing request processor module %s: "%s"s=   Module "%s" does not define a "%s" callable request processor(   t   django.confR4   t   _standard_context_processorsR)   t   extendt   _builtin_context_processorst   TEMPLATE_CONTEXT_PROCESSORSt   rfindR   t   ImportErrorR   t   getattrt   AttributeErrorR   t   tuple(
   R4   t
   processorst   collectt   patht   it   modulet   attrt   modt   et   func(    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyt   get_standard_processors   s*     t   RequestContextc           B   s#   e  Z d  Z d d d d d  Z RS(   sú   
    This subclass of template.Context automatically populates itself using
    the processors defined in TEMPLATE_CONTEXT_PROCESSORS.
    Additional processors can be specified as a list of callables
    using the "processors" keyword argument.
    c         C   sn   t  i |  | d | d | | d  j o
 d } n t |  } x( t   | D] } |  i | |   qM Wd  S(   NR-   R,   (    (   R*   R   R)   R?   RI   R3   (   R
   t   requestt   dictR@   R-   R,   t	   processor(    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyR   Ś   s    
 N(   R   R   R   R)   R   (    (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyRJ      s   N(   s#   django.core.context_processors.csrf(   R    t   django.core.exceptionsR   t   django.utils.importlibR   t   django.httpR   R)   R7   R9   t	   ExceptionR   t   objectR   R*   R.   RI   RJ   (    (    (    sA   /usr/local/lib/python2.6/dist-packages/django/template/context.pyt   <module>   s   D	