ó
S\›]c           @   s$  d  Z  d d l Z d d l Z d d l m Z d d l m Z m Z m Z m	 Z	 d d l
 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 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% 6e  d& 6e j! d' 6e j! d( 6e j! d) 6e j" d* 6e j" d+ 6e j# d, 6e j# d- 6e j# d. 6e j$ d/ 6e j$ d0 6e j% d1 6e j% d2 6e j% d3 6e j& d4 6e j& d5 6Z' d S(6   s¹   
    jinja2.tests
    ~~~~~~~~~~~~

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

    :copyright: (c) 2017 by the Jinja Team.
    :license: BSD, see LICENSE for more details.
iÿÿÿÿN(   t	   Undefined(   t	   text_typet   string_typest   integer_typest   abcs   ^-?\d+(\.\d+)?$c         C   s   |  d d k S(   s#   Return true if the variable is odd.i   i   (    (   t   value(    (    s+   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   (    (    s+   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(    (    s+   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   (    (    s+   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   (    (    s+   lib/python2.7/site-packages/jinja2/tests.pyt   test_undefined8   s    c         C   s
   |  d k S(   s$   Return true if the variable is none.N(   t   None(   R   (    (    s+   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   (    (    s+   lib/python2.7/site-packages/jinja2/tests.pyt
   test_lowerB   s    c         C   s   t  |  ƒ j ƒ  S(   s*   Return true if the variable is uppercased.(   R   t   isupper(   R   (    (    s+   lib/python2.7/site-packages/jinja2/tests.pyt
   test_upperG   s    c         C   s   t  |  t ƒ S(   s&   Return true if the object is a string.(   R
   R   (   R   (    (    s+   lib/python2.7/site-packages/jinja2/tests.pyt   test_stringL   s    c         C   s   t  |  t j ƒ S(   sS   Return true if the object is a mapping (dict etc.).

    .. versionadded:: 2.6
    (   R
   R   t   Mapping(   R   (    (    s+   lib/python2.7/site-packages/jinja2/tests.pyt   test_mappingQ   s    c         C   s   t  |  t t t t j f ƒ S(   s(   Return true if the variable is a number.(   R
   R   t   floatt   complext   decimalt   Decimal(   R   (    (    s+   lib/python2.7/site-packages/jinja2/tests.pyt   test_numberY   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   (    (    s+   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(    (    s+   lib/python2.7/site-packages/jinja2/tests.pyt   test_sameasj   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   (    (    s+   lib/python2.7/site-packages/jinja2/tests.pyt   test_iterablew   s
    c         C   s   t  |  d ƒ S(   s   Check if the value is escaped.t   __html__(   t   hasattr(   R   (    (    s+   lib/python2.7/site-packages/jinja2/tests.pyt   test_escaped€   s    c         C   s
   |  | k S(   s:   Check if value is in seq.

    .. versionadded:: 2.10
    (    (   R   t   seq(    (    s+   lib/python2.7/site-packages/jinja2/tests.pyt   test_in…   s    t   oddt   event   divisiblebyt   definedt	   undefinedt   nonet   lowert   uppert   stringt   mappingt   numbert   sequencet   iterablet   callablet   sameast   escapedt   ins   ==t   eqt   equaltos   !=t   net   >t   gtt   greaterthant   ges   >=t   <t   ltt   lessthans   <=t   le((   t   __doc__t   operatort   ret   jinja2.runtimeR    t   jinja2._compatR   R   R   R   R   t   compilet	   number_ret   typet
   regex_typeR7   t   test_callableR   R   R	   R   R   R   R   R   R   R   R   R   R!   R$   R'   R)   R;   R=   R?   RA   RC   RE   t   TESTS(    (    (    s+   lib/python2.7/site-packages/jinja2/tests.pyt   <module>
   sr   "																	













