FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 699e0be4 authored by J.W. Smith's avatar J.W. Smith
Browse files

fix: Zip multiple files in MetResample

parent 99b1faf3
No related branches found
No related tags found
No related merge requests found
......@@ -296,14 +296,17 @@ class ProcessorMetResample(Processor):
files_to_zip = origins + paths_out
zip_path = f"data_met_prep_{config['StartString']}.zip"
archive_dir = os.path.basename(files_to_zip[0])
with ZipFile(zip_path, 'w') as zipf:
zipf.write(
files_to_zip,
arcname=archive_dir,
compress_type=ZIP_DEFLATED)
for file_to_zip in files_to_zip:
filename_in_archive = os.path.basename(file_to_zip)
zipf.write(
file_to_zip,
arcname=filename_in_archive,
compress_type=ZIP_DEFLATED)
# 1H met files to upload
proc_out['output'] += [zip_path]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment