Commit f2cd371a authored by Nik Khlestov's avatar Nik Khlestov

Updated structure of project list output, added logout option.

parent 1d8f8a07
## Install
`pip install git+`
\ No newline at end of file
`pip install git+`
## Usage
See `uptr --help`.
\ No newline at end of file
......@@ -7,6 +7,7 @@ from .main import settings, session, PROJECT_CONFIG_FILE
def project():
"""Create, list, pin projects."""
if settings.token is None:
ctx = click.get_current_context()'No authorization token provided.')
......@@ -39,7 +40,8 @@ def list():
resp = session.get(url).json()
notification_message = []
for p in resp:
is_pinned_mark = 'PINNED' if int(p['id']) == settings.project_id else ''
'%s\t%s\t%s' % (p['name'], p['id'], int(p['id']) == settings.project_id)
'%s\t%s\t%s' % (p['name'], p['id'], is_pinned_mark)
\ No newline at end of file
......@@ -67,3 +67,12 @@ def login(email, password):
# Notification for user
def logout():
with open(USER_CONFIG_FILE, 'r') as ifile:
conf = yaml.load( or {}
conf['token'] = None
with open(USER_CONFIG_FILE, 'w') as ofile:
yaml.dump(conf, ofile)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment