1
0
mirror of synced 2024-11-28 07:50:48 +01:00
artemis/titles/mai2/config.py
2023-05-12 22:05:05 -04:00

49 lines
1.3 KiB
Python

from core.config import CoreConfig
class Mai2ServerConfig:
def __init__(self, parent: "Mai2Config") -> None:
self.__config = parent
@property
def enable(self) -> bool:
return CoreConfig.get_config_field(
self.__config, "mai2", "server", "enable", default=True
)
@property
def loglevel(self) -> int:
return CoreConfig.str_to_loglevel(
CoreConfig.get_config_field(
self.__config, "mai2", "server", "loglevel", default="info"
)
)
class Mai2DeliverConfig:
def __init__(self, parent: "Mai2Config") -> None:
self.__config = parent
@property
def enable(self) -> bool:
return CoreConfig.get_config_field(
self.__config, "mai2", "deliver", "enable", default=False
)
@property
def udbdl_enable(self) -> bool:
return CoreConfig.get_config_field(
self.__config, "mai2", "deliver", "udbdl_enable", default=False
)
@property
def content_folder(self) -> int:
return CoreConfig.get_config_field(
self.__config, "mai2", "server", "content_folder", default=""
)
class Mai2Config(dict):
def __init__(self) -> None:
self.server = Mai2ServerConfig(self)
self.deliver = Mai2DeliverConfig(self)