%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib/python3.7/site-packages/jinja2/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib/python3.7/site-packages/jinja2/__pycache__/tests.cpython-37.pyc

B

��Rt
�@s�dZddlZddlmZddlmZmZmZe�d�Z	e
e	�ZeZ
dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zeeeeeeeeeeeeee
eed$�ZdS)%z�
    jinja2.tests
    ~~~~~~~~~~~~

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

    :copyright: (c) 2010 by the Jinja Team.
    :license: BSD, see LICENSE for more details.
�N)�	Undefined)�	text_type�string_types�
mapping_typesz^-?\d+(\.\d+)?$cCs|ddkS)z#Return true if the variable is odd.���)�valuerr�=/opt/alt/python37/lib/python3.7/site-packages/jinja2/tests.py�test_oddsrcCs|ddkS)z$Return true if the variable is even.rrr)r	rrr
�	test_evensrcCs||dkS)z-Check if a variable is divisible by a number.rr)r	Znumrrr
�test_divisibleby!sr
cCst|t�S)a;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.
    )�
isinstancer)r	rrr
�test_defined&srcCs
t|t�S)z-Like :func:`defined` but the other way round.)rr)r	rrr
�test_undefined7srcCs|dkS)z$Return true if the variable is none.Nr)r	rrr
�	test_none<srcCst|���S)z*Return true if the variable is lowercased.)r�islower)r	rrr
�
test_lowerAsrcCst|���S)z*Return true if the variable is uppercased.)r�isupper)r	rrr
�
test_upperFsrcCs
t|t�S)z&Return true if the object is a string.)rr)r	rrr
�test_stringKsrcCs
t|t�S)zSReturn true if the object is a mapping (dict etc.).

    .. versionadded:: 2.6
    )rr)r	rrr
�test_mappingPsrcCst|tttf�S)z(Return true if the variable is a number.)r�int�float�complex)r	rrr
�test_numberXsrcCs"yt|�|jWn
dSdS)z^Return true if the variable is a sequence. Sequences are variables
    that are iterable.
    FT)�len�__getitem__)r	rrr
�
test_sequence]s
rcCs||kS)z�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)r	�otherrrr
�test_sameasis
r cCs&yt|�Wntk
r dSXdS)z1Check if it's possible to iterate over an object.FT)�iter�	TypeError)r	rrr
�
test_iterablevs
r#cCs
t|d�S)zCheck if the value is escaped.Z__html__)�hasattr)r	rrr
�test_escapedsr%)ZoddZevenZdivisiblebyZdefinedZ	undefinedZnone�lower�upper�string�mappingZnumberZsequence�iterable�callableZsameasZescaped)�__doc__�reZjinja2.runtimerZjinja2._compatrrr�compileZ	number_re�typeZ
regex_typer+Z
test_callablerrr
rrrrrrrrrr r#r%ZTESTSrrrr
�<module>
sJ

	

Zerion Mini Shell 1.0