mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-10-18 05:42:11 +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.config_template = {}
|
||||||
self.read()
|
self.read()
|
||||||
|
|
||||||
self.set_repo()
|
|
||||||
|
|
||||||
self.write()
|
self.write()
|
||||||
self.show_config()
|
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):
|
def show_config(self):
|
||||||
logger.hr("Show deploy config", 1)
|
logger.hr("Show deploy config", 1)
|
||||||
for k, v in self.config.items():
|
for k, v in self.config.items():
|
||||||
@@ -110,9 +100,22 @@ class DeployConfig(ConfigModel):
|
|||||||
if hasattr(self, key):
|
if hasattr(self, key):
|
||||||
super().__setattr__(key, value)
|
super().__setattr__(key, value)
|
||||||
|
|
||||||
|
self.config_redirect()
|
||||||
|
|
||||||
def write(self):
|
def write(self):
|
||||||
poor_yaml_write(self.config, self.file)
|
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):
|
def filepath(self, path):
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ class DeployConfig(_DeployConfig):
|
|||||||
if hasattr(self, key):
|
if hasattr(self, key):
|
||||||
super().__setattr__(key, value)
|
super().__setattr__(key, value)
|
||||||
|
|
||||||
|
self.config_redirect()
|
||||||
|
|
||||||
def write(self):
|
def write(self):
|
||||||
"""
|
"""
|
||||||
Write `self.config` into deploy config.
|
Write `self.config` into deploy config.
|
||||||
|
|||||||
Reference in New Issue
Block a user