Feature/group based notifications (#918)

* fix group page

* setup group notification for backend

* update type generators

* script to auto-generate schema exports

* setup frontend CRUD interface

* remove old notifications UI

* drop old events api

* add test functionality

* update naming for fields

* add event dispatcher functionality

* bump to python 3.10

* bump python version

* purge old event code

* use-async apprise

* set mealie logo as image

* unify styles for buttons rows

* add links to banners
This commit is contained in:
Hayden 2022-01-09 21:04:24 -09:00 committed by GitHub
parent 50a341ed3f
commit 190773c5d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
74 changed files with 1992 additions and 1229 deletions

View file

@ -1,18 +1,26 @@
from __future__ import annotations
import re
from dataclasses import dataclass
from pathlib import Path
from typing import Tuple
import black
import isort
from jinja2 import Template
def render_python_template(template_file: Path, dest: Path, data: dict) -> str:
def render_python_template(template_file: Path | str, dest: Path, data: dict) -> str:
"""Render and Format a Jinja2 Template for Python Code"""
tplt = Template(template_file.read_text())
if isinstance(template_file, Path):
tplt = Template(template_file.read_text())
else:
tplt = Template(template_file)
text = tplt.render(data=data)
text = black.format_str(text, mode=black.FileMode())
dest.write_text(text)
isort.file(dest)
@dataclass