Skip to content

Commit

Permalink
feat: Config add get function
Browse files Browse the repository at this point in the history
  • Loading branch information
HADB committed Jul 20, 2024
1 parent b69f18d commit afdb5d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/yuanfen/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down

0 comments on commit afdb5d4

Please sign in to comment.