From 40e2831cb8f62895fc53e3d5a9944a825d32aa06 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Tue, 20 Jun 2023 04:55:07 +0000 Subject: automatic import of python-djangopubsub --- .gitignore | 1 + python-djangopubsub.spec | 234 +++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 236 insertions(+) create mode 100644 python-djangopubsub.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..ec403f9 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/djangopubsub-0.3.5.tar.gz diff --git a/python-djangopubsub.spec b/python-djangopubsub.spec new file mode 100644 index 0000000..84c03ff --- /dev/null +++ b/python-djangopubsub.spec @@ -0,0 +1,234 @@ +%global _empty_manifest_terminate_build 0 +Name: python-djangopubsub +Version: 0.3.5 +Release: 1 +Summary: Base redis pubsub django wrapper +License: COPYRIGHT +URL: https://gitlab.com/kas-factory/packages/django-pubsub +Source0: https://mirrors.aliyun.com/pypi/web/packages/81/71/c61bf2053ead2cdf2920dab47bf078d21e625a79293b74567293b100771c/djangopubsub-0.3.5.tar.gz +BuildArch: noarch + + +%description +# Django pubsub + +Django Pubsub wrapper. + + +## Installation with requirements.txt +``` +djangopubsub +``` + +### With PIP + +```bash +$ pip install djangopubsub +``` + +## Add app to django settings +``` +INSTALLED_APPS = ( + ..., + 'djangopubsub' +) +``` + +## Available settings and defaults: +```python +BASE_DIR = '' # Root directory for handlers lookup +EVENT_HANDLERS_DIR_NAME = 'event_handlers' # Directory with handlers on every app module +HANDLER_FILES_PREFIX = 'handlers_' # handlers file prefix +REDIS_HOST = 'localhost' +REDIS_PORT = 6379 +PUB_SUB_EMIT = True # Avoid to emit message when emit is called (for tests) +``` + +## Decorator +```python +@on_event('EVENT_NAME') +def func_to_execute(data): + pass +``` + +## Pubsub emit +```python +from djangopubsub.djangoPubSub import DjangoPubSub +DjangoPubSub().emit('EVENT_NAME', {}) +``` + +## Pubsub receiver +Needs redis running on port:REDIS_PORT +```commandline +python manage.py runpubsubreceiver --settings=your_proyect.settings +``` + + + + +%package -n python3-djangopubsub +Summary: Base redis pubsub django wrapper +Provides: python-djangopubsub +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-djangopubsub +# Django pubsub + +Django Pubsub wrapper. + + +## Installation with requirements.txt +``` +djangopubsub +``` + +### With PIP + +```bash +$ pip install djangopubsub +``` + +## Add app to django settings +``` +INSTALLED_APPS = ( + ..., + 'djangopubsub' +) +``` + +## Available settings and defaults: +```python +BASE_DIR = '' # Root directory for handlers lookup +EVENT_HANDLERS_DIR_NAME = 'event_handlers' # Directory with handlers on every app module +HANDLER_FILES_PREFIX = 'handlers_' # handlers file prefix +REDIS_HOST = 'localhost' +REDIS_PORT = 6379 +PUB_SUB_EMIT = True # Avoid to emit message when emit is called (for tests) +``` + +## Decorator +```python +@on_event('EVENT_NAME') +def func_to_execute(data): + pass +``` + +## Pubsub emit +```python +from djangopubsub.djangoPubSub import DjangoPubSub +DjangoPubSub().emit('EVENT_NAME', {}) +``` + +## Pubsub receiver +Needs redis running on port:REDIS_PORT +```commandline +python manage.py runpubsubreceiver --settings=your_proyect.settings +``` + + + + +%package help +Summary: Development documents and examples for djangopubsub +Provides: python3-djangopubsub-doc +%description help +# Django pubsub + +Django Pubsub wrapper. + + +## Installation with requirements.txt +``` +djangopubsub +``` + +### With PIP + +```bash +$ pip install djangopubsub +``` + +## Add app to django settings +``` +INSTALLED_APPS = ( + ..., + 'djangopubsub' +) +``` + +## Available settings and defaults: +```python +BASE_DIR = '' # Root directory for handlers lookup +EVENT_HANDLERS_DIR_NAME = 'event_handlers' # Directory with handlers on every app module +HANDLER_FILES_PREFIX = 'handlers_' # handlers file prefix +REDIS_HOST = 'localhost' +REDIS_PORT = 6379 +PUB_SUB_EMIT = True # Avoid to emit message when emit is called (for tests) +``` + +## Decorator +```python +@on_event('EVENT_NAME') +def func_to_execute(data): + pass +``` + +## Pubsub emit +```python +from djangopubsub.djangoPubSub import DjangoPubSub +DjangoPubSub().emit('EVENT_NAME', {}) +``` + +## Pubsub receiver +Needs redis running on port:REDIS_PORT +```commandline +python manage.py runpubsubreceiver --settings=your_proyect.settings +``` + + + + +%prep +%autosetup -n djangopubsub-0.3.5 + +%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-djangopubsub -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Jun 20 2023 Python_Bot - 0.3.5-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..f52e497 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +962e99d9950417db67918e594aca5188 djangopubsub-0.3.5.tar.gz -- cgit v1.2.3