Skip to content

Commit

Permalink
Send filename to minio on submission
Browse files Browse the repository at this point in the history
  • Loading branch information
jedinym committed Apr 14, 2024
1 parent 27febb8 commit bd8a168
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "sqclib"
version = "0.2.3"
version = "0.2.4"
description = "Library for interacting with the Structure Quality Check server"
authors = [
{name = "Martin Jediny", email = "[email protected]"},
Expand Down
1 change: 1 addition & 0 deletions sqclib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""
Module root for sqclib
"""

from sqclib.client import SQCException, SQCClient
7 changes: 6 additions & 1 deletion sqclib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This module contains the client used for communicating with the SQC validation
server.
"""

from pathlib import Path
from tempfile import mkstemp
import os
Expand Down Expand Up @@ -80,6 +81,7 @@ def submit(self, path: str | Path) -> str:
"""
request_id = str(uuid4())
ftype = str(path).split(".")[-1]
filename = os.path.basename(path)
if ftype not in {"mmcif", "cif", "ent", "pdb"}:
raise SQCException("The file type extension is not valid")

Expand All @@ -90,7 +92,10 @@ def submit(self, path: str | Path) -> str:

try:
self._minio.fput_object(
request_bucket, request_id, str(path), metadata={"ftype": ftype}
request_bucket,
request_id,
str(path),
metadata={"ftype": ftype, "filename": filename},
)

except S3Error as err:
Expand Down

0 comments on commit bd8a168

Please sign in to comment.