2026-01-28 21:55:04 +08:00
|
|
|
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
|
2025-09-12 22:37:40 +08:00
|
|
|
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)
|
2026-01-28 21:55:04 +08:00
|
|
|
path = item.split('_')
|
|
|
|
|
result = deep_get_with_error(self.config.data, path)
|
2025-09-12 23:00:26 +08:00
|
|
|
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('_', '.')
|
2025-09-12 23:31:24 +08:00
|
|
|
self.config.modified[path] = value
|
2025-08-31 23:58:15 +08:00
|
|
|
self.config.update()
|