refine code

This commit is contained in:
geekan 2024-01-08 17:14:12 +08:00
parent b16315f6c7
commit 244fa81ffe
7 changed files with 22 additions and 12 deletions

View file

@ -17,6 +17,8 @@ class YamlModel(BaseModel):
@classmethod
def read_yaml(cls, file_path: Path) -> Dict:
if not file_path.exists():
return {}
with open(file_path, "r") as file:
return yaml.safe_load(file)