ó
 `¾Tc           @   s`  d  Z  d d l Z d d l m Z d d l m Z m Z m Z e j d ƒ Z	 e
 e	 ƒ Z 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 d „  Z d „  Z i e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d  6e d! 6e d" 6e d# 6e d$ 6Z d S(%   s¹   
    jinja2.tests
    ~~~~~~~~~~~~

    Jinja test functions. Used with the "is" operator.

    :copyright: (c) 2010 by the Jinja Team.
    :license: BSD, see LICENSE for more details.
iÿÿÿÿN(   t	   Undefined(   t	   text_typet   string_typest   mapping_typess   ^-?\d+(\.\d+)?$c         C   s   |  d d k S(   s#   Return true if the variable is odd.i   i   (    (   t   value(    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt   test_odd   s    c         C   s   |  d d k S(   s$   Return true if the variable is even.i   i    (    (   R   (    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt	   test_even   s    c         C   s   |  | d k S(   s-   Check if a variable is divisible by a number.i    (    (   R   t   num(    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt   test_divisibleby!   s    c         C   s   t  |  t ƒ S(   s;  Return true if the variable is defined:

    .. sourcecode:: jinja

        {% if variable is defined %}
            value of variable: {{ variable }}
        {% else %}
            variable is not defined
        {% endif %}

    See the :func:`default` filter for a simple way to set undefined
    variables.
    (   t
   isinstanceR    (   R   (    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt   test_defined&   s    c         C   s   t  |  t ƒ S(   s-   Like :func:`defined` but the other way round.(   R	   R    (   R   (    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt   test_undefined7   s    c         C   s
   |  d k S(   s$   Return true if the variable is none.N(   t   None(   R   (    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt	   test_none<   s    c         C   s   t  |  ƒ j ƒ  S(   s*   Return true if the variable is lowercased.(   R   t   islower(   R   (    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt
   test_lowerA   s    c         C   s   t  |  ƒ j ƒ  S(   s*   Return true if the variable is uppercased.(   R   t   isupper(   R   (    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt
   test_upperF   s    c         C   s   t  |  t ƒ S(   s&   Return true if the object is a string.(   R	   R   (   R   (    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt   test_stringK   s    c         C   s   t  |  t ƒ S(   sS   Return true if the object is a mapping (dict etc.).

    .. versionadded:: 2.6
    (   R	   R   (   R   (    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt   test_mappingP   s    c         C   s   t  |  t t t f ƒ S(   s(   Return true if the variable is a number.(   R	   t   intt   floatt   complex(   R   (    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt   test_numberX   s    c         C   s$   y t  |  ƒ |  j Wn t SXt S(   s^   Return true if the variable is a sequence. Sequences are variables
    that are iterable.
    (   t   lent   __getitem__t   Falset   True(   R   (    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt   test_sequence]   s    
c         C   s
   |  | k S(   sï   Check if an object points to the same memory address than another
    object:

    .. sourcecode:: jinja

        {% if foo.attribute is sameas false %}
            the foo attribute really is the `False` singleton
        {% endif %}
    (    (   R   t   other(    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt   test_sameasi   s    
c         C   s'   y t  |  ƒ Wn t k
 r" t SXt S(   s1   Check if it's possible to iterate over an object.(   t   itert	   TypeErrorR   R   (   R   (    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt   test_iterablev   s
    c         C   s   t  |  d ƒ S(   s   Check if the value is escaped.t   __html__(   t   hasattr(   R   (    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt   test_escaped   s    t   oddt   event   divisiblebyt   definedt	   undefinedt   nonet   lowert   uppert   stringt   mappingt   numbert   sequencet   iterablet   callablet   sameast   escaped(   t   __doc__t   ret   jinja2.runtimeR    t   jinja2._compatR   R   R   t   compilet	   number_ret   typet
   regex_typeR2   t   test_callableR   R   R   R
   R   R   R   R   R   R   R   R   R   R!   R$   t   TESTS(    (    (    sR   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/jinja2/tests.pyt   <module>
   sL   																