- def __init__(self, account, token, output):
+ @staticmethod
+ def get_account(token):
+ """Return the account corresponding to this token"""
+ config = Config()
+ astakos = AstakosClient(config.get('user', 'url'), token)
+ try:
+ account = astakos.info()
+ except ClientError as e:
+ if e.status == 401: # Unauthorized: invalid token
+ return None
+ else:
+ raise
+ return account
+
+ def __init__(self, account, output):
+ """Create a Kamaki instance"""