1 Star 0 Fork 1

孤木成林/H1ve

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
export.py 654 Bytes
一键复制 编辑 原始数据 按行查看 历史
0akarma 提交于 2019-12-01 21:56 . v1.0.0-dev First commit test
from CTFd import create_app
from CTFd.utils import config
from CTFd.utils.exports import export_ctf
import datetime
import sys
import shutil
app = create_app()
with app.app_context():
backup = export_ctf()
if len(sys.argv) > 1:
with open(sys.argv[1], 'wb') as target:
shutil.copyfileobj(backup, target)
else:
ctf_name = config.ctf_name()
day = datetime.datetime.now().strftime("%Y-%m-%d")
full_name = "{}.{}.zip".format(ctf_name, day)
with open(full_name, 'wb') as target:
shutil.copyfileobj(backup, target)
print("Exported {filename}".format(filename=full_name))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/songjialin1221/H1ve.git
git@gitee.com:songjialin1221/H1ve.git
songjialin1221
H1ve
H1ve
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385