Der Projekt-Baum wird beim Öffnen des Projektes gefüllt

This commit is contained in:
2025-07-27 18:33:14 +02:00
parent f2c1e3d6b0
commit d91c19fe8c
2 changed files with 104 additions and 3 deletions
+10 -1
View File
@@ -194,7 +194,16 @@ class PdfProjectSettings(BaseModel):
@classmethod
def readSettings(cls, project_dir: Path):
return parse_yaml_file_as(PdfProjectSettings, project_dir / "project.yaml")
# Explizit UTF-8 Encoding verwenden
project_yaml_path = project_dir / "project.yaml"
with open(project_yaml_path, 'r', encoding='utf-8') as f:
from ruamel.yaml import YAML
yaml = YAML(typ='safe')
yaml_data = yaml.load(f)
return cls.model_validate(yaml_data)
# yaml_content = f.read()
# Parse mit pydantic-yaml
def writeSettings(self, project_dir: Path):
with open(project_dir / "project.yaml", "w", encoding="utf8") as f: