2023-03-03 22:46:29 +00:00
|
|
|
from core.config import CoreConfig
|
|
|
|
|
|
|
|
|
2023-03-09 16:38:58 +00:00
|
|
|
class CardMakerServerConfig:
|
2023-03-03 22:46:29 +00:00
|
|
|
def __init__(self, parent_config: "CardMakerConfig") -> None:
|
|
|
|
self.__config = parent_config
|
|
|
|
|
|
|
|
@property
|
|
|
|
def enable(self) -> bool:
|
2023-03-09 16:38:58 +00:00
|
|
|
return CoreConfig.get_config_field(
|
|
|
|
self.__config, "cardmaker", "server", "enable", default=True
|
|
|
|
)
|
2023-03-03 22:46:29 +00:00
|
|
|
|
|
|
|
@property
|
|
|
|
def loglevel(self) -> int:
|
2023-03-09 16:38:58 +00:00
|
|
|
return CoreConfig.str_to_loglevel(
|
|
|
|
CoreConfig.get_config_field(
|
|
|
|
self.__config, "cardmaker", "server", "loglevel", default="info"
|
|
|
|
)
|
|
|
|
)
|
2023-03-03 22:46:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
class CardMakerConfig(dict):
|
|
|
|
def __init__(self) -> None:
|
|
|
|
self.server = CardMakerServerConfig(self)
|