From c5bced902d6e81f3d8b1eec16cdeea475be8edc6 Mon Sep 17 00:00:00 2001 From: FGO Date: Mon, 1 Apr 2024 19:00:15 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20titles/FGOA/config.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- titles/FGOA/config.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 titles/FGOA/config.py diff --git a/titles/FGOA/config.py b/titles/FGOA/config.py new file mode 100644 index 0000000..a16d54e --- /dev/null +++ b/titles/FGOA/config.py @@ -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)