* internal attributes now raise an internal attribute error now instead of returning an undefined. This fixes problems when passing undefined objects to Python semantics expecting APIs. * traceback support now works properly for PyPy. (Tested with 1.4) * implemented operator intercepting for sandboxed environments. This allows application developers to disable builtin operators for better security. (For instance limit the mathematical operators to actual integers instead of longs) * groupby filter now supports dotted notation for grouping by attributes of attributes. * scoped blocks not properly treat toplevel assignments and imports. Previously an import suddenly "disappeared" in a scoped block. * automatically detect newer Python interpreter versions before loading code from bytecode caches to prevent segfaults on invalid opcodes. The segfault in earlier Jinja2 versions here was not a Jinja2 bug but a limitation in the underlying Python interpreter. If you notice Jinja2 segfaulting in earlier versions after an upgrade of the Python interpreter you don't have to upgrade, it's enough to flush the bytecode cache. This just no longer makes this necessary, Jinja2 will automatically detect these cases now. * the sum filter can now sum up values by attribute. This is a backwards incompatible change. The argument to the filter previously was the optional starting index which defaultes to zero. This now became the second argument to the function because it's rarely used. * like sum, sort now also makes it possible to order items by attribute. * like sum and sort, join now also is able to join attributes of objects as string. * the internal eval context now has a reference to the environment. * added a mapping test to see if an object is a dict or an object with a similar interface. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Jinja2?expand=0&rev=3
78 lines
2.4 KiB
RPMSpec
78 lines
2.4 KiB
RPMSpec
#
|
|
# spec file for package python-Jinja2
|
|
#
|
|
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
|
|
Name: python-Jinja2
|
|
Version: 2.6
|
|
Release: 1
|
|
Url: http://jinja.pocoo.org/
|
|
Summary: A fast and easy to use template engine written in pure Python
|
|
License: BSD
|
|
Group: Development/Languages/Python
|
|
Source: http://pypi.python.org/packages/source/J/Jinja2/Jinja2-%{version}.tar.gz
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
BuildRequires: python-devel
|
|
BuildRequires: python-setuptools
|
|
%if 0%{?suse_version}
|
|
%py_requires
|
|
%if 0%{?suse_version} > 1010
|
|
BuildRequires: fdupes
|
|
%endif
|
|
%if 0%{?suse_version} > 1110
|
|
BuildArch: noarch
|
|
%endif
|
|
%endif
|
|
Provides: python-jinja2 = %{version}
|
|
Obsoletes: python-jinja2 < %{version}
|
|
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
|
|
|
%description
|
|
Jinja2 is a template engine written in pure Python. It provides a Django
|
|
inspired non-XML syntax but supports inline expressions and an optional
|
|
sandboxed environment. Here a small example of a Jinja template:
|
|
|
|
{% extends 'base.html' %}
|
|
{% block title %}Memberlist{% endblock %}
|
|
{% block content %}
|
|
<ul>
|
|
{% for user in users %}
|
|
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endblock %}
|
|
|
|
%prep
|
|
%setup -q -n Jinja2-%{version}
|
|
|
|
%build
|
|
python setup.py build
|
|
sed -i 's/\r$//' LICENSE # Fix wrong EOL encoding
|
|
|
|
%install
|
|
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
|
%if 0%{?suse_version} > 1010
|
|
%fdupes %{buildroot}%{_prefix}
|
|
%endif
|
|
|
|
%files
|
|
%defattr(-,root,root,-)
|
|
%doc AUTHORS CHANGES LICENSE artwork examples ext
|
|
%{python_sitelib}/*
|
|
|
|
%changelog
|