Kleine Anpassungen
This commit is contained in:
+4
-4
@@ -3,7 +3,8 @@ from pathlib import Path
|
||||
from sys import platform
|
||||
from typing import Tuple, Type
|
||||
from pydantic import Field
|
||||
from pydantic_yaml import to_yaml_str, parse_yaml_file_as
|
||||
from pydantic_yaml import to_yaml_str
|
||||
from ruamel.yaml import YAML
|
||||
from enum import Enum
|
||||
import logging
|
||||
|
||||
@@ -166,7 +167,7 @@ class AppSettings(BaseSettings):
|
||||
app_settings = AppSettings()
|
||||
|
||||
|
||||
class Xml(BaseModel):
|
||||
class XmlFile(BaseModel):
|
||||
xml: Path
|
||||
|
||||
|
||||
@@ -175,7 +176,7 @@ class XslFile(BaseModel):
|
||||
bez: str
|
||||
xsl_file: Path
|
||||
xslt_params: dict[str, str] = {}
|
||||
xmls: list[Xml] = []
|
||||
xmls: list[XmlFile] = []
|
||||
|
||||
|
||||
class TreeNode(BaseModel):
|
||||
@@ -197,7 +198,6 @@ class PdfProjectSettings(BaseModel):
|
||||
# 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)
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
from conf import TreeNode, XslFile, PdfProjectSettings, Xml
|
||||
from conf import TreeNode, XslFile, PdfProjectSettings, XmlFile
|
||||
from pathlib import Path
|
||||
|
||||
from pydantic_yaml import to_yaml_str, parse_yaml_file_as
|
||||
@@ -36,7 +36,7 @@ for r1 in ebene_1.rows(named=True):
|
||||
id=(r3["reporttyp"], r3["report"], r3["repfile"]),
|
||||
bez=r3["repfile_bez"],
|
||||
xsl_file=Path(r3["xsl_datei"]),
|
||||
xmls=[Xml(xml=Path("test.xml"))],
|
||||
xmls=[XmlFile(xml=Path("test.xml"))],
|
||||
)
|
||||
|
||||
tn_2.children.append(x)
|
||||
|
||||
Reference in New Issue
Block a user