mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-10-11 04:42:10 +00:00
fix: redirect deploy config after Updator.delay()
This commit is contained in:
+13
-10
@@ -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:
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user