mirror of
https://github.com/hay-kot/mealie.git
synced 2025-07-06 13:02:27 -07:00
lang: options updates + gen utils cleanup (#1520)
* generate new langs * add to nuxt * cleanup generator code * additional cleanups
This commit is contained in:
parent
5fca94dd45
commit
6649ccf224
8 changed files with 119 additions and 94 deletions
|
@ -1,3 +1,4 @@
|
|||
import logging
|
||||
import re
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
@ -5,9 +6,15 @@ from pathlib import Path
|
|||
import black
|
||||
import isort
|
||||
from jinja2 import Template
|
||||
from rich.logging import RichHandler
|
||||
|
||||
FORMAT = "%(message)s"
|
||||
logging.basicConfig(level=logging.INFO, format=FORMAT, datefmt="[%X]", handlers=[RichHandler()])
|
||||
|
||||
log = logging.getLogger("rich")
|
||||
|
||||
|
||||
def render_python_template(template_file: Path | str, dest: Path, data: dict) -> str:
|
||||
def render_python_template(template_file: Path | str, dest: Path, data: dict):
|
||||
"""Render and Format a Jinja2 Template for Python Code"""
|
||||
if isinstance(template_file, Path):
|
||||
tplt = Template(template_file.read_text())
|
||||
|
@ -37,7 +44,6 @@ class CodeSlicer:
|
|||
|
||||
def push_line(self, string: str) -> None:
|
||||
self._next_line = self._next_line or self.start + 1
|
||||
print(self.indentation)
|
||||
self.text.insert(self._next_line, self.indentation + string + "\n")
|
||||
self._next_line += 1
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue