From d6e52d772053097c732218434adb01c4a58013c4 Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Sun, 5 Jul 2026 23:27:02 +0800 Subject: [PATCH] fix: redirect deploy config after `Updator.delay()` --- deploy/Windows/config.py | 23 +++++++++++++---------- module/webui/config.py | 2 ++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/deploy/Windows/config.py b/deploy/Windows/config.py index b6b528e..89d7430 100644 --- a/deploy/Windows/config.py +++ b/deploy/Windows/config.py @@ -77,19 +77,9 @@ class DeployConfig(ConfigModel): self.config_template = {} self.read() - self.set_repo() - self.write() self.show_config() - def set_repo(self): - # Bypass webui.config.DeployConfig.__setattr__() - # Don't write these into deploy.yaml - if self.Repository == 'cn': - super().__setattr__('Repository', 'https://git.yoursfunny.top/YoursFunny/ArisuAutoSweeper.git') - if self.Repository == 'global': - super().__setattr__('Repository', 'https://github.com/TheFunny/ArisuAutoSweeper') - def show_config(self): logger.hr("Show deploy config", 1) for k, v in self.config.items(): @@ -110,9 +100,22 @@ class DeployConfig(ConfigModel): if hasattr(self, key): super().__setattr__(key, value) + self.config_redirect() + def write(self): poor_yaml_write(self.config, self.file) + def config_redirect(self): + """ + Redirect deploy config, must be called after each `read()` + """ + # Bypass webui.config.DeployConfig.__setattr__() + # Don't write these into deploy.yaml + if self.Repository == 'cn': + super().__setattr__('Repository', 'https://git.yoursfunny.top/YoursFunny/ArisuAutoSweeper.git') + if self.Repository == 'global': + super().__setattr__('Repository', 'https://github.com/TheFunny/ArisuAutoSweeper') + def filepath(self, path): """ Args: diff --git a/module/webui/config.py b/module/webui/config.py index fd4d6ef..0df5f05 100644 --- a/module/webui/config.py +++ b/module/webui/config.py @@ -37,6 +37,8 @@ class DeployConfig(_DeployConfig): if hasattr(self, key): super().__setattr__(key, value) + self.config_redirect() + def write(self): """ Write `self.config` into deploy config.