-
Notifications
You must be signed in to change notification settings - Fork 2
/
start_up.py
36 lines (30 loc) · 1.19 KB
/
start_up.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
import os
import pip
import config as cfg
cfg._init()
import utils.log as log
log._init()
cfg.load_config()
external_module_folder = cfg.get_value("EXTERNAL_MODULE_FOLDER","")
# Create external folder
if external_module_folder != "":
print("Creating external folder...")
if not os.path.exists(external_module_folder):
os.mkdir(external_module_folder)
if not os.path.exists(external_module_folder+"/source"):
os.mkdir(external_module_folder+"/source")
if not os.path.exists(external_module_folder+"/data"):
os.mkdir(external_module_folder+"/data")
if not os.path.exists(external_module_folder+"/renderer"):
os.mkdir(external_module_folder+"/renderer")
if not os.path.exists(external_module_folder+"/push"):
os.mkdir(external_module_folder+"/push")
# Install external packages
if os.path.exists(external_module_folder+"/requirements.txt"):
print("Installing external packages...")
pip.main(["install","-r",external_module_folder+"/requirements.txt"])
# Create task config file
test_config_file = cfg.get_value("TASK_FILE", "tasks.json")
if not os.path.exists(test_config_file):
with open(test_config_file,"w") as f:
f.write("[]")