1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-14 16:49:26 +08:00
Files
Alas/module/webui/setting.py
18870 9c7f21b2ac Opt: Replace uvicorn reloader with custom one
Fix: "True" in logs doesn't highlights properly
2022-06-03 16:00:33 +08:00

34 lines
713 B
Python

import multiprocessing
import threading
from multiprocessing.managers import SyncManager
from module.config.config_updater import ConfigUpdater
from module.webui.config import WebuiConfig
class State:
"""
Shared settings
"""
_init = False
_clearup = False
webui_config = WebuiConfig()
config_updater = ConfigUpdater()
researt_event: threading.Event = None
manager: SyncManager = None
reload: bool = False
electron: bool = False
theme: str = "default"
@classmethod
def init(cls):
cls.manager = multiprocessing.Manager()
cls._init = True
@classmethod
def clearup(cls):
cls.manager.shutdown()
cls._clearup = True