
 `Tc           @   s  d  Z  d d l m Z d d l m Z d d l m Z d d l m	 Z	 d d l
 m Z d d l m Z d d l m Z d d	 l m Z m Z m Z d d
 l m Z m Z m Z m Z m Z m Z m Z i d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6Z e e d  rd Z n d Z d   Z  e! e" e    d d1   Z  d1 e$ d  Z% d   Z& d    Z' d! e( f d"     YZ) d# e( f d$     YZ* d% e+ f d&     YZ, d' e f d(     YZ- d) e f d*     YZ. d+ e f d,     YZ/ d- e0 f d.     YZ1 d/ e f d0     YZ2 d1 S(2   s   
    jinja2.compiler
    ~~~~~~~~~~~~~~~

    Compiles nodes into python code.

    :copyright: (c) 2010 by the Jinja Team.
    :license: BSD, see LICENSE for more details.
i(   t   chain(   t   deepcopy(   t	   iskeyword(   t   nodes(   t   EvalContext(   t   NodeVisitor(   t   TemplateAssertionError(   t   Markupt   concatt   escape(   t
   range_typet   nextt	   text_typet   string_typest	   iteritemst   NativeStringIOt   imaps   ==t   eqs   !=t   net   >t   gts   >=t   gteqt   <t   lts   <=t   lteqt   ins   not int   notinR   t   itemsc             s   d     f d   }  |  S(   Ni*   c              s   d  S(   N(    (    (   t   x(    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   f-   s    (    (   R   (    (   R   sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   unoptimize_before_dead_code+   s    t   __closure__c         C   sc   t  |  t j  s! t d   n  t | | | | |  } | j |   | d k r_ | j j   Sd S(   s+   Generate the python source for a node tree.s    Can't compile non template nodesN(	   t
   isinstanceR   t   Templatet	   TypeErrort   CodeGeneratort   visitt   Nonet   streamt   getvalue(   t   nodet   environmentt   namet   filenameR&   t
   defer_initt	   generator(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   generate7   s    c      
   C   s   |  d k s$ |  t k s$ |  t k r( t St |  t t t t t	 t
 f t  rQ t St |  t t t t f  r x |  D] } t |  ss t Sqs Wt St |  t  r x: t |   D], \ } }  t |  s t St |   s t Sq Wt St S(   s)   Does the node have a safe representation?N(   R%   t   NotImplementedt   Ellipsist   TrueR    t   boolt   intt   floatt   complexR
   R   R   t   tuplet   listt   sett	   frozensett   has_safe_reprt   Falset   dictR   (   t   valuet   itemt   key(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR:   B   s$    $c         C   sI   t  |  } y" x |  D] } | j |  q WWn t k
 rA n X| j S(   s   Check if the names passed are accessed undeclared.  The return value
    is a set of all the undeclared names from the sequence of names found.
    (   t   UndeclaredNameVisitorR$   t   VisitorExitt
   undeclared(   R   t   namest   visitorR(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   find_undeclaredX   s    t   Identifiersc           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s+   Tracks the status of identifiers in frames.c         C   s@   t    |  _ t    |  _ t    |  _ t    |  _ t    |  _ d  S(   N(   R8   t   declaredt   outer_undeclaredRB   t   declared_locallyt   declared_parameter(   t   self(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   __init__h   s
    c         C   s$   |  j  j |  |  j j |  d S(   s$   Register a special name like `loop`.N(   RB   t   discardRG   t   add(   RK   R*   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   add_special{   s    c         C   s/   | |  j  k s | |  j k r" t S| |  j k S(   s6   Check if a name is declared in this or an outer scope.(   RI   RJ   R1   RG   (   RK   R*   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   is_declared   s    c         C   s
   t  |   S(   N(   R   (   RK   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   copy   s    (   t   __name__t
   __module__t   __doc__RL   RO   RP   RQ   (    (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRF   e   s
   			t   Framec           B   sP   e  Z d  Z d d  Z d   Z d   Z d d  Z d   Z d   Z	 e Z
 RS(	   s&   Holds compile time information for us.c         C   s   | |  _  t   |  _ t |  _ t |  _ | o3 | j |  _ d  |  _ | rQ | j	 pT d  |  _	 t
   |  _ | |  _ | d  k	 r |  j j j | j j | j j B| j B |  j j j | j j |  j j  | j |  _ n  d  S(   N(   t   eval_ctxRF   t   identifiersR;   t   toplevelt	   rootlevelt   require_output_checkR%   t   buffert   blockR8   t   assigned_namest   parentRG   t   updateRJ   RH   RB   (   RK   RV   R^   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRL      s"    						c         C   sZ   t  j |  j  } | j j |  j  t  j |  j j  | _ | j j j |  j j  | S(   s!   Create a copy of the current one.(   t   objectt   __new__t	   __class__t   __dict__R_   RW   (   RK   t   rv(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRQ      s
    c         C   s1   t  |  j  } x | D] } | j |  q Wd S(   s   Walk the node and check for identifiers.  If the scope is hard (eg:
        enforce on a python level) overrides from outer scopes are tracked
        differently.
        N(   t   FrameIdentifierVisitorRW   R$   (   RK   R   RD   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   inspect   s    c            s?   |  j      j   j B  j   j B@t   f d   | D  BS(   s   Find all the shadowed names.  extra is an iterable of variables
        that may be defined with `add_special` which may occour scoped.
        c         3   s$   |  ] }   j  |  r | Vq d  S(   N(   RP   (   t   .0R   (   t   i(    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pys	   <genexpr>   s    (   RW   RG   RH   RI   RJ   R8   (   RK   t   extra(    (   Rh   sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   find_shadowed   s    	c         C   s   t  |  j |   S(   s   Return an inner frame.(   RU   RV   (   RK   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   inner   s    c         C   s   |  j    } t | _ | S(   s   Return a soft frame.  A soft frame may not be modified as
        standalone thing as it shares the resources with the frame it
        was created of, but it's not a rootlevel frame any longer.
        (   RQ   R;   RY   (   RK   Rd   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   soft   s    	N(    (   RR   RS   RT   R%   RL   RQ   Rf   Rj   Rk   Rl   t   __copy__(    (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRU      s   +							RA   c           B   s   e  Z d  Z RS(   s?   Exception used by the `UndeclaredNameVisitor` to signal a stop.(   RR   RS   RT   (    (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRA      s   t   DependencyFinderVisitorc           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s.   A visitor that collects filter and test calls.c         C   s   t    |  _ t    |  _ d  S(   N(   R8   t   filterst   tests(   RK   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRL      s    c         C   s$   |  j  |  |  j j | j  d  S(   N(   t   generic_visitRo   RN   R*   (   RK   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Filter   s    c         C   s$   |  j  |  |  j j | j  d  S(   N(   Rq   Rp   RN   R*   (   RK   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt
   visit_Test   s    c         C   s   d S(   s   Stop visiting at blocks.N(    (   RK   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Block   s    (   RR   RS   RT   RL   Rr   Rs   Rt   (    (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRn      s
   			R@   c           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s   A visitor that checks if a name is accessed without being
    declared.  This is different from the frame visitor as it will
    not stop at closure frames.
    c         C   s   t  |  |  _ t    |  _ d  S(   N(   R8   RC   RB   (   RK   RC   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRL      s    c         C   sl   | j  d k rU | j |  j k rU |  j j | j  |  j |  j k rh t    qh n |  j j | j  d  S(   Nt   load(   t   ctxR*   RC   RB   RN   RA   RM   (   RK   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt
   visit_Name  s
    !c         C   s   d S(   s   Stop visiting a blocks.N(    (   RK   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRt     s    (   RR   RS   RT   RL   Rw   Rt   (    (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR@      s   		Re   c           B   sz   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z RS(   s   A visitor for `Frame.inspect`.c         C   s   | |  _  d  S(   N(   RW   (   RK   RW   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRL     s    c         C   s   | j  d k r( |  j j j | j  nf | j  d k rP |  j j j | j  n> | j  d k r |  j j | j  r |  j j j | j  n  d S(   s2   All assignments to names go through this function.t   storet   paramRu   N(   Rv   RW   RI   RN   R*   RJ   RP   RB   (   RK   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRw     s    c            s    j  | j   j     j   j B     f d   } | | j  } | | j p\ d  }   j j | j	 |    j
    j j | | B d  S(   Nc            sm   |  s t    S  j    _ x |  D] }  j |  q# W j j  }   j j  j j     _ | S(   N(   R8   RQ   RW   R$   RI   RB   R_   (   R   t   subnodeRd   (   t   real_identifierst	   old_namesRK   (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   inner_visit&  s    	(    (   R$   t   testRW   RI   RJ   t   bodyt   else_RB   R_   t   symmetric_differenceRG   (   RK   R(   R}   R   R   (    (   R{   R|   RK   sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_If  s    	
c         C   s   |  j  j j | j  d  S(   N(   RW   RI   RN   R*   (   RK   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Macro>  s    c         C   s'   |  j  |  |  j j j | j  d  S(   N(   Rq   RW   RI   RN   t   target(   RK   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_ImportA  s    c         C   sa   |  j  |  xM | j D]B } t | t  rF |  j j j | d  q |  j j j |  q Wd  S(   Ni   (   Rq   RC   R    R6   RW   RI   RN   (   RK   R(   R*   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_FromImportE  s
    c         C   s$   |  j  | j  |  j  | j  d S(   s'   Visit assignments in the correct order.N(   R$   R(   R   (   RK   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_AssignM  s    c         C   s   |  j  | j  d S(   sq   Visiting stops at for blocks.  However the block sequence
        is visited as part of the outer scope.
        N(   R$   t   iter(   RK   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt	   visit_ForR  s    c         C   s   |  j  | j  d  S(   N(   R$   t   call(   RK   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_CallBlockX  s    c         C   s   |  j  | j  d  S(   N(   R$   t   filter(   RK   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_FilterBlock[  s    c         C   s   d S(   s   Stop visiting at scopes.N(    (   RK   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Scope^  s    c         C   s   d S(   s   Stop visiting at blocks.N(    (   RK   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRt   a  s    (   RR   RS   RT   RL   Rw   R   R   R   R   R   R   R   R   R   Rt   (    (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRe     s   		
									t   CompilerExitc           B   s   e  Z d  Z RS(   s   Raised if the compiler encountered a situation where it just
    doesn't make sense to further process the code.  Any block that
    raises such an exception is not further processed.
    (   RR   RS   RT   (    (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR   e  s   R#   c           B   sS  e  Z dR e d   Z d   Z d   Z d   Z d   Z d   Z	 d d  Z
 dR d  Z d	   Z dR d
  Z d   Z d   Z dR d d  Z dR d d  Z dR d  Z d   Z d   Z d   Z dS d  Z d   Z dR e d  Z dR d  Z d   Z d   Z dR d  Z d   Z d   Z d   Z  d   Z! d   Z" d    Z# d!   Z$ d"   Z% d#   Z& d$   Z' d%   Z( d&   Z) d'   Z* d(   Z+ d)   Z, d*   Z- d+   Z. d,   Z/ d-   Z0 e d.  Z1 e d/  Z2 e1 d0  Z3 e1 d1  Z4 e1 d2  Z5 e1 d3  Z6 e1 d4  Z7 e1 d5  Z8 e1 d6  Z9 e1 d7 d8 e Z: e1 d9 d8 e Z; e2 d0  Z< e2 d1  Z= e2 d: d8 e Z> [1 [2 d;   Z? d<   Z@ d=   ZA d>   ZB d?   ZC d@   ZD dA   ZE dB   ZF dC   ZG e dD  ZH dE   ZI dF   ZJ dG   ZK dH   ZL dI   ZM dJ   ZN dK   ZO dL   ZP dM   ZQ dN   ZR dO   ZS dP   ZT dQ   ZU RS(T   c         C   s   | d  k r t   } n  | |  _ | |  _ | |  _ | |  _ t |  _ | |  _ i  |  _	 i  |  _
 d |  _ t |  _ d |  _ i  |  _ i  |  _ g  |  _ d  |  _ d |  _ d |  _ t |  _ d |  _ d |  _ d  S(   Ni    i   (   R%   R   R)   R*   R+   R&   R;   t   created_block_contextR,   t   import_aliasest   blockst   extends_so_fart   has_known_extendst   code_linenoRp   Ro   t
   debug_infot   _write_debug_infot
   _new_linest
   _last_lineR1   t   _first_writet   _last_identifiert   _indentation(   RK   R)   R*   R+   R&   R,   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRL   n  s,    																			c         C   s   t  | | |  j |  j   d S(   s*   Fail with a :exc:`TemplateAssertionError`.N(   R   R*   R+   (   RK   t   msgt   lineno(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   fail  s    c         C   s   |  j  d 7_  d |  j  S(   s   Get a new unique identifier.i   s   t_%d(   R   (   RK   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   temporary_identifier  s    c         C   s'   |  j    | _ |  j d | j  d S(   s7   Enable buffering for the frame from that point onwards.s   %s = []N(   R   R[   t	   writeline(   RK   t   frame(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR[     s    c         C   s   | j  j ry |  j d  |  j   |  j d | j  |  j   |  j d  |  j   |  j d | j  |  j   n7 | j  j r |  j d | j  n |  j d | j  d S(   s(   Return the buffer contents of the frame.s   if context.eval_ctx.autoescape:s   return Markup(concat(%s))s   else:s   return concat(%s)N(   RV   t   volatileR   t   indentR[   t   outdentt
   autoescape(   RK   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   return_buffer_contents  s    


c         C   s   |  j  d 7_  d S(   s   Indent by one.i   N(   R   (   RK   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR     s    i   c         C   s   |  j  | 8_  d S(   s   Outdent by step.N(   R   (   RK   t   step(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR     s    c         C   s=   | j  d k r" |  j d |  n |  j d | j  |  d S(   s%   Yield or write into the frame buffer.s   yield s
   %s.append(N(   R[   R%   R   (   RK   R   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   start_write  s    c         C   s#   | j  d k	 r |  j d  n  d S(   s1   End the writing process started by `start_write`.t   )N(   R[   R%   t   write(   RK   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt	   end_write  s    c         C   s.   |  j  | |  |  j |  |  j |  d S(   s4   Simple shortcut for start_write + write + end_write.N(   R   R   R   (   RK   t   sR   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   simple_write  s    c         C   si   | j  d k r |  j d  n |  j d  y% x | D] } |  j | |  q6 WWn t k
 rd n Xd S(   s   Visit a list of nodes as block in a frame.  If the current frame
        is no buffer a dummy ``if 0: yield None`` is written automatically
        unless the force_generator parameter is set to False.
        s   if 0: yield Nonet   passN(   R[   R%   R   R$   R   (   RK   R   R   R(   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt
   blockvisit  s    c         C   s   |  j  r |  j su |  j j d |  j   |  j |  j  7_ |  j d k	 ru |  j j |  j |  j f  d |  _ qu n  t	 |  _ |  j j d |  j
  d |  _  n  |  j j |  d S(   s&   Write a string into the output stream.s   
s       i    N(   R   R   R&   R   R   R   R%   R   t   appendR;   R   (   RK   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR     s    			i    c         C   s!   |  j  | |  |  j |  d S(   s!   Combination of newline and write.N(   t   newlineR   (   RK   R   R(   Ri   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR     s    c         C   sV   t  |  j d |  |  _ | d k	 rR | j |  j k rR | j |  _ | j |  _ n  d S(   s/   Add one or more newlines before the next write.i   N(   t   maxR   R%   R   R   R   (   RK   R(   Ri   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR      s    c   	      C   se  t  } x@ t d   | j D | p% d  D] } t |  r) t } Pq) q) Wx. | j D]# } |  j d  |  j | |  qS W| s x. | j D]# } |  j d  |  j | |  q W| d k	 r x4 t	 |  D]# \ } } |  j d | | f  q Wq n  | j
 r#|  j d  |  j | j
 |  n  | r/| j d k	 rH|  j d  n |  j d  xE | j D]: } |  j d | j  |  j | j |  |  j d  q_W| d k	 rx4 t	 |  D]# \ } } |  j d | | f  qWn  | j d k	 r|  j d	  |  j | j |  |  j d
  qa|  j d  n2 | j d k	 ra|  j d  |  j | j |  n  d S(   s,  Writes a function call to the stream for the current node.
        A leading comma is added automatically.  The extra keyword
        arguments may not include python keywords otherwise a syntax
        error could occour.  The extra keyword arguments should be given
        as python dict.
        c         s   s   |  ] } | j  Vq d  S(   N(   R?   (   Rg   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pys	   <genexpr>  s    s   , s   , %s=%ss   , *s
   , **dict({s   , **{s   %r: s   %r: %s, s   }, **R   t   }s   , **N(    (   R;   R    t   kwargst   is_python_keywordR1   t   argsR   R$   R%   R   t   dyn_argst
   dyn_kwargsR?   R=   (	   RK   R(   R   t   extra_kwargst   kwarg_workaroundt   kwargt   argR?   R=   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt	   signature  sJ    	)!	c         C   s2   x+ | j  j D] } |  j d | | f  q Wd S(   s9   Pull all the references identifiers into the local scope.s   l_%s = context.resolve(%r)N(   RW   RB   R   (   RK   R   R*   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   pull_locals<  s    c         C   s   t    } x | D] } | j |  q Wxt d D]l } t |  |  } xT t | |  D]C } | | k rx |  j   | | <n  |  j d | | | | f  qS Wq. Wd S(   s   Pull all the dependencies.Ro   Rp   s   %s = environment.%s[%r]N(   s   filterss   tests(   Rn   R$   t   getattrR   R   (   RK   R   RD   R(   t
   dependencyt   mappingR*   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   pull_dependenciesA  s    		c         C   sO   | j  j rK |  j d t r! d p$ d d j d   | j  j D  f  n  d S(   s+   Disable Python optimizations for the frame.s   %sdummy(%s)s   if 0: t    s   , c         s   s   |  ] } d  | Vq d S(   t   l_N(    (   Rg   R*   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pys	   <genexpr>W  s    N(   RW   RG   R   R   t   join(   RK   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   unoptimize_scopeN  s    	c         C   s   i  } xB | j  |  D]1 } |  j   | | <} |  j d | | f  q Wt   } x4 | j j D]& } | | k ra | j d |  qa qa W| r |  j d j |  d  n  | S(   s  This function returns all the shadowed variables in a dict
        in the form name: alias and will write the required assignments
        into the current scope.  No indentation takes place.

        This also predefines locally declared variables from the loop
        body because under some circumstances it may be the case that

        `extra_vars` is passed to `Frame.find_shadowed`.
        s	   %s = l_%sR   s    = s
    = missing(   Rj   R   R   R8   RW   RI   RN   R   (   RK   R   t
   extra_varst   aliasesR*   t   identt
   to_declare(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt
   push_scopeZ  s    
	c         C   s   x1 t  |  D]# \ } } |  j d | | f  q Wt   } x4 | j j D]& } | | k rJ | j d |  qJ qJ W| r |  j d j |  d  n  d S(   s0   Restore all aliases and delete unused variables.s	   l_%s = %sR   s    = s
    = missingN(   R   R   R8   RW   RI   RN   R   (   RK   R   R   R*   t   aliast	   to_delete(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt	   pop_scopep  s    	c   
      C   s  | d
 k r | j   } n  t |  } | j   } | j |  | j j | j j @| j j | j j	 B@} | r |  j
 d d j t |   | j  n  | j j | j j | j j @8_ | s | St | _ t | _ t | _ g  | j D] } d | j ^ q | _ } t | d  }	 d |	 k rNt | _ | j j d  | j d  n  d |	 k rt | _ | j j d  | j d  n  d |	 k rt | _ | j j d  | j d	  n  | S(   sM  In Jinja a few statements require the help of anonymous
        functions.  Those are currently macros and call blocks and in
        the future also recursive loops.  As there is currently
        technical limitation that doesn't allow reading and writing a
        variable in a scope where the initial value is coming from an
        outer scope, this function tries to fall back with a common
        error message.  Additionally the frame passed is modified so
        that the argumetns are collected and callers are looked up.

        This will return the modified frame.
        sX   It's not possible to set and access variables derived from an outer scope! (affects: %s)s   , R   t   callerR   t   varargst   l_callert   l_kwargst	   l_varargsN(   s   callers   kwargsR   (   R%   t   iter_child_nodesR7   Rk   Rf   RW   RB   RG   RI   RJ   R   R   t   sortedR   R;   t   accesses_kwargst   accesses_varargst   accesses_callerR   R*   t	   argumentsRE   R1   RO   R   (
   RK   R(   R   t   childrent   find_specialt
   func_framet   overridden_closure_varsR   R   RB   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   function_scoping~  sD    
		 
				*			c         C   s   |  j  | | |  } t | _ | j } d | j j k rI | d g } n  |  j d d j |  |  |  j   |  j	 |  |  j
 |  |  j | j |  |  j |  |  j   | S(   s/   Dump the function def of a macro or call block.t   loops   l_loop=l_loops   def macro(%s):s   , (   R   R;   RZ   R   RW   RG   R   R   R   R[   R   R   R   R   R   (   RK   R(   R   R   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt
   macro_body  s    		

c         C   s   d j  d   | j D  } t | d d  } t | j  d k rP | d 7} n  |  j d | | f  x. | j D]# } |  j | |  |  j d  qq W|  j d t | j	  t | j
  t | j  f  d S(	   s<   Dump the macro definition for the def created by macro_body.s   , c         s   s   |  ] } t  | j  Vq d  S(   N(   t   reprR*   (   Rg   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pys	   <genexpr>  s    R*   i   t   ,s%   Macro(environment, macro, %r, (%s), (s   ), %r, %r, %r)N(   R   R   R   R%   t   lenR   t   defaultsR$   R2   R   R   R   (   RK   R(   R   t	   arg_tupleR*   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt	   macro_def  s    		c         C   s:   d | j  } |  j d k	 r6 | d t |  j  7} n  | S(   s.   Return a human readable position for the node.s   line %ds    in N(   R   R*   R%   R   (   RK   R(   Rd   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   position  s    c         C   s  | d  k s t d   t |  j |  j  } d d l m } |  j d  |  j d d j |   t	 sz |  j d  n  |  j
 r d p d	 } | j t j  d  k	 } xY | j t j  D]E } | j |  j k r |  j d
 | j | j  n  | |  j | j <q Wx | j t j  D] } | j |  j k r| j }	 |  j   |  j |	 <}
 d |	 k r|	 j d d  \ } } |  j d | | |
 f  q|  j d |	 |
 f  qqW|  j d |  j  |  j d | d d t |  } | j | j  t | _ | _ | o|  j | _ |  j    | r8|  j d  n  d t! | j d!  k rp| j" j# d  |  j d  n  |  j$ |  |  j% | j  |  j& | j |  |  j'   | r|  j s|  j    |  j d  n  |  j    |  j d  |  j    |  j d  |  j' d |  j  n  xt( |  j  D]\ } } t |  } | j | j  | | _) |  j d | | f | d  |  j    t! | j d"  } d | k r| j" j# d  |  j d  n  d | k r| j" j# d  |  j d | | f  n  |  j$ |  |  j% | j  |  j& | j |  |  j'   q)W|  j d d j d   |  j D  d d |  j d d j d    |  j* D   d  S(#   Ns   no root frame allowedi(   t   __all__s   from __future__ import divisions   from jinja2.runtime import s   , s   dummy = lambda *x: Nones   , environment=environmentR   s   block %r defined twicet   .i   s   from %s import %s as %ss   import %s as %ss	   name = %rs   def root(context%s):Ri   s   parent_template = NoneRK   s#   l_self = TemplateReference(context)s   if parent_template is not None:s7   for event in parent_template.root_render_func(context):s   yield eventi   s   def block_%s(context%s):t   supers%   l_super = context.super(%r, block_%s)s   blocks = {%s}c         s   s   |  ] } d  | | f Vq d S(   s   %r: block_%sN(    (   Rg   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pys	   <genexpr>P  s   s   debug_info = %rt   &c         s   s   |  ] } d  | Vq d S(   s   %s=%sN(    (   Rg   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pys	   <genexpr>U  s    (   s   self(   s   selfs   super(+   R%   t   AssertionErrorR   R)   R*   t   jinja2.runtimeR   R   R   R   R,   t   findR   t   Extendst   find_allt   BlockR   R   R   t   ImportedNamet
   importnameR   R   t   rsplitRU   Rf   R   R1   RX   RY   R   RZ   R   RE   RW   RO   R   R   R   R   R   R\   R   (   RK   R(   R   RV   t   exportedt   envenvt   have_extendsR\   t   import_t   impR   t   modulet   objR*   t   block_frameRB   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Template  s    		

	


	

	c         C   s   d } | j  rR |  j r d S|  j d k rR |  j d  |  j   | d 7} qR n  | j ra d pd d } |  j d | j | f |  |  j   |  j d |  |  j |  d S(	   s.   Call a block and register it for the template.i   Ni    s   if parent_template is None:s   context.derived(locals())t   contexts'   for event in context.blocks[%r][0](%s):t   event(	   RX   R   R   R   R   t   scopedR*   R   R   (   RK   R(   R   t   levelR   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRt   X  s    		
	
c         C   s  | j  s |  j d | j  n  |  j d k r |  j sQ |  j d  |  j   n  |  j d d  |  j rw t    q |  j   n  |  j d |  |  j	 | j
 |  |  j d |  j  |  j d t  |  j   |  j d	  |  j   | j rt |  _ n  |  j d
 7_ d S(   s   Calls the extender.s,   cannot use extend from a non top-level scopei    s   if parent_template is not None:s   raise TemplateRuntimeError(%r)s   extended multiple timess+   parent_template = environment.get_template(s   , %r)s6   for name, parent_block in parent_template.blocks.%s():s8   context.blocks.setdefault(name, []).append(parent_block)i   N(   RX   R   R   R   R   R   R   R   R   R$   t   templateR   R*   t   dict_item_iterRY   R1   (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Extendsk  s.    						

	c         C   s  | j  r |  j |  n  | j r< |  j d  |  j   n  d } t | j t j  r t | j j	 t
  ru d } q t | j j	 t t f  r d } q n' t | j t j t j f  r d } n  |  j d | |  |  j | j |  |  j d |  j  | j rY|  j   |  j d  |  j   |  j d  |  j   |  j d	  |  j   n  | j  rr|  j d
  n |  j d  |  j   |  j d |  |  j   | j r|  j   n  d S(   s   Handles includes.s   try:t   get_or_select_templatet   get_templatet   select_templates   template = environment.%s(s   , %r)s   except TemplateNotFound:R   s   else:s]   for event in template.root_render_func(template.new_context(context.parent, True, locals())):s*   for event in template.module._body_stream:R   N(   t   with_contextR   t   ignore_missingR   R   R    R  R   t   ConstR=   R   R6   R7   t   Tuplet   ListR$   R   R*   R   R   (   RK   R(   R   t	   func_name(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Include  s@    					


	

	c         C   s   | j  r |  j |  n  |  j d | j |  | j rP |  j d | j  n  |  j d  |  j | j |  |  j d |  j  | j  r |  j d  n |  j d  | j r | j j	 d  r |  j d | j  n  | j
 j | j  d	 S(
   s   Visit regular imports.s   l_%s = s   context.vars[%r] = s   environment.get_template(s   , %r).s+   make_module(context.parent, True, locals())R   t   _s!   context.exported_vars.discard(%r)N(   R	  R   R   R   RX   R   R$   R  R*   t
   startswithR]   RN   (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR     s    			c         C   s  |  j  |  |  j d  |  j | j |  |  j d |  j  | j rZ |  j d  n |  j d  g  } g  } x | j D] } t | t  r | \ } } n | } |  j	 d | | f  |  j	 d |  |  j
   |  j	 d | d |  j |  t |  f | f  |  j   | j rN| j |  | j d	  sN| j |  qNn  | j j |  q} W| rt |  d
 k r| d } |  j	 d | | f  q|  j	 d d j d   | D   n  | rt |  d
 k r|  j	 d | d  q|  j	 d d j t t |    n  d S(   s   Visit named imports.s-   included_template = environment.get_template(s   , %r).s!   make_module(context.parent, True)R   s.   l_%s = getattr(included_template, %r, missing)s   if l_%s is missing:sG   l_%s = environment.undefined(%r %% included_template.__name__, name=%r)sG   the template %%r (imported on %s) does not export the requested name %sR  i   i    s   context.vars[%r] = l_%ss   context.vars.update({%s})s   , c         s   s   |  ] } d  | | f Vq d S(   s   %r: l_%sN(    (   Rg   R*   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pys	   <genexpr>  s    s!   context.exported_vars.discard(%r)s-   context.exported_vars.difference_update((%s))N(   R   R   R$   R  R*   R	  RC   R    R6   R   R   R   R   R   RX   R   R  R]   RN   R   R   R   (   RK   R(   R   t	   var_namest   discarded_namesR*   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR     sP    		
	
	
		c   
      C   s  | j  d d"  } | j r9 |  j | | | d t } n | j   } | j |  | j py d t | j  d d#  d$  k } | j s |  j | d%  } n- |  j d |  |  j	   |  j
 |  i  } | r |  j d  | j j d  n  xN | j t j  D]: } | j d	 k r | j d k r |  j d
 | j  q q W|  j |  | j rt|  j   } |  j d |  n  d | k rd t | j  d d&  d'  k r|  j d d |  j |   n  |  j d |  |  j | j |  |  j | rd pd  | r| j d  k	 r|  j d  |  j | j |  |  j d  |  j | j |  |  j d  | j ry|  j d  n |  j | j |  |  j d  | j   }	 |  j | j |	  |  j d  n, | j r|  j d  n |  j | j |  | j r|  j d  n |  j | rd p"d  | r| j d  k	 r|  j	   |  j d  |  j | j |  |  j d  |  j	   |  j d  |  j d  n  |  j	   |  j  | j! |  | j r|  j d |  n  |  j   | j r"|  j d |  |  j	   |  j  | j |  |  j   n  | j s>|  j" | |  n  | j r|  j# |  |  j   |  j$ | |  |  j d   |  j | j |  |  j d!  |  j% |  n  d  S((   Nt   excludeR   R   R   t   onlyR   s-   def loop(reciter, loop_render_func, depth=0):s   l_loop = missingRx   s8   Can't assign to special loop variable in for-loop targets   %s = 1R   R~   s/   l_loop = environment.undefined(%r, name='loop')s   'loop' is undefined. the filter section of a loop as well as the else block don't have access to the special 'loop' variable of the current loop.  Because there is no parent loop it's undefined.  Happened in loop on %ss   for s   , l_loop in LoopContext(s    in t   (s    for t   reciters    if (s   ))s   , loop_render_func, depth):s   ):t   :s   if not t   continuei   s   %s = 0s   if %s:s   loop(s   , loop)(   s   iter(   s   body(   s   loop(   s   loop(   s   else_s   test(   s   loop(&   R   t	   recursiveR   R;   Rk   Rf   RE   R   R   R   R[   RW   RO   R   R   t   NameRv   R*   R   R   R   R   R   R   R$   R   R   R~   R%   R   RQ   R   R   R   R   R   R   R   (
   RK   R(   R   R   t
   loop_framet   extended_loopR   R*   t   iteration_indicatort
   test_frame(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR     s    		
						


	
	
		
c         C   s   | j    } |  j d |  |  j | j |  |  j d  |  j   |  j | j |  |  j   | j	 r |  j d  |  j   |  j | j	 |  |  j   n  d  S(   Ns   if R  s   else:(
   Rl   R   R$   R~   R   R   R   R   R   R   (   RK   R(   R   t   if_frame(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR     s    

	
c         C   s   |  j  | |  } |  j   | j re | j j d  sN |  j d | j  n  |  j d | j  n  |  j d | j  |  j | |  | j j	 | j  d  S(   NR  s   context.exported_vars.add(%r)s   context.vars[%r] = s   l_%s = (
   R   R   RX   R*   R  R   R   R   R]   RN   (   RK   R(   R   t   macro_frame(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR     s    
	c         C   s~   | j  d d  } |  j | | |  } |  j d  |  j | |  |  j | |  |  j | j | d t |  j |  d  S(   NR  R   s	   caller = t   forward_caller(   s   call(	   R   R   R   R   R   t
   visit_CallR   R1   R   (   RK   R(   R   R   t
   call_frame(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR     s    c         C   s   | j    } | j | j    |  j |  } |  j |  |  j |  |  j | j |  |  j | |  |  j	 | j
 |  |  j |  |  j | |  d  S(   N(   Rk   Rf   R   R   R   R[   R   R   R   Rr   R   R   R   (   RK   R(   R   t   filter_frameR   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR     s    c         C   s$   |  j  |  |  j | j |  d  S(   N(   R   R$   R(   (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_ExprStmt  s    c            s    j  r | j r d  S  j j r4   f d   } n t } t } | j ri   j d    j   t } n  g  } x | j	 D] } y | j
 | j  } Wn$ t	 j k
 r | j |  qy n XyI | j j r t | d  r | j   } q t |  } n  | |  } Wn! t k
 r(| j |  qy n X| rVt | d t  rV| d j |  qy | j | g  qy Wt |  d k  s| j d  k	 rw| j d  k	 rt |  d k r  j d | j  n   j d | j    j   n  xL| D]D} t | t  rIt t |   }	 | j d  k r5  j d	 |	  q/  j |	 d
  q| j d  k rk  j d	 |  n   j |  d }
 | j j r  j d  n) | j j r  j d  n   j d    j j d  k	 r  j d  |
 d 7}
 n    j | |    j d |
  | j d  k	 r  j d
  qqW| j d  k	 r  j     j t |  d k rjd pmd  qnzg  } g  } xY | D]Q } t | t  r| j t |  j d d   q| j d  | j |  qW  j d	    j t t |   d  d }   j   x | D] }   j |  d }
 | j j r_  j d  |
 d 7}
 n& | j j r  j d  |
 d 7}
 n    j j d  k	 r  j d  |
 d 7}
 n    j | |    j d |
 d
  q W  j     j d  | r  j   n  d  S(   Nc            s   t    j j |    S(   N(   R   R)   t   finalize(   R   (   RK   (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   <lambda>  s    s   if parent_template is None:t   __html__ii   i   s
   %s.append(s   %s.extend((s   yield s   , s6   (context.eval_ctx.autoescape and escape or to_string)(s   escape(s
   to_string(s   environment.finalize(R   s   ))t   %s   %%s   %ss    % (i    (    R   RZ   R)   R'  R   R;   R   R   R1   R   t   as_constRV   t
   ImpossibleR   R   t   hasattrR)  R	   t	   ExceptionR    R7   R   R[   R%   R   R   R   R   R   R$   R   t   replace(   RK   R(   R   R'  t   outdent_laterR   t   childt   constR>   t   valt   closet   formatR   t   idxt   argument(    (   RK   sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Output  s    	
	!
+"

c         C   s  |  j  |  | j r1 | j   } t   | _ n | } |  j | j |  |  j d  |  j | j |  | j rg  | j D] } | j	 d  s} | ^ q} } t
 | j  d k r t t | j   } |  j d | | f  ng |  j d  xJ t | j  D]9 \ } } | r!|  j d  n  |  j d | | f  q W|  j d  | rt
 |  d k ry|  j d	 | d
  q|  j d d j t t |    qn  d  S(   Ns    = R  i   s   context.vars[%r] = l_%ss   context.vars.update({s   , s   %r: l_%ss   })s   context.exported_vars.add(%r)i    s"   context.exported_vars.update((%s))(   R   RX   RQ   R8   t   toplevel_assignmentsR$   R   R   R(   R  R   R   R   R   t	   enumerateR   R   R   (   RK   R(   R   t   assignment_frameR   t   public_namesR*   R6  (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR   7  s4    				c         C   sY   | j  d k r. | j r. | j j | j  n  |  j d | j  | j j | j  d  S(   NRx   R   (   Rv   RX   R9  RN   R*   R   R]   (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRw   ^  s    c         C   sE   | j  } t | t  r. |  j t |   n |  j t |   d  S(   N(   R=   R    R4   R   t   strR   (   RK   R(   R   R3  (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Constd  s    	c         C   sR   y# |  j  t | j | j    Wn( t j k
 rM |  j  d | j  n Xd  S(   Ns8   (context.eval_ctx.autoescape and Markup or identity)(%r)(   R   R   R+  RV   R   R,  t   data(   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_TemplateDatak  s
    #	c         C   s|   |  j  d  d } xC t | j  D]2 \ } } | rE |  j  d  n  |  j | |  q# W|  j  | d k rq d pt d  d  S(   NR  is   , i    s   ,)R   (   R   R:  R   R$   (   RK   R(   R   R6  R>   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Tupler  s    c         C   sd   |  j  d  xC t | j  D]2 \ } } | r? |  j  d  n  |  j | |  q W|  j  d  d  S(   Nt   [s   , t   ](   R   R:  R   R$   (   RK   R(   R   R6  R>   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt
   visit_List{  s    c         C   s   |  j  d  xf t | j  D]U \ } } | r? |  j  d  n  |  j | j |  |  j  d  |  j | j |  q W|  j  d  d  S(   Nt   {s   , s   : R   (   R   R:  R   R$   R?   R=   (   RK   R(   R   R6  R>   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt
   visit_Dict  s    c            s     f d   } | S(   Nc            s   |  j  j re   |  j  j k re |  j d    |  j | j |  |  j d  |  j | j |  nD |  j d  |  j | j |  |  j d    |  j | j |  |  j d  d  S(   Ns$   environment.call_binop(context, %r, s   , R  s    %s R   (   R)   t	   sandboxedt   intercepted_binopsR   R$   t   leftt   right(   RK   R(   R   (   t   operator(    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRD     s    (    (   RK  t   interceptableRD   (    (   RK  sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   binop  s    c            s     f d   } | S(   Nc            sz   |  j  j rE   |  j  j k rE |  j d    |  j | j |  n$ |  j d    |  j | j |  |  j d  d  S(   Ns#   environment.call_unop(context, %r, R  R   (   R)   RG  t   intercepted_unopsR   R$   R(   (   RK   R(   R   (   RK  (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRD     s    (    (   RK  RL  RD   (    (   RK  sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   uaop  s    	t   +t   -t   *t   /s   //s   **R*  t   andRL  t   ors   not c         C   s   | j  j r d } n | j  j r* d } n d } |  j d |  x. | j D]# } |  j | |  |  j d  qK W|  j d  d  S(   Ns;   (context.eval_ctx.volatile and markup_join or unicode_join)t   markup_joint   unicode_joins   %s((s   , s   ))(   RV   R   R   R   R   R$   (   RK   R(   R   R  R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Concat  s    		c         C   s;   |  j  | j |  x! | j D] } |  j  | |  q Wd  S(   N(   R$   t   exprt   ops(   RK   R(   R   t   op(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Compare  s    c         C   s/   |  j  d t | j  |  j | j |  d  S(   Ns    %s (   R   t	   operatorsR[  R$   RY  (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Operand  s    c         C   s8   |  j  d  |  j | j |  |  j  d | j  d  S(   Ns   environment.getattr(s   , %r)(   R   R$   R(   t   attr(   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Getattr  s    c         C   s   t  | j t j  rX |  j | j |  |  j d  |  j | j |  |  j d  nM |  j d  |  j | j |  |  j d  |  j | j |  |  j d  d  S(   NRB  RC  s   environment.getitem(s   , R   (   R    R   R   t   SliceR$   R(   R   (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Getitem  s    c         C   s   | j  d  k	 r% |  j | j  |  n  |  j d  | j d  k	 rW |  j | j |  n  | j d  k	 r |  j d  |  j | j |  n  d  S(   NR  (   t   startR%   R$   R   t   stopR   (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Slice  s    c         C   sk  |  j  |  j | j d  |  j j j | j  } | d  k r\ |  j d | j | j  n  t | d t	  r~ |  j  d  nD t | d t	  r |  j  d  n" t | d t	  r |  j  d  n  | j
 d  k	 r |  j | j
 |  nc | j j r|  j  d	 | j | j f  n7 | j j r6|  j  d
 | j  n |  j  d | j  |  j | |  |  j  d  d  S(   NR  s   no filter named %rt   contextfilters	   context, t   evalcontextfilters   context.eval_ctx, t   environmentfilters   environment, sB   (context.eval_ctx.autoescape and Markup(concat(%s)) or concat(%s))s   Markup(concat(%s))s
   concat(%s)R   (   R   Ro   R*   R)   t   getR%   R   R   R   R;   R(   R$   RV   R   R[   R   R   (   RK   R(   R   t   func(    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRr     s(    	c         C   s   |  j  |  j | j d  | j |  j j k rM |  j d | j | j  n  |  j | j |  |  j | |  |  j  d  d  S(   NR  s   no test named %rR   (	   R   Rp   R*   R)   R   R   R$   R(   R   (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyRs     s    c            sz       f d   }  j  d   j   j    j  d   j   j    j  d  |    j  d  d  S(   Nc              sD     j  d  k	 r"  j   j    S j d d  j     d  S(   Ns   environment.undefined(%r)sR   the inline if-expression on %s evaluated to false and no else section was defined.(   t   expr2R%   R$   R   R   (    (   R(   RK   R   (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   write_expr2  s    R  s    if s    else R   (   R   R$   t   expr1R~   (   RK   R(   R   Rl  (    (   R(   RK   R   sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_CondExpr  s    c         C   sy   |  j  j r |  j d  n |  j d  |  j | j |  | rO i d d 6pR d  } |  j | | |  |  j d  d  S(   Ns   environment.call(context, s   context.call(R   R   (   R)   RG  R   R$   R(   R%   R   (   RK   R(   R   R"  R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR#    s    c         C   s+   |  j  | j d  |  j | j |  d  S(   Nt   =(   R   R?   R$   R=   (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_Keyword(  s    c         C   s1   |  j  d  |  j | j |  |  j  d  d  S(   Ns   Markup(R   (   R   R$   RY  (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_MarkSafe.  s    c         C   s1   |  j  d  |  j | j |  |  j  d  d  S(   Ns5   (context.eval_ctx.autoescape and Markup or identity)(R   (   R   R$   RY  (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_MarkSafeIfAutoescape3  s    c         C   s   |  j  d | j  d  S(   Ns   environment.(   R   R*   (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_EnvironmentAttribute8  s    c         C   s!   |  j  d | j | j f  d  S(   Ns   environment.extensions[%r].%s(   R   t
   identifierR*   (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_ExtensionAttribute;  s    c         C   s   |  j  |  j | j  d  S(   N(   R   R   R   (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_ImportedName>  s    c         C   s   |  j  | j  d  S(   N(   R   R*   (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_InternalNameA  s    c         C   s   |  j  d  d  S(   NR   (   R   (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_ContextReferenceD  s    c         C   s   |  j  d |  d  S(   NR  (   R   (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_ContinueG  s    c         C   s   |  j  d |  d  S(   Nt   break(   R   (   RK   R(   R   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_BreakJ  s    c         C   sb   | j    } | j | j    |  j |  } |  j |  |  j | j |  |  j | |  d  S(   N(   Rk   Rf   R   R   R   R   R   R   (   RK   R(   R   t   scope_frameR   (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR   M  s    c         C   s   x | j  D] } |  j d | j  |  j | j |  y | j j | j  } Wn  t j k
 rr t	 | j _
 q
 Xt | j | j |  q
 Wd  S(   Ns   context.eval_ctx.%s = (   t   optionsR   R?   R$   R=   R+  RV   R   R,  R1   R   t   setattr(   RK   R(   R   t   keywordR3  (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_EvalContextModifierU  s    c         C   s   |  j    } | j j   } |  j d |  |  j | |  x! | j D] } |  j | |  qF W| j j |  |  j d |  d  S(   Ns   %s = context.eval_ctx.save()s   context.eval_ctx.revert(%s)(   R   RV   t   saveR   R  R   R$   t   revert(   RK   R(   R   t   old_ctx_namet	   safed_ctxR1  (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   visit_ScopedEvalContextModifier`  s    N(    (V   RR   RS   R%   R;   RL   R   R   R[   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R1   R   R   R   R   R   Rt   R  R  R   R   R   R   R   R   R   R&  R8  R   Rw   R>  R@  RA  RD  RF  RM  RO  t	   visit_Addt	   visit_Subt	   visit_Mult	   visit_Divt   visit_FloorDivt	   visit_Powt	   visit_Modt	   visit_Andt   visit_Ort	   visit_Post	   visit_Negt	   visit_NotRX  R\  R^  R`  Rb  Re  Rr   Rs   Rn  R#  Rp  Rq  Rr  Rs  Ru  Rv  Rw  Rx  Ry  R{  R   R  R  (    (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyR#   l  s   6								5				D			c		/	+		5	~							{	'							
						
			
												N(3   RT   t	   itertoolsR    RQ   R   R  R   R   t   jinja2R   t   jinja2.nodesR   t   jinja2.visitorR   t   jinja2.exceptionsR   t   jinja2.utilsR   R   R	   t   jinja2._compatR
   R   R   R   R   R   R   R]  R-  R<   R  R   R2   R   R%   R;   R.   R:   RE   R`   RF   RU   t   RuntimeErrorRA   Rn   R@   Re   R.  R   R#   (    (    (    sU   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/compiler.pyt   <module>
   sH   4
		
		%XV