Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #264: Use of get_host_url() method to remove unnecessary code #317

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all 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
17 changes: 6 additions & 11 deletions evalai/set_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from click import echo, style

from evalai.utils.config import AUTH_TOKEN_DIR, HOST_URL_FILE_PATH
from evalai.utils.auth import get_host_url


@click.group(invoke_without_command=True)
Expand Down Expand Up @@ -48,14 +49,8 @@ def host(set_host):
)
)
else:
with open(HOST_URL_FILE_PATH, "r") as fr:
try:
data = fr.read()
echo(
style(
"{} is the Host URL of EvalAI.".format(data),
bold=True,
)
)
except (OSError, IOError) as e:
echo(e)
echo(
style(
"{} is the Host URL of EvalAI.".format(get_host_url())
)
)