Files
xsl-validator/src/config.py
T

68 lines
1.3 KiB
Python
Raw Normal View History

from pathlib import Path
from pydantic import BaseModel
from pydantic_settings import BaseSettings # , SettingsConfigDict
class JavaVm(BaseModel):
2025-06-09 19:50:17 +02:00
id: int
2025-06-06 20:18:29 +02:00
version: str
path_to_binary_file: Path
class DiffPdf(BaseModel):
2025-06-09 19:50:17 +02:00
id: int
2025-06-06 20:18:29 +02:00
version: str
path_to_binary_file: Path
default_params: list[str]
2025-06-06 20:18:29 +02:00
output_file_extension: str = "pdf"
class SaxonJar(BaseModel):
2025-06-09 19:50:17 +02:00
id: int
2025-06-06 20:18:29 +02:00
version: str
path_to_jar_file: Path
2025-06-06 20:18:29 +02:00
output_file_extension: str = "fo"
class ApacheFop(BaseModel):
2025-06-09 19:50:17 +02:00
id: int
2025-06-06 20:18:29 +02:00
version: str
path_to_dir: Path
2025-06-06 20:18:29 +02:00
output_file_extension: str = "pdf"
class XslDir(BaseModel):
2025-06-09 19:50:17 +02:00
id: int
2025-06-06 20:18:29 +02:00
name: str
path_to_root_dir: Path
2025-06-06 20:32:23 +02:00
2025-06-06 20:18:29 +02:00
class PdfProject(BaseModel):
2025-06-09 19:50:17 +02:00
id: int
name: str
project_dir: Path
2025-06-09 19:50:17 +02:00
java_id: int
diff_pdf_id: int
saxon_jar_id: int
apache_fop_id: int
xsl_dir_id: int
2025-06-06 20:18:29 +02:00
default_xslt_params: dict[str, str] = {}
class AppSettings(BaseSettings):
java_vms: list[JavaVm]
diff_pdfs: list[DiffPdf]
saxon_jars: list[SaxonJar]
apache_fops: list[ApacheFop]
2025-06-09 19:50:17 +02:00
xsl_dirs: list[XslDir]
2025-06-06 20:18:29 +02:00
pdf_projects: list[PdfProject] = []
2025-06-06 20:32:23 +02:00
2025-06-06 20:18:29 +02:00
class PdfProjectSettings(BaseSettings):
"""
2025-06-06 20:32:23 +02:00
Speichert Projekt-Einstellungen direkt im Ordner des Projekts in einer Klartextdatei (JSON, YAML oder XML)
2025-06-06 20:18:29 +02:00
"""
2025-06-06 20:32:23 +02:00
2025-06-06 20:18:29 +02:00
pass