-
Notifications
You must be signed in to change notification settings - Fork 63
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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() | ||
|
||
@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): | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove extra newline |
||
a=click.prompt("AUTHENTICATION TOKEN") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 ") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add space before and after |
||
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) | ||
|
@@ -33,3 +33,6 @@ def login(ctx): | |
echo(e) | ||
|
||
echo(style("\nLogged in successfully!", bold=True)) | ||
|
||
if __name__=='__main__': | ||
main() |
There was a problem hiding this comment.
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?