3
2
forked from Dniel97/artemis

添加 titles/FGOA/config.py

This commit is contained in:
FGO 2024-04-01 19:00:15 +00:00
parent b8bf9ca506
commit c5bced902d

24
titles/FGOA/config.py Normal file
View File

@ -0,0 +1,24 @@
from core.config import CoreConfig
class FGOAServerConfig:
def __init__(self, parent: "FGOAConfig") -> None:
self.__config = parent
@property
def enable(self) -> bool:
return CoreConfig.get_config_field(
self.__config, "fgo", "server", "enable", default=True
)
@property
def loglevel(self) -> int:
return CoreConfig.str_to_loglevel(
CoreConfig.get_config_field(
self.__config, "fgo", "server", "loglevel", default="info"
)
)
class FGOAConfig(dict):
def __init__(self) -> None:
self.server = FGOAServerConfig(self)