From 3a43ed69192aa7b035f87fa9f0a757bd8c62c699 Mon Sep 17 00:00:00 2001 From: po-lan <42771836+po-lan@users.noreply.github.com> Date: Thu, 16 Jun 2022 14:38:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E9=9C=80=E8=A6=81=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=88=B0=20config=20=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E5=B0=91=E8=B0=83=E7=94=A8=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/utils/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configs/utils/__init__.py b/configs/utils/__init__.py index b134a31b..6bd86bba 100644 --- a/configs/utils/__init__.py +++ b/configs/utils/__init__.py @@ -94,12 +94,13 @@ class ConfigsManager: del self._data[module] self.save() - def set_config(self, module: str, key: str, value: Any): + def set_config(self, module: str, key: str, value: Any , save_simple_data: bool = False): """ 设置配置值 :param module: 模块名 :param key: 配置名称 :param value: 值 + :param save_simple_data: 同时保存至config.yaml """ if module in self._data.keys(): if ( @@ -108,7 +109,7 @@ class ConfigsManager: ): self._data[module][key]["value"] = value self._simple_data[module][key] = value - self.save() + self.save(save_simple_data = save_simple_data) def set_help(self, module: str, key: str, help_: str): """