Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions evalai/submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from evalai.utils.requests import make_request
from evalai.utils.submissions import (
display_submission_details,
display_submission_result,
display_submission_with,
convert_bytes_to,
)
from evalai.utils.urls import URLS
Expand Down Expand Up @@ -60,7 +60,8 @@ def result(ctx):
"""
Invoked by `evalai submission SUBMISSION_ID result`.
"""
display_submission_result(ctx.submission_id)
error_message = "\nThe Submission is yet to be evaluated.\n"
display_submission_with(ctx.submission_id, "submission_result_file", error_message)


@click.command()
Expand Down
8 changes: 4 additions & 4 deletions evalai/utils/submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,17 +264,17 @@ def display_submission_details(submission_id):
pretty_print_submission_details(response)


def display_submission_result(submission_id):
def display_submission_with(submission_id, file_name, error_message):
Comment thread
hkmatsumoto marked this conversation as resolved.
Outdated
Comment thread
hkmatsumoto marked this conversation as resolved.
Outdated
"""
Function to display result of a particular submission
Function to display information of a particular submission
"""
try:
response = submission_details_request(submission_id).json()
echo(requests.get(response['submission_result_file']).text)
echo(requests.get(response[file_name]).text)
except requests.exceptions.MissingSchema:
echo(
style(
"\nThe Submission is yet to be evaluated.\n",
error_message,
Comment thread
hkmatsumoto marked this conversation as resolved.
bold=True,
fg="red",
)
Expand Down