router.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:filestack-cli 作者: filestack 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号