mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-19 14:39:29 +08:00
fix: use deep_get_with_error when getting full config
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from module.config.deep import deep_get
|
||||
from module.config.deep import deep_get_with_error
|
||||
from module.config.full_config_generated import FullGeneratedConfig
|
||||
from module.logger import logger
|
||||
|
||||
@@ -10,8 +10,8 @@ class AzurLaneFullConfig(FullGeneratedConfig):
|
||||
def __getattribute__(self, item):
|
||||
if item.find("_") == -1:
|
||||
return super().__getattribute__(item)
|
||||
path = item.replace('_', '.')
|
||||
result = deep_get(self.config.data, path)
|
||||
path = item.split('_')
|
||||
result = deep_get_with_error(self.config.data, path)
|
||||
if result is None:
|
||||
raise AttributeError(f"Config {path} not found !")
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user