artemis-portable/scripts/update_artemis_config.py

23 lines
640 B
Python
Raw Normal View History

2023-11-29 02:09:12 +00:00
# This should be run with ARTEMiS's venv instead of the system Python
import os
import sys
import yaml
core_config_path = os.path.join(os.getcwd(), sys.argv[1])
mariadb_password = sys.argv[2]
mariadb_port = int(sys.argv[3])
with open(core_config_path) as f:
config = yaml.safe_load(f)
config["server"]["listen_address"] = "0.0.0.0"
config["server"]["is_develop"] = False
config["server"]["threading"] = True
config["database"]["password"] = mariadb_password
config["database"]["port"] = mariadb_port
config["aimedb"]["key"] = "Copyright(C)SEGA"
with open(core_config_path, "w") as f:
yaml.safe_dump(config, f, sort_keys=False)