Skip to content

Commit

Permalink
Fix glob issue
Browse files Browse the repository at this point in the history
  • Loading branch information
agahkarakuzu committed Oct 9, 2023
1 parent 0086821 commit afb3a8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion api/neurolibre_celery_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,7 @@ def zenodo_publish_task(self, payload):
gh_template_respond(github_client,"started",payload['task_title'], payload['review_repository'],payload['issue_id'],task_id,payload['comment_id'])

response = zenodo_publish(payload['issue_id'])

if response == "no-record-found":
msg = "<br> :neutral_face: I could not find any Zenodo-related records on NeuroLibre servers. Maybe start with <code>roboneuro zenodo create buckets</code>?"
gh_template_respond(github_client,"failure",payload['task_title'], payload['review_repository'],payload['issue_id'],task_id,payload['comment_id'], msg)
Expand All @@ -816,7 +817,7 @@ def zenodo_publish_task(self, payload):
publish_status = zenodo_confirm_status(payload['issue_id'],"published")
# If all items are published, success. Add DOIs.
if publish_status[0]:
prompt = "First state that you will issue commands to set DOIs for the reproducibility assets, then you'll talk to yourself a bit. But reassure in a funny way that there's nothing to worry about because you are not an artificial general intelligence (yet)."
prompt = "First state that you will issue commands to set DOIs for the reproducibility assets, then you'll talk to yourself a bit. But reassure in a funny way that there's nothing to worry about because you are not an artificial general intelligence (yet). Keep it to a few sentences."
gpt_response = get_gpt_response(prompt)
gh_template_respond(github_client,"success",payload['task_title'], payload['review_repository'],payload['issue_id'],task_id,payload['comment_id'], f"Congrats! Reproducibility assets have been successfully archived and published :rocket: \n\n {gpt_response}", False)
# Set DOIs. This part is a little crazy, because roboneuro will be
Expand Down
2 changes: 1 addition & 1 deletion api/preprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def zenodo_collect_dois(issue_id):
collect = {}
for item in zenodo_record.keys():
tmp = glob.glob(os.path.join(get_deposit_dir(issue_id),f"zenodo_published_{item}_NeuroLibre_{issue_id:05d}_*.json"))
with open(tmp, 'r') as f:
with open(tmp[0], 'r') as f:
tmp_record = json.load(f)
collect[item] = tmp_record['doi_url']
return collect
Expand Down

0 comments on commit afb3a8c

Please sign in to comment.