2022-06-03 21:28:44 +08:00
|
|
|
from deploy.config import DeployConfig as _DeployConfig
|
2021-11-07 17:21:36 +08:00
|
|
|
|
|
|
|
|
|
2022-06-03 21:28:44 +08:00
|
|
|
class DeployConfig(_DeployConfig):
|
|
|
|
|
def show_config(self):
|
|
|
|
|
pass
|
2021-11-07 17:21:36 +08:00
|
|
|
|
2022-06-03 21:28:44 +08:00
|
|
|
def __setattr__(self, key: str, value):
|
2021-11-07 17:21:36 +08:00
|
|
|
"""
|
|
|
|
|
Catch __setattr__, copy to `self.config`, write deploy config.
|
|
|
|
|
"""
|
|
|
|
|
super().__setattr__(key, value)
|
|
|
|
|
if key[0].isupper() and key in self.config:
|
2025-02-25 00:43:27 +08:00
|
|
|
if key in self.config:
|
|
|
|
|
before = self.config[key]
|
|
|
|
|
if before != value:
|
|
|
|
|
self.config[key] = value
|
|
|
|
|
self.write()
|
|
|
|
|
else:
|
|
|
|
|
self.config[key] = value
|
|
|
|
|
self.write()
|