File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,12 +80,6 @@ def __init__(self, file=DEPLOY_CONFIG):
8080 self .config_template = {}
8181 self .read ()
8282
83- # Bypass webui.config.DeployConfig.__setattr__()
84- # Don't write these into deploy.yaml
85- super ().__setattr__ ('GitOverCdn' , self .Repository in ['cn' ])
86- if self .Repository in ['global' , 'cn' ]:
87- super ().__setattr__ ('Repository' , 'https://github.com/LmeSzinc/StarRailCopilot' )
88-
8983 self .write ()
9084 self .show_config ()
9185
@@ -109,9 +103,21 @@ def read(self):
109103 if hasattr (self , key ):
110104 super ().__setattr__ (key , value )
111105
106+ self .config_redirect ()
107+
112108 def write (self ):
113109 poor_yaml_write (self .config , self .file )
114110
111+ def config_redirect (self ):
112+ """
113+ Redirect deploy config, must be called after each `read()`
114+ """
115+ # Bypass webui.config.DeployConfig.__setattr__()
116+ # Don't write these into deploy.yaml
117+ super ().__setattr__ ('GitOverCdn' , self .Repository in ['cn' ])
118+ if self .Repository in ['global' , 'cn' ]:
119+ super ().__setattr__ ('Repository' , 'https://github.com/LmeSzinc/StarRailCopilot' )
120+
115121 def filepath (self , path ):
116122 """
117123 Args:
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ def read(self):
3838 if hasattr (self , key ):
3939 super ().__setattr__ (key , value )
4040
41+ self .config_redirect ()
42+
4143 def write (self ):
4244 """
4345 Write `self.config` into deploy config.
You can’t perform that action at this time.
0 commit comments