refactor: Export-Schreibpfad aus dem Controller lösen
Etappe 4 der Controller-Zerlegung. `ExportService` (src/whiteboard/io/export_service.gd) schreibt SVG und PDF, legt den Exportordner an, bildet Pfade und bereinigt Dateinamen. - `export_svg_to_path`/`export_pdf_to_path` delegieren nur noch; sie bleiben als Einstiegspunkte, weil Tests sie direkt aufrufen. - Der Saisonvergleich nutzt denselben Pfadbau statt eigener Zeilen. - Test: Pfadbildung, Namensbereinigung und ein tatsächlich geschriebenes PDF. Bewusst im Controller: Export- und Abschluss-Dialog (Szene), PNG-Export (SubViewport) und "im Dateimanager öffnen". Controller: 8.566 -> 8.529 Zeilen. Kein Verhalten geändert, Suite grün. Nächste Etappe laut Notiz: SeasonPanel.
This commit is contained in:
parent
a3d35076dc
commit
7ee5e36af4
6 changed files with 117 additions and 59 deletions
|
|
@ -106,6 +106,23 @@ func _run() -> void:
|
|||
"the second section excludes the spin of section one"
|
||||
)
|
||||
|
||||
# ExportService: Pfadbildung, Namensbereinigung und Schreiben.
|
||||
_check(
|
||||
ExportService.build_path("kuer", "_gold", "pdf").ends_with("kuer_gold.pdf"),
|
||||
"the export path carries stem, suffix and extension"
|
||||
)
|
||||
_check(
|
||||
ExportService.normalize_stem("Kür 2026/27: Gold?").begins_with("kür_2026"),
|
||||
"the file stem drops forbidden characters"
|
||||
)
|
||||
var service_path := ExportService.build_path("service_test", "", "pdf")
|
||||
_check(ExportService.write_pdf(routine, service_path), "the service writes a PDF")
|
||||
_check(
|
||||
FileAccess.file_exists(service_path),
|
||||
"the written PDF exists"
|
||||
)
|
||||
DirAccess.remove_absolute(service_path)
|
||||
|
||||
var pdf := RoutinePdfExporter.build(routine)
|
||||
var pdf_text := pdf.get_string_from_ascii()
|
||||
_check(pdf.size() > 1000, "PDF export produces data")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue