Viewing File: /usr/lib/python2.7/site-packages/jinja2/tests.pyo

ó
ÈÏRc@s`dZddlZddlmZddlmZmZmZejdƒZ	e
e	ƒZeZ
d„Zd„Zd„Zd	„Zd
„Zd„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zied6ed6ed6ed6ed6ed6ed6ed6ed6ed6ed6ed 6ed!6e
d"6ed#6ed$6ZdS(%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+)?$cCs|ddkS(s#Return true if the variable is odd.ii((tvalue((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyttest_oddscCs|ddkS(s$Return true if the variable is even.ii((R((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyt	test_evenscCs||dkS(s-Check if a variable is divisible by a number.i((Rtnum((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyttest_divisibleby!scCst|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((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyttest_defined&scCs
t|tƒS(s-Like :func:`defined` but the other way round.(R	R(R((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyttest_undefined7scCs
|dkS(s$Return true if the variable is none.N(tNone(R((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyt	test_none<scCst|ƒjƒS(s*Return true if the variable is lowercased.(Rtislower(R((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyt
test_lowerAscCst|ƒjƒS(s*Return true if the variable is uppercased.(Rtisupper(R((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyt
test_upperFscCs
t|tƒS(s&Return true if the object is a string.(R	R(R((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyttest_stringKscCs
t|tƒS(sSReturn true if the object is a mapping (dict etc.).

    .. versionadded:: 2.6
    (R	R(R((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyttest_mappingPscCst|tttfƒS(s(Return true if the variable is a number.(R	tinttfloattcomplex(R((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyttest_numberXscCs$yt|ƒ|jWntSXtS(s^Return true if the variable is a sequence. Sequences are variables
    that are iterable.
    (tlent__getitem__tFalsetTrue(R((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyt
test_sequence]s
cCs
||kS(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 %}
    ((Rtother((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyttest_sameasis
cCs'yt|ƒWntk
r"tSXtS(s1Check if it's possible to iterate over an object.(titert	TypeErrorRR(R((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyt
test_iterablevs

cCs
t|dƒS(sCheck if the value is escaped.t__html__(thasattr(R((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyttest_escapedstoddteventdivisiblebytdefinedt	undefinedtnonetlowertuppertstringtmappingtnumbertsequencetiterabletcallabletsameastescaped(t__doc__tretjinja2.runtimeRtjinja2._compatRRRtcompilet	number_rettypet
regex_typeR2t
test_callableRRRR
RR
RRRRRRRR!R$tTESTS(((s0/usr/lib/python2.7/site-packages/jinja2/tests.pyt<module>
sL													
			
Back to Directory File Manager