diff --git a/src/yuanfen/config.py b/src/yuanfen/config.py index 09826d7..c79f19b 100644 --- a/src/yuanfen/config.py +++ b/src/yuanfen/config.py @@ -31,6 +31,9 @@ def __new__(cls, path, poll=True, logger=None): def __getitem__(self, key): return self.data.get(key, None) + def get(self, key, default=None): + return self.data.get(key, default) + def load(self): with open(self.file_path, "r", encoding="utf-8") as f: if self.file_path.endswith(".json"):