1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-09 16:19:03 +08:00
AzurLaneAutoScript/module/webui/config.py

22 lines
644 B
Python
Raw Normal View History

2022-06-03 21:28:44 +08:00
from deploy.config import DeployConfig as _DeployConfig
2022-06-03 21:28:44 +08:00
class DeployConfig(_DeployConfig):
def show_config(self):
pass
2022-06-03 21:28:44 +08:00
def __setattr__(self, key: str, value):
"""
Catch __setattr__, copy to `self.config`, write deploy config.
"""
super().__setattr__(key, value)
if key[0].isupper() and key in self.config:
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()