feat(validation): complete validation editor and master data modules
This commit is contained in:
parent
2b5c765e41
commit
f73a24df13
73 changed files with 10194 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from weasyprint import HTML
|
||||
|
||||
|
||||
class OrionReportService:
|
||||
chapters = [
|
||||
"Deckblatt",
|
||||
"Inhaltsverzeichnis",
|
||||
"Zusammenfassung",
|
||||
"Gerät",
|
||||
"Kunde",
|
||||
"Normen",
|
||||
"Prüfmittel",
|
||||
"Programme",
|
||||
"Beladung",
|
||||
"Messungen",
|
||||
"Diagramme",
|
||||
"Empfehlungen",
|
||||
"Anlagen",
|
||||
]
|
||||
|
||||
def render_pdf(self, title: str, output_path: Path) -> Path:
|
||||
chapter_markup = "".join(f"<section><h2>{chapter}</h2></section>" for chapter in self.chapters)
|
||||
html = f"<html><body><h1>{title}</h1>{chapter_markup}</body></html>"
|
||||
HTML(string=html).write_pdf(output_path)
|
||||
return output_path
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue