Remove capture path prefix from ZIP files
This commit is contained in:
parent
2a8314f3a8
commit
1ee1b807d3
1 changed files with 5 additions and 2 deletions
|
|
@ -115,8 +115,11 @@ class ZipBuilderPlugin(MicroscopePlugin):
|
|||
with zipfile.ZipFile(fp, "w") as zipObj:
|
||||
for index, capture_obj in enumerate(capture_list):
|
||||
# Add to ZIP file if it exists
|
||||
filePath = capture_obj.file
|
||||
zipObj.write(filePath)
|
||||
file_path = capture_obj.file
|
||||
rel_path = os.path.relpath(
|
||||
file_path, self.microscope.camera.paths["default"]
|
||||
)
|
||||
zipObj.write(file_path, arcname=rel_path)
|
||||
# Update task progress
|
||||
update_task_progress(int((index / n_files) * 100))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue