From f0b748ebb1301285c91dd727f2f739b8f0e06b9f Mon Sep 17 00:00:00 2001 From: Aron Widforss Date: Fri, 25 Apr 2025 13:57:07 +0200 Subject: [PATCH] Fix zip_shape() zip-file structure Har ikke testet dette i denne koden, men dette var hvordan jeg fiksa de andre filene. --- src/temporal/t.avalanche.stats/t.avalanche.stats.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/temporal/t.avalanche.stats/t.avalanche.stats.py b/src/temporal/t.avalanche.stats/t.avalanche.stats.py index fe2bb1d..6961cac 100644 --- a/src/temporal/t.avalanche.stats/t.avalanche.stats.py +++ b/src/temporal/t.avalanche.stats/t.avalanche.stats.py @@ -63,6 +63,7 @@ import atexit import sys +import os from pathlib import Path from subprocess import PIPE from zipfile import ZipFile @@ -101,7 +102,7 @@ def zip_shape(shape_file): # Write to zip-file with ZipFile(str(directory / f"{base_name}.zip"), "w") as zf: for shape_file_part in shape_file_parts: - zf.write(shape_file_part) + zf.write(shape_file_part, os.path.basename(shape_file_part)) shape_file_part.unlink()