2024-04-29 13:45:10 +01:00
|
|
|
import yaml
|
|
|
|
|
|
2024-04-30 19:36:22 +01:00
|
|
|
from primaite import PRIMAITE_CONFIG, PRIMAITE_PATHS
|
2024-04-29 13:45:10 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_dev_mode() -> bool:
|
|
|
|
|
"""Returns True if PrimAITE is currently running in developer mode."""
|
2024-04-30 19:36:22 +01:00
|
|
|
return (
|
|
|
|
|
PRIMAITE_CONFIG["developer_mode"]["enabled"]
|
|
|
|
|
if (PRIMAITE_CONFIG.get("developer_mode", {}).get("enabled"))
|
|
|
|
|
else False
|
|
|
|
|
)
|
2024-04-29 13:45:10 +01:00
|
|
|
|
|
|
|
|
|
2024-04-30 19:36:22 +01:00
|
|
|
def update_primaite_application_config() -> None:
|
2024-04-29 13:45:10 +01:00
|
|
|
"""Update the PrimAITE application config file."""
|
|
|
|
|
with open(PRIMAITE_PATHS.app_config_file_path, "w") as file:
|
2024-04-30 19:36:22 +01:00
|
|
|
yaml.dump(PRIMAITE_CONFIG, file)
|