diff --git a/config.json b/config.json new file mode 100644 index 0000000..f3e8841 --- /dev/null +++ b/config.json @@ -0,0 +1,7 @@ +{ + "plugins_ver" : "20", + "libs_ver" : "52", + "used_wine" : "PROTON_LG", + "default_wine" : "WINE_LG_10-1", + "default_proton" : "PROTON_LG_9-19" +} diff --git a/modules/config_parser.py b/modules/config_parser.py new file mode 100644 index 0000000..a44414a --- /dev/null +++ b/modules/config_parser.py @@ -0,0 +1,14 @@ +import json +from .log import * +from .env_var import * + +def var(var_name): + py_work_path = get_env_var("PYTHON_WORK_PATH") + + # Читаем конфигурационный файл + with open(py_work_path + "/config.json", "r") as file: + config = json.load(file) + if config[var_name]: + return config[var_name] + else: + log.critical(f"в config.json нет значения переменной: {var_name}")