forked from Dniel97/artemis
添加 titles/FGOA/config.py
This commit is contained in:
parent
b8bf9ca506
commit
c5bced902d
24
titles/FGOA/config.py
Normal file
24
titles/FGOA/config.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user