def upload_output(self, input, file):
"""
POST /upload_output
"""
output_id = Database.gen_id()
path = StorageManager.new_output_file(output_id, file["name"])
StorageManager.save_file(path, file["content"])
file_size = StorageManager.get_file_size(path)
try:
result = ContestManager.evaluate_output(input["task"], input["path"], path)
except:
BaseHandler.raise_exc(InternalServerError, "INTERNAL_ERROR", "Failed to evaluate the output")
Database.add_output(output_id, input["id"], path, file_size, result)
Logger.info("UPLOAD", "User %s has uploaded the output %s" % (input["token"], output_id))
return InfoHandler.patch_output(Database.get_output(output_id))
upload_handler.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录