1
0
mirror of synced 2024-12-24 18:34:49 +01:00
artemis/titles/mai2/config.py

26 lines
646 B
Python
Raw Normal View History

from core.config import CoreConfig
2023-03-09 17:38:58 +01:00
class Mai2ServerConfig:
def __init__(self, parent: "Mai2Config") -> None:
self.__config = parent
@property
def enable(self) -> bool:
2023-03-09 17:38:58 +01:00
return CoreConfig.get_config_field(
self.__config, "mai2", "server", "enable", default=True
)
@property
def loglevel(self) -> int:
2023-03-09 17:38:58 +01:00
return CoreConfig.str_to_loglevel(
CoreConfig.get_config_field(
self.__config, "mai2", "server", "loglevel", default="info"
)
)
class Mai2Config(dict):
def __init__(self) -> None:
2023-03-09 17:38:58 +01:00
self.server = Mai2ServerConfig(self)