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

Chiragbaligci patch 4 #190

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
25 changes: 14 additions & 11 deletions evalai/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
from evalai.utils.auth import get_user_auth_token_by_login
from evalai.utils.config import AUTH_TOKEN_PATH, AUTH_TOKEN_DIR

@click.command()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a blank line in between?

@click.group(invoke_without_command=True)
@click.pass_context
def login(ctx):
"""
Login to EvalAI and save token.
"""
username = click.prompt("username", type=str, hide_input=False)
password = click.prompt("Enter password", type=str, hide_input=True)
token = get_user_auth_token_by_login(username, password)

if os.path.exists(AUTH_TOKEN_PATH):
@click.option('--auth')
@click.option('--host')
def main(auth,host):


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra newline

a=click.prompt("AUTHENTICATION TOKEN")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename variable names which are appropriate to the task

h=click.prompt("HOST ID ")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add space before and after =. Also remove trailing spaces in the click.prompt

token = get_user_auth_token_by_login(a, h)

if os.path.exists(AUTH_TOKEN_PATH):
with open(str(AUTH_TOKEN_PATH), "w") as TokenFile:
try:
json.dump(token, TokenFile)
Expand All @@ -33,3 +33,6 @@ def login(ctx):
echo(e)

echo(style("\nLogged in successfully!", bold=True))

if __name__=='__main__':
main()
1 change: 1 addition & 0 deletions evalai/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ def main(ctx):
main.add_command(teams)
main.add_command(get_token)
main.add_command(login)
main.add_command(configure)