CTFd/import.py

17 lines
336 B
Python
Raw Normal View History

2017-12-22 04:34:27 +00:00
"""
python import.py export.zip challenges,teams,both,metadata
"""
2017-04-27 02:46:06 +00:00
from CTFd import create_app
from CTFd.utils import import_ctf
import sys
app = create_app()
with app.app_context():
if len(sys.argv) == 2:
2017-12-22 04:34:27 +00:00
segments = sys.argv[2].split(',')
else:
segments = None
import_ctf(sys.argv[1], segments=segments)