unfinished work

This commit is contained in:
2026-05-12 12:54:16 +02:00
parent c5b17bb3f8
commit 07aac3e6b3
3 changed files with 115 additions and 8 deletions

View File

@@ -80,7 +80,7 @@ class APIHandler:
entry_data = response.json()
return entry_data
def download_attachments_data(self, elabid, entryType="experiments"):
def download_all_attachments_data(self, elabid, entryType="experiments"):
"""
Downloads attachments of a certain eLabFTW experiment (default) or item.
Only returns their binary data. Use method download_attachments_to_disk to save to file.
@@ -142,7 +142,7 @@ class APIHandler:
"You can only download attachments from experiments or items."
)
uploads = download_attachments_data(elabid, entryType=entryType)
uploads = download_all_attachments_data(elabid, entryType=entryType)
for file in uploads:
raw_data = uploads["file"]
with open(os.path.join(dump_dir, f"exp{elabid}-{file}"), "wb") as f: