def _create_json_file(data_dir, data, model_str):
if len(model_str) > 100:
model_str = model_str[:100]
model_dir = os.path.abspath(os.path.join(data_dir, data['model']))
_ensure_dirs(model_dir)
record_path = os.path.abspath(os.path.join(
model_dir, '%s_%s.json' % (data['id'], model_str)))
with open(record_path, 'w') as f:
json.dump(data, f, indent=4, sort_keys=True)
return [record_path]
评论列表
文章目录