From 30f0a5a296769dfea4625b2f8a23969ed416bfe3 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 31 May 2023 04:58:54 +0000 Subject: automatic import of python-django-groove --- python-django-groove.spec | 387 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 387 insertions(+) create mode 100644 python-django-groove.spec (limited to 'python-django-groove.spec') diff --git a/python-django-groove.spec b/python-django-groove.spec new file mode 100644 index 0000000..94901f0 --- /dev/null +++ b/python-django-groove.spec @@ -0,0 +1,387 @@ +%global _empty_manifest_terminate_build 0 +Name: python-django-groove +Version: 0.4.6 +Release: 1 +Summary: Various utilities for Django projects. +License: BSD +URL: https://github.com/funkbit/django-groove +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/a6/71/5565660c02666920e93ceddf6ea706fc4e38906c7e9395cfc0bbd0e7f03a/django-groove-0.4.6.tar.gz +BuildArch: noarch + + +%description +# Django Groove + +django-groove is a Django app with various utilities, such as a template +context processor that adds the current Django Site object and an utility +method for sending HTML mail. + + +## Installation + +Install `django-groove` (available on PyPi): + + pip install django-groove + + +## Components + +### `groove.auth.decorators` + +Two decorators that limits a view with Django User permissions, includes checks +for staff or super users. Raises a 404 if user does not have sufficient +permission, security through obscurity. + +Available decorators: `staff_required` and `superuser_required`. + +Example usage in views: + + @superuser_required + def index(request): + ... + +Example usage in URL config: + + url(r'^$', superuser_required('views.index'), name='index'), + + +### `groove.context_processors.site.current_site` + +A template context processor that adds the current Django Site object to the +template context. Uses `RequestSite` as fallback. + +Add this to your settings.py: + + from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS + TEMPLATE_CONTEXT_PROCESSORS += ( + 'groove.context_processors.site.current_site', + ) + +You can now use `{{ site.name }}` and `{{ site.domain }}` in all your templates. + + +### `groove.email.html.send_html_email` + +A shortcut to ease sending of HTML enabled email. Adds current site, media and +static URLs to template context, if not present. + +Usage: + + from groove.email.html import send_html_email + email_sent = send_html_email('foo@example.com', 'account/welcome', {'user': user}) + +With `template_prefix` as `'account/welcome'`, the following templates +are rendered with `user` variable available: +* account/welcome.txt (plain text version) +* account/welcome.html (HTML version) +* account/welcome_subject.txt (plain text subject, one line only) + + +### `groove.http.JsonResponse` + +An HTTP response class with JSON mime type, optionally dumps given object +to JSON. Also converts datetime and Decimal objects properly. + + +### `groove.models.abstract.TimestampedModel` + +Abstract Django class that automatically timestamps object instances upon +creation and modification. + +Inherit from `TimestampedModel` instead of `models.Model` to automatically add +`creation_time` and `modification_time` fields to model. + + +### `groove.storage.s3` + +Defines two `s3boto` storage classes to ease the separation of static and +media files when using Amazon S3. + + +### `groove.views.generic.LimitedTemplateView` + +Wrapper around TemplateView generic view with a login required decorator. + +Example usage in URL config: + + url(r'^secret/$', LimitedTemplateView.as_view( + template_name='secret.html'), name='secret'), + + +### `groove.views.generic.ExtraContextTemplateView` + +Extends TemplateView to accept a dictionary of additional context. + +Example usage in URL config: + + url(r'^foo/$', ExtraContextTemplateView.as_view( + template_name='foo.html', extra_context={'foo': 'bar'})), + +%package -n python3-django-groove +Summary: Various utilities for Django projects. +Provides: python-django-groove +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-django-groove +# Django Groove + +django-groove is a Django app with various utilities, such as a template +context processor that adds the current Django Site object and an utility +method for sending HTML mail. + + +## Installation + +Install `django-groove` (available on PyPi): + + pip install django-groove + + +## Components + +### `groove.auth.decorators` + +Two decorators that limits a view with Django User permissions, includes checks +for staff or super users. Raises a 404 if user does not have sufficient +permission, security through obscurity. + +Available decorators: `staff_required` and `superuser_required`. + +Example usage in views: + + @superuser_required + def index(request): + ... + +Example usage in URL config: + + url(r'^$', superuser_required('views.index'), name='index'), + + +### `groove.context_processors.site.current_site` + +A template context processor that adds the current Django Site object to the +template context. Uses `RequestSite` as fallback. + +Add this to your settings.py: + + from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS + TEMPLATE_CONTEXT_PROCESSORS += ( + 'groove.context_processors.site.current_site', + ) + +You can now use `{{ site.name }}` and `{{ site.domain }}` in all your templates. + + +### `groove.email.html.send_html_email` + +A shortcut to ease sending of HTML enabled email. Adds current site, media and +static URLs to template context, if not present. + +Usage: + + from groove.email.html import send_html_email + email_sent = send_html_email('foo@example.com', 'account/welcome', {'user': user}) + +With `template_prefix` as `'account/welcome'`, the following templates +are rendered with `user` variable available: +* account/welcome.txt (plain text version) +* account/welcome.html (HTML version) +* account/welcome_subject.txt (plain text subject, one line only) + + +### `groove.http.JsonResponse` + +An HTTP response class with JSON mime type, optionally dumps given object +to JSON. Also converts datetime and Decimal objects properly. + + +### `groove.models.abstract.TimestampedModel` + +Abstract Django class that automatically timestamps object instances upon +creation and modification. + +Inherit from `TimestampedModel` instead of `models.Model` to automatically add +`creation_time` and `modification_time` fields to model. + + +### `groove.storage.s3` + +Defines two `s3boto` storage classes to ease the separation of static and +media files when using Amazon S3. + + +### `groove.views.generic.LimitedTemplateView` + +Wrapper around TemplateView generic view with a login required decorator. + +Example usage in URL config: + + url(r'^secret/$', LimitedTemplateView.as_view( + template_name='secret.html'), name='secret'), + + +### `groove.views.generic.ExtraContextTemplateView` + +Extends TemplateView to accept a dictionary of additional context. + +Example usage in URL config: + + url(r'^foo/$', ExtraContextTemplateView.as_view( + template_name='foo.html', extra_context={'foo': 'bar'})), + +%package help +Summary: Development documents and examples for django-groove +Provides: python3-django-groove-doc +%description help +# Django Groove + +django-groove is a Django app with various utilities, such as a template +context processor that adds the current Django Site object and an utility +method for sending HTML mail. + + +## Installation + +Install `django-groove` (available on PyPi): + + pip install django-groove + + +## Components + +### `groove.auth.decorators` + +Two decorators that limits a view with Django User permissions, includes checks +for staff or super users. Raises a 404 if user does not have sufficient +permission, security through obscurity. + +Available decorators: `staff_required` and `superuser_required`. + +Example usage in views: + + @superuser_required + def index(request): + ... + +Example usage in URL config: + + url(r'^$', superuser_required('views.index'), name='index'), + + +### `groove.context_processors.site.current_site` + +A template context processor that adds the current Django Site object to the +template context. Uses `RequestSite` as fallback. + +Add this to your settings.py: + + from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS + TEMPLATE_CONTEXT_PROCESSORS += ( + 'groove.context_processors.site.current_site', + ) + +You can now use `{{ site.name }}` and `{{ site.domain }}` in all your templates. + + +### `groove.email.html.send_html_email` + +A shortcut to ease sending of HTML enabled email. Adds current site, media and +static URLs to template context, if not present. + +Usage: + + from groove.email.html import send_html_email + email_sent = send_html_email('foo@example.com', 'account/welcome', {'user': user}) + +With `template_prefix` as `'account/welcome'`, the following templates +are rendered with `user` variable available: +* account/welcome.txt (plain text version) +* account/welcome.html (HTML version) +* account/welcome_subject.txt (plain text subject, one line only) + + +### `groove.http.JsonResponse` + +An HTTP response class with JSON mime type, optionally dumps given object +to JSON. Also converts datetime and Decimal objects properly. + + +### `groove.models.abstract.TimestampedModel` + +Abstract Django class that automatically timestamps object instances upon +creation and modification. + +Inherit from `TimestampedModel` instead of `models.Model` to automatically add +`creation_time` and `modification_time` fields to model. + + +### `groove.storage.s3` + +Defines two `s3boto` storage classes to ease the separation of static and +media files when using Amazon S3. + + +### `groove.views.generic.LimitedTemplateView` + +Wrapper around TemplateView generic view with a login required decorator. + +Example usage in URL config: + + url(r'^secret/$', LimitedTemplateView.as_view( + template_name='secret.html'), name='secret'), + + +### `groove.views.generic.ExtraContextTemplateView` + +Extends TemplateView to accept a dictionary of additional context. + +Example usage in URL config: + + url(r'^foo/$', ExtraContextTemplateView.as_view( + template_name='foo.html', extra_context={'foo': 'bar'})), + +%prep +%autosetup -n django-groove-0.4.6 + +%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-groove -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 31 2023 Python_Bot - 0.4.6-1 +- Package Spec generated -- cgit v1.2.3