From 83a9fb95251c173b2394b668aab1b63908af5f29 Mon Sep 17 00:00:00 2001 From: Lint Action Date: Thu, 13 Oct 2022 09:02:20 +0000 Subject: =?UTF-8?q?:rotating=5Flight:=20=E8=87=AA=E5=8A=A8=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/configs/__init__.py | 2 +- ATRI/configs/config.py | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'ATRI/configs') diff --git a/ATRI/configs/__init__.py b/ATRI/configs/__init__.py index 3558f42..cca5d9b 100644 --- a/ATRI/configs/__init__.py +++ b/ATRI/configs/__init__.py @@ -1 +1 @@ -from .config import Config \ No newline at end of file +from .config import Config diff --git a/ATRI/configs/config.py b/ATRI/configs/config.py index e944a43..e691c65 100644 --- a/ATRI/configs/config.py +++ b/ATRI/configs/config.py @@ -4,12 +4,7 @@ from pathlib import Path from ATRI.log import log -from .models import ( - BotConfig, - ConfigModel, - WithGoCQHTTP, - RuntimeConfig -) +from .models import BotConfig, ConfigModel, WithGoCQHTTP, RuntimeConfig _DEFAULT_CONFIG_PATH = Path(".") / "ATRI" / "configs" / "default_config.yml" @@ -43,7 +38,7 @@ class Config: def parse(self) -> ConfigModel: return ConfigModel.parse_obj(self.config) - + def get_runtime_conf(self) -> dict: bot_conf = BotConfig.parse_obj(self.config["BotConfig"]) gocq_conf = WithGoCQHTTP.parse_obj(self.config["WithGoCQHTTP"]) @@ -59,5 +54,5 @@ class Config: session_expire_timeout=bot_conf.session_expire_timeout, gocq_accoutns=gocq_conf.accounts, gocq_download_domain=gocq_conf.download_version, - gocq_version=gocq_conf.download_version + gocq_version=gocq_conf.download_version, ).dict() -- cgit v1.2.3