Der Projekt-Baum wird beim Öffnen des Projektes gefüllt
This commit is contained in:
+10
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user