From f11b5985d3fd9c016a705cdf65fcda8855db1eb2 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Thu, 21 Dec 2017 23:34:27 -0500 Subject: [PATCH] Choose segments with import.py --- import.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/import.py b/import.py index 5819462..683ef03 100644 --- a/import.py +++ b/import.py @@ -1,9 +1,16 @@ +""" +python import.py export.zip challenges,teams,both,metadata +""" from CTFd import create_app from CTFd.utils import import_ctf -import zipfile import sys app = create_app() with app.app_context(): - import_ctf(sys.argv[1]) + if sys.argv[2]: + segments = sys.argv[2].split(',') + else: + segments = None + + import_ctf(sys.argv[1], segments=segments)