File size: 499 Bytes
84ed1d1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 统一路径验证机制
from pathlib import Path
from config_loader import get_paths

def validate_paths():
    paths = get_paths()
    required_dirs = [
        paths['base_dir'],
        paths['data_dir'],
        paths['logging_dir']
    ]
    
    for dir_path in required_dirs:
        if not dir_path.exists():
            dir_path.mkdir(parents=True, exist_ok=True)
        if not dir_path.is_dir():
            raise NotADirectoryError(f"路径配置错误: {dir_path}")