Skip to content

Commit b5f9c0e

Browse files
committed
adapt push function to list of ArtifactInfos
1 parent 0d6a453 commit b5f9c0e

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

qiita_client/plugin.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from future import standard_library
1616
from json import dumps
1717
import urllib
18-
from qiita_client import QiitaClient
18+
from qiita_client import QiitaClient, ArtifactInfo
1919

2020
import logging
2121

@@ -118,22 +118,13 @@ def _push_artifacts_files_to_central(qclient, artifacts):
118118
return artifacts
119119

120120
for artifact in artifacts:
121-
if artifact is not None:
122-
if 'files' in artifact.keys():
123-
artifact['files'] = {
124-
filetype: [
125-
{
126-
k: qclient.push_file_to_central(v)
127-
if k == 'filepath' else v
128-
for k, v
129-
in file.items()}
130-
for file
131-
in artifact['files'][filetype]]
132-
for filetype
133-
in artifact['files'].keys()
134-
}
135-
136-
return artifacts
121+
if isinstance(artifact, ArtifactInfo):
122+
for i in range(len(artifact.files)):
123+
(fp, ftype) = artifact.files[i]
124+
# send file to Qiita central and potentially update
125+
# filepath, which is not done at the moment (2025-11-14)
126+
fp = qclient.push_file_to_central(fp)
127+
artifact.files[i] = (fp, ftype)
137128

138129
def __call__(self, qclient, server_url, job_id, output_dir):
139130
logger.debug('Entered QiitaCommand.__call__()')

0 commit comments

Comments
 (0)