def list_apps(ctx):
environment = ctx.parent.params['environment']
config_parser = configparser.ConfigParser()
config_parser.read(CONFIG_PATH)
if sys.version_info[0] < 3 and environment.lower() == 'default':
environment = configparser.DEFAULTSECT
client_id = config_parser.get(environment, 'client_id')
client_secret = config_parser.get(environment, 'client_secret')
response = management_utils.list_apps((client_id, client_secret))
if response.ok:
app_data = response.json()
else:
click.echo(response.text)
printer = pprint.PrettyPrinter(indent=4)
printer.pprint(app_data)
评论列表
文章目录