1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-14 11:59:24 +08:00
Files
Alas/module/config/full_config.py

23 lines
748 B
Python
Raw Permalink Normal View History

from module.config.deep import deep_get_with_error
2025-08-31 23:58:15 +08:00
from module.config.full_config_generated import FullGeneratedConfig
from module.logger import logger
2025-08-31 23:58:15 +08:00
class AzurLaneFullConfig(FullGeneratedConfig):
def __init__(self, config):
self.config = config # AzurLaneConfig
def __getattribute__(self, item):
2025-09-01 00:08:25 +08:00
if item.find("_") == -1:
return super().__getattribute__(item)
path = item.split('_')
result = deep_get_with_error(self.config.data, path)
return result
2025-08-31 23:58:15 +08:00
def __setattr__(self, key, value):
2025-09-01 00:08:25 +08:00
if key.find("_") == -1:
return super().__setattr__(key, value)
2025-08-31 23:58:15 +08:00
path = key.replace('_', '.')
self.config.modified[path] = value
2025-08-31 23:58:15 +08:00
self.config.update()