%global _empty_manifest_terminate_build 0 Name: python-django-tag-parser Version: 3.2 Release: 1 Summary: Micro-library to easily write custom Django template tags License: Apache 2.0 URL: https://github.com/edoburu/django-tag-parser Source0: https://mirrors.nju.edu.cn/pypi/web/packages/30/54/42caebce5b09aa8e630c088eed06e58e287f51845b08bef276cd618e4933/django-tag-parser-3.2.tar.gz BuildArch: noarch %description A micro-library to easily write custom Django template tags. Features: * Functions to parse tags, especially: "args", "kwargs", and "as varname" syntax. * Real OOP classes to write custom inclusion tags. Functions: * ``parse_token_kwargs``: split a token into the tag name, args and kwargs. * ``parse_as_var``: extract the "as varname" from a token. Base classes (in ``tag_parser.basetags``): * ``BaseNode``: A template ``Node`` object which features some basic parsing abilities. * ``BaseInclusionNode``: a ``Node`` that has ``inclusion_tag`` like behaviour, but allows to override the ``template_name`` dynamically. * ``BaseAssignmentNode``: a ``Node`` that returns the value in the context, using the ``as var`` syntax. * ``BaseAssignmentOrOutputNode``: a ``Node`` that either displays the value, or inserts it in the context. * ``BaseAssignmentOrInclusionNode``: a class that allows a ``{% get_items template="..." %}`` and ``{% get_items as var %}`` syntax. The base classes allows to implement ``@register.simple_tag``, ``@register.inclusion_tag`` and ``@register.assignment_tag`` like functionalities, while still leaving room to extend the parsing, rendering or syntax validation. For example, not all arguments need to be seen as template variables, filters or literal keywords. As of v3.0, the ``@template_tag`` decorator is no longer needed. Use ``@register.tag("name")`` directly on the class names. %package -n python3-django-tag-parser Summary: Micro-library to easily write custom Django template tags Provides: python-django-tag-parser BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-django-tag-parser A micro-library to easily write custom Django template tags. Features: * Functions to parse tags, especially: "args", "kwargs", and "as varname" syntax. * Real OOP classes to write custom inclusion tags. Functions: * ``parse_token_kwargs``: split a token into the tag name, args and kwargs. * ``parse_as_var``: extract the "as varname" from a token. Base classes (in ``tag_parser.basetags``): * ``BaseNode``: A template ``Node`` object which features some basic parsing abilities. * ``BaseInclusionNode``: a ``Node`` that has ``inclusion_tag`` like behaviour, but allows to override the ``template_name`` dynamically. * ``BaseAssignmentNode``: a ``Node`` that returns the value in the context, using the ``as var`` syntax. * ``BaseAssignmentOrOutputNode``: a ``Node`` that either displays the value, or inserts it in the context. * ``BaseAssignmentOrInclusionNode``: a class that allows a ``{% get_items template="..." %}`` and ``{% get_items as var %}`` syntax. The base classes allows to implement ``@register.simple_tag``, ``@register.inclusion_tag`` and ``@register.assignment_tag`` like functionalities, while still leaving room to extend the parsing, rendering or syntax validation. For example, not all arguments need to be seen as template variables, filters or literal keywords. As of v3.0, the ``@template_tag`` decorator is no longer needed. Use ``@register.tag("name")`` directly on the class names. %package help Summary: Development documents and examples for django-tag-parser Provides: python3-django-tag-parser-doc %description help A micro-library to easily write custom Django template tags. Features: * Functions to parse tags, especially: "args", "kwargs", and "as varname" syntax. * Real OOP classes to write custom inclusion tags. Functions: * ``parse_token_kwargs``: split a token into the tag name, args and kwargs. * ``parse_as_var``: extract the "as varname" from a token. Base classes (in ``tag_parser.basetags``): * ``BaseNode``: A template ``Node`` object which features some basic parsing abilities. * ``BaseInclusionNode``: a ``Node`` that has ``inclusion_tag`` like behaviour, but allows to override the ``template_name`` dynamically. * ``BaseAssignmentNode``: a ``Node`` that returns the value in the context, using the ``as var`` syntax. * ``BaseAssignmentOrOutputNode``: a ``Node`` that either displays the value, or inserts it in the context. * ``BaseAssignmentOrInclusionNode``: a class that allows a ``{% get_items template="..." %}`` and ``{% get_items as var %}`` syntax. The base classes allows to implement ``@register.simple_tag``, ``@register.inclusion_tag`` and ``@register.assignment_tag`` like functionalities, while still leaving room to extend the parsing, rendering or syntax validation. For example, not all arguments need to be seen as template variables, filters or literal keywords. As of v3.0, the ``@template_tag`` decorator is no longer needed. Use ``@register.tag("name")`` directly on the class names. %prep %autosetup -n django-tag-parser-3.2 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-django-tag-parser -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Tue Apr 25 2023 Python_Bot - 3.2-1 - Package Spec generated