diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-04-12 04:54:41 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-04-12 04:54:41 +0000 |
| commit | 86ee9d68b0517f4776cb0abe4933c31e94a0a721 (patch) | |
| tree | e75431be12d1af7881800d515f9e5787a1d740bb | |
| parent | 98ad561e6c1935ca39ab5dc03fe12cc2f5c097ce (diff) | |
automatic import of python-django-tag-parser
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-django-tag-parser.spec | 123 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 125 insertions, 0 deletions
@@ -0,0 +1 @@ +/django-tag-parser-3.2.tar.gz diff --git a/python-django-tag-parser.spec b/python-django-tag-parser.spec new file mode 100644 index 0000000..f29c0c6 --- /dev/null +++ b/python-django-tag-parser.spec @@ -0,0 +1,123 @@ +%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 +* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 3.2-1 +- Package Spec generated @@ -0,0 +1 @@ +4160554fe9beae29ebc86aea67107df0 django-tag-parser-3.2.tar.gz |
