mehrere oft verwendete Routinen in eigene utils.py eingebaut
This commit is contained in:
+2
-10
@@ -10,6 +10,8 @@ from fnmatch import fnmatch
|
||||
import ezdxf
|
||||
from openpyxl import Workbook
|
||||
|
||||
from utils import check_environment_var
|
||||
|
||||
|
||||
"""
|
||||
Dieses Programm:
|
||||
@@ -24,16 +26,6 @@ Dieses Programm:
|
||||
"""
|
||||
|
||||
|
||||
def check_environment_var(env_str: str) -> Path:
|
||||
"""Prüft ob eine Umgebungsvariable gesetzt ist und gibt den Pfad zurück."""
|
||||
out_path = os.environ.get(env_str)
|
||||
if out_path:
|
||||
return Path(out_path)
|
||||
else:
|
||||
print(f"Umgebungsvariable {env_str} ist nicht gesetzt oder leer.")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def load_translation_config(translation_lang: str, translation_dir: Path) -> tuple[dict[str, str], dict[str, str], dict[str, str], dict[str, str]]:
|
||||
"""
|
||||
Lädt eine Übersetzungs-Config-Datei (z.B. CS.cfg, EN.cfg, FR.cfg).
|
||||
|
||||
Reference in New Issue
Block a user