mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: Wrap ALAS's config_redirect()
This commit is contained in:
parent
abfd00da86
commit
1b71236e3a
@ -74,25 +74,6 @@ class DeployConfig(ConfigModel):
|
|||||||
self.file = file
|
self.file = file
|
||||||
self.config = {}
|
self.config = {}
|
||||||
self.read()
|
self.read()
|
||||||
if self.Repository in [
|
|
||||||
'https://gitee.com/LmeSzinc/AzurLaneAutoScript',
|
|
||||||
'https://gitee.com/lmeszinc/azur-lane-auto-script-mirror',
|
|
||||||
'https://e.coding.net/llop18870/alas/AzurLaneAutoScript.git',
|
|
||||||
'https://e.coding.net/saarcenter/alas/AzurLaneAutoScript.git',
|
|
||||||
'https://git.saarcenter.com/LmeSzinc/AzurLaneAutoScript.git',
|
|
||||||
]:
|
|
||||||
self.Repository = 'git://git.lyoko.io/AzurLaneAutoScript'
|
|
||||||
|
|
||||||
# Bypass webui.config.DeployConfig.__setattr__()
|
|
||||||
# Don't write these into deploy.yaml
|
|
||||||
super().__setattr__(
|
|
||||||
'GitOverCdn',
|
|
||||||
self.Repository == 'git://git.lyoko.io/AzurLaneAutoScript' and self.Branch == 'master'
|
|
||||||
)
|
|
||||||
if self.Repository in ['global']:
|
|
||||||
super().__setattr__('Repository', 'https://github.com/LmeSzinc/AzurLaneAutoScript')
|
|
||||||
if self.Repository in ['cn']:
|
|
||||||
super().__setattr__('Repository', 'git://git.lyoko.io/AzurLaneAutoScript')
|
|
||||||
|
|
||||||
self.write()
|
self.write()
|
||||||
self.show_config()
|
self.show_config()
|
||||||
@ -120,6 +101,30 @@ class DeployConfig(ConfigModel):
|
|||||||
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()`
|
||||||
|
"""
|
||||||
|
if self.Repository in [
|
||||||
|
'https://gitee.com/LmeSzinc/AzurLaneAutoScript',
|
||||||
|
'https://gitee.com/lmeszinc/azur-lane-auto-script-mirror',
|
||||||
|
'https://e.coding.net/llop18870/alas/AzurLaneAutoScript.git',
|
||||||
|
'https://e.coding.net/saarcenter/alas/AzurLaneAutoScript.git',
|
||||||
|
'https://git.saarcenter.com/LmeSzinc/AzurLaneAutoScript.git',
|
||||||
|
]:
|
||||||
|
self.Repository = 'git://git.lyoko.io/AzurLaneAutoScript'
|
||||||
|
|
||||||
|
# Bypass webui.config.DeployConfig.__setattr__()
|
||||||
|
# Don't write these into deploy.yaml
|
||||||
|
super().__setattr__(
|
||||||
|
'GitOverCdn',
|
||||||
|
self.Repository == 'git://git.lyoko.io/AzurLaneAutoScript' and self.Branch == 'master'
|
||||||
|
)
|
||||||
|
if self.Repository in ['global']:
|
||||||
|
super().__setattr__('Repository', 'https://github.com/LmeSzinc/AzurLaneAutoScript')
|
||||||
|
if self.Repository in ['cn']:
|
||||||
|
super().__setattr__('Repository', 'git://git.lyoko.io/AzurLaneAutoScript')
|
||||||
|
|
||||||
def filepath(self, key):
|
def filepath(self, key):
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user