mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-14 22:35:17 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user