内部函数:加载并解析YAML文件
(file_path: Path)
| 14 | |
| 15 | @cache |
| 16 | def _load_template_file(file_path: Path): |
| 17 | """内部函数:加载并解析YAML文件""" |
| 18 | try: |
| 19 | with open(file_path, 'r', encoding='utf-8') as f: |
| 20 | return yaml.safe_load(f) |
| 21 | except FileNotFoundError: |
| 22 | raise FileNotFoundError(f"Template file not found at {file_path}") |
| 23 | except yaml.YAMLError as e: |
| 24 | raise ValueError(f"Error parsing YAML file {file_path}: {e}") |
| 25 | |
| 26 | |
| 27 | def get_base_template(): |
no test coverage detected