Translation of UI (german and english)
Bugfix for feeds - removed categories related and up - load new books now working - category random now working login page is free of non accessible elements boolean custom column is vivible in UI books with only with certain languages can be shown book shelfs can be deleted from UI Anonymous user view is more resticted Added browse of series in sidebar Dependencys in vendor folder are updated to newer versions (licencs files are now present) Bugfix editing Authors names Made upload on windows working
This commit is contained in:
32
vendor/jinja2/tests.py
vendored
32
vendor/jinja2/tests.py
vendored
@ -9,9 +9,10 @@
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
import re
|
||||
from collections import Mapping
|
||||
from jinja2.runtime import Undefined
|
||||
from jinja2._compat import text_type, string_types, mapping_types
|
||||
|
||||
from jinja2._compat import text_type, string_types, integer_types
|
||||
import decimal
|
||||
|
||||
number_re = re.compile(r'^-?\d+(\.\d+)?$')
|
||||
regex_type = type(number_re)
|
||||
@ -82,12 +83,12 @@ def test_mapping(value):
|
||||
|
||||
.. versionadded:: 2.6
|
||||
"""
|
||||
return isinstance(value, mapping_types)
|
||||
return isinstance(value, Mapping)
|
||||
|
||||
|
||||
def test_number(value):
|
||||
"""Return true if the variable is a number."""
|
||||
return isinstance(value, (int, float, complex))
|
||||
return isinstance(value, integer_types + (float, complex, decimal.Decimal))
|
||||
|
||||
|
||||
def test_sequence(value):
|
||||
@ -102,6 +103,28 @@ def test_sequence(value):
|
||||
return True
|
||||
|
||||
|
||||
def test_equalto(value, other):
|
||||
"""Check if an object has the same value as another object:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{% if foo.expression is equalto 42 %}
|
||||
the foo attribute evaluates to the constant 42
|
||||
{% endif %}
|
||||
|
||||
This appears to be a useless test as it does exactly the same as the
|
||||
``==`` operator, but it can be useful when used together with the
|
||||
`selectattr` function:
|
||||
|
||||
.. sourcecode:: jinja
|
||||
|
||||
{{ users|selectattr("email", "equalto", "foo@bar.invalid") }}
|
||||
|
||||
.. versionadded:: 2.8
|
||||
"""
|
||||
return value == other
|
||||
|
||||
|
||||
def test_sameas(value, other):
|
||||
"""Check if an object points to the same memory address than another
|
||||
object:
|
||||
@ -145,5 +168,6 @@ TESTS = {
|
||||
'iterable': test_iterable,
|
||||
'callable': test_callable,
|
||||
'sameas': test_sameas,
|
||||
'equalto': test_equalto,
|
||||
'escaped': test_escaped
|
||||
}
|
||||
|
Reference in New Issue
Block a user