-
Notifications
You must be signed in to change notification settings - Fork 0
/
manager.py
43 lines (33 loc) · 1.03 KB
/
manager.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import os
import sys
from distutils.dir_util import copy_tree
DESCRIPTION = \
'''
TestsGenerator's manager.
Instruction manual:
python3 create [NAME] Create a task name NAME. (without everything)
python3 create [NAME] -e Create a task named NAME with the generation of examples
python3 create [NAME] -f Create a task named NAME with metadata
python3 create [NAME] -e -f Create a task named NAME with metadata and examples
python3 create [NAME] -q Create a quiz with NAME
'''
args = sys.argv[1:]
if len(args) == 0:
print(DESCRIPTION)
exit()
command = args[0]
args = args[1:]
if command == "create":
dir_name = args[0]
dir_path = f"programms/{dir_name}"
os.mkdir(dir_path)
if "-q" in args:
copy_tree("core/samples_quiz", dir_path)
else:
copy_tree("core/samples/main", dir_path)
if "-e" in args:
copy_tree("core/samples/examples", dir_path, update=1)
if "-f" in args:
copy_tree("core/samples/meta_data", dir_path)
else:
print(DESCRIPTION)