forked from Dniel97/artemis
25 lines
643 B
Python
25 lines
643 B
Python
|
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)
|