From f1b9d46f8125893e1d8eedf35f7d845e2d4344ca Mon Sep 17 00:00:00 2001 From: Mohammad Sameer Date: Sun, 8 Dec 2019 20:48:15 +0530 Subject: [PATCH] Add pretty format for command 'get_token' --- evalai/get_token.py | 7 +++++-- evalai/variables.py | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 evalai/variables.py diff --git a/evalai/get_token.py b/evalai/get_token.py index b841ea1d6..06f6d3855 100644 --- a/evalai/get_token.py +++ b/evalai/get_token.py @@ -1,11 +1,13 @@ import click import os -from click import echo, style +from click import echo, style, secho from evalai.utils.config import AUTH_TOKEN_PATH import json +from evalai.variables import Colors + @click.group(invoke_without_command=True) def get_token(): @@ -27,6 +29,7 @@ def get_token(): try: data = fr.read() tokendata = json.loads(data) - echo("Current token is {}".format(tokendata["token"])) + echo("Current token is ", nl=False) + secho(format(tokendata["token"]), fg=Colors.token) except (OSError, IOError) as e: echo(e) diff --git a/evalai/variables.py b/evalai/variables.py new file mode 100644 index 000000000..f8e04b9a4 --- /dev/null +++ b/evalai/variables.py @@ -0,0 +1,3 @@ +class Colors: + links = 'blue' + token = 'green' \ No newline at end of file