Skip to content

Commit

Permalink
Add pretty format for command 'get_token'
Browse files Browse the repository at this point in the history
  • Loading branch information
m-sameer committed Dec 18, 2019
1 parent a658e23 commit f1b9d46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions evalai/get_token.py
Original file line number Diff line number Diff line change
@@ -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():
Expand All @@ -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)
3 changes: 3 additions & 0 deletions evalai/variables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Colors:
links = 'blue'
token = 'green'

0 comments on commit f1b9d46

Please sign in to comment.