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)
评论列表
文章目录