-
Notifications
You must be signed in to change notification settings - Fork 10
/
make_app.py
39 lines (33 loc) · 1.96 KB
/
make_app.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
# -*- coding: utf-8 -*-
import argparse
import os
import subprocess
import sys
import lib.io_utils as io
import lib.item_utils as tu
# input
parser = argparse.ArgumentParser()
parser.add_argument("-config", dest="CONFIG_FILE", default="config-sample.yml", help="Config file")
parser.add_argument("-python", dest="PYTHON_NAME", default="", help="Name of your python command (e.g. python, python3, etc)")
parser.add_argument('-clean', dest="CLEAN", action="store_true", help="Start from scratch if app already exists?")
parser.add_argument('-probe', dest="PROBE", action="store_true", help="Just print commands?")
a = parser.parse_args()
PYTHON_NAME = a.PYTHON_NAME if len(a.PYTHON_NAME) > 0 else sys.executable
config = tu.loadConfig(a.CONFIG_FILE)
overwriteFlag = ' -overwrite' if a.CLEAN else ''
commands = [
'{python_name} scaffold.py -config "{config_file}"{overwrite}'.format(python_name=PYTHON_NAME, config_file=a.CONFIG_FILE, overwrite=overwriteFlag),
'{python_name} prepare_metadata.py -config "{config_file}"'.format(python_name=PYTHON_NAME, config_file=a.CONFIG_FILE),
'{python_name} prepare_sets.py -config "{config_file}"'.format(python_name=PYTHON_NAME, config_file=a.CONFIG_FILE),
'{python_name} prepare_positions.py -config "{config_file}"'.format(python_name=PYTHON_NAME, config_file=a.CONFIG_FILE),
'{python_name} prepare_textures.py -config "{config_file}"'.format(python_name=PYTHON_NAME, config_file=a.CONFIG_FILE),
'{python_name} prepare_labels.py -config "{config_file}"'.format(python_name=PYTHON_NAME, config_file=a.CONFIG_FILE),
# '{python_name} prepare_sounds.py -config "{config_file}"'.format(python_name=PYTHON_NAME, config_file=a.CONFIG_FILE),
'{python_name} prepare_content.py -config "{config_file}"'.format(python_name=PYTHON_NAME, config_file=a.CONFIG_FILE)
]
for command in commands:
print('-------------------------------')
print(command)
if a.PROBE:
continue
finished = subprocess.check_call(command, shell=True)