From 6e0edaefee05691ef079885af169a49fa50f211e Mon Sep 17 00:00:00 2001 From: Jacob Lambert Date: Mon, 23 Mar 2020 14:58:01 -0400 Subject: [PATCH] Fix token command (#24) --- bond/commands/token.py | 8 ++++---- setup.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bond/commands/token.py b/bond/commands/token.py index 9835135..0c228db 100644 --- a/bond/commands/token.py +++ b/bond/commands/token.py @@ -8,18 +8,18 @@ def update_token(token): bonds = BondDatabase.get_bonds() if bondid not in bonds.keys(): bonds[bondid] = dict() - bonds[bondid]["token"] = token - print(f"Updated token for {bondid}") + bonds.get(bondid, {})["token"] = token + print("Updated token for %s" % bondid) BondDatabase.set("bonds", bonds) class TokenCommand(BaseCommand): subcmd = "token" help = "Manage token-based authentication." - arguments = {"TOKEN": {"help": "Save Bond token to local database"}} + arguments = {"token": {"help": "Save Bond token to local database"}} def run(self, args): - update_token(args["Token"]) + update_token(args.token) def register(): diff --git a/setup.py b/setup.py index bd2054a..c2733da 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='bond-cli', - version='0.0.6', + version='0.0.7', author='Olibra', packages=find_packages(), scripts=['bond/bond'],