config.py 文件源码

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

项目:fleece 作者: racker 项目源码 文件源码
def import_config(args, input_file=None):
    if not input_file:
        input_file = sys.stdin
    source = input_file.read().strip()
    if source[0] == '{':
        # JSON input
        config = json.loads(source)
    else:
        # YAML input
        config = yaml.round_trip_load(source)

    STATE['stages'] = config['stages']
    config['config'] = _encrypt_dict(config['config'])
    with open(args.config, 'wt') as f:
        if config:
            yaml.round_trip_dump(config, f)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号