Skip to content

Commit f02c287

Browse files
author
Victor
committed
feat: Initialize library for django notifications via graphql subscriptions.
0 parents  commit f02c287

39 files changed

Lines changed: 1132 additions & 0 deletions

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: pip
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "02:00"
8+
open-pull-requests-limit: 10
9+
10+
- package-ecosystem: github-actions
11+
directory: "/"
12+
schedule:
13+
interval: daily
14+
time: "02:00"
15+
open-pull-requests-limit: 10

.github/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- name: Semantic Release
17+
uses: relekang/python-semantic-release@master
18+
with:
19+
github_token: ${{ secrets.GITHUB_TOKEN }}
20+
repository_username: __token__
21+
repository_password: ${{ secrets.PYPI_TOKEN }}

.gitignore

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# Unit test / coverage reports
31+
htmlcov/
32+
.tox/
33+
.nox/
34+
.coverage
35+
.coverage.*
36+
.cache
37+
nosetests.xml
38+
coverage.xml
39+
*.cover
40+
*.py,cover
41+
.hypothesis/
42+
.pytest_cache/
43+
44+
# Translations
45+
*.mo
46+
*.pot
47+
48+
# Django stuff:
49+
*.log
50+
local_settings.py
51+
db.sqlite3
52+
db.sqlite3-journal
53+
54+
# Flask stuff:
55+
instance/
56+
.webassets-cache
57+
58+
# Scrapy stuff:
59+
.scrapy
60+
61+
# Sphinx documentation
62+
docs/_build/
63+
64+
# PyBuilder
65+
target/
66+
67+
# Jupyter Notebook
68+
.ipynb_checkpoints
69+
70+
# IPython
71+
profile_default/
72+
ipython_config.py
73+
74+
# pyenv
75+
.python-version
76+
77+
# pipenv
78+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
79+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
80+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
81+
# install all needed dependencies.
82+
#Pipfile.lock
83+
84+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
85+
__pypackages__/
86+
87+
# Celery stuff
88+
celerybeat-schedule
89+
celerybeat.pid
90+
91+
# SageMath parsed files
92+
*.sage.py
93+
94+
# Environments
95+
.env
96+
.venv
97+
env/
98+
venv/
99+
ENV/
100+
env.bak/
101+
venv.bak/
102+
103+
# Spyder project settings
104+
.spyderproject
105+
.spyproject
106+
107+
# Rope project settings
108+
.ropeproject
109+
110+
# mkdocs documentation
111+
/site
112+
113+
# mypy
114+
.mypy_cache/
115+
.dmypy.json
116+
dmypy.json
117+
118+
# Pyre type checker
119+
.pyre/
120+
121+
122+
.idea/
123+
venv/
124+
125+
poetry.lock

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Development industry
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Devind django app when provides notifications via graphql subscription

devind_notifications/__init__.py

Whitespace-only changes.

devind_notifications/apps.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from django.apps import AppConfig
2+
3+
from devind_helpers.redis_client import redis
4+
5+
6+
class NotificationsConfig(AppConfig):
7+
name = 'devind_notifications'
8+
9+
def ready(self):
10+
redis.delete('listening')

devind_notifications/helpers/__init__.py

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from .email_dispatch import EmailDispatch
2+
from .telegram_dispatch import TelegramDispatch
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from abc import ABC, abstractmethod
2+
3+
from devind_notifications.models import Mailing
4+
5+
6+
class BaseDispatch(ABC):
7+
"""Базовый отправитель оповещений"""
8+
9+
def __init__(self, mailing: Mailing):
10+
self.mailing = mailing
11+
12+
@abstractmethod
13+
def send(self):
14+
"""Отправка оповещения"""
15+
16+
...

0 commit comments

Comments
 (0)