tier.py 文件源码

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

项目:drift 作者: dgnorth 项目源码 文件源码
def list_command(args):
    tiers_config = get_tiers_config()
    conn = connect_to_region(tiers_config["region"], calling_format=OrdinaryCallingFormat())
    bucket_name = "{}.{}".format(tiers_config["bucket"], tiers_config["domain"])
    print "List of all tiers registered at http://{}/{}".format(bucket_name, "tiers")
    bucket = conn.get_bucket(bucket_name)
    for file_key in bucket.list("tiers/", "/"):
        head, tail = os.path.split(file_key.name)
        root, ext = os.path.splitext(tail)
        if ext == ".json":
            if args.verbose:
                print bcolors.BOLD + "Tier: " + root + bcolors.ENDC
                json_text = file_key.get_contents_as_string()
                print json_text
            else:
                print "   ", root
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号