style: format all Python files with Black

Apply Black formatter to the entire codebase for consistent code style.

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-02-26 22:44:03 +08:00
parent 1b16842a2c
commit 3b7c00377f
46 changed files with 1488 additions and 974 deletions

View File

@@ -6,6 +6,7 @@
负责加载、保存和管理用户配置。
支持从环境变量和 .env 文件加载配置。
"""
import os
from typing import TYPE_CHECKING
from config.loader import ConfigLoader
@@ -20,7 +21,9 @@ if TYPE_CHECKING:
class ConfigManager:
"""配置管理器"""
def __init__(self, config_file: str = "config/user_settings.json", use_env: bool = True):
def __init__(
self, config_file: str = "config/user_settings.json", use_env: bool = True
):
"""
初始化配置管理器
@@ -99,7 +102,9 @@ class ConfigManager:
field_type = type(getattr(obj, target_field))
# 如果是字符串且目标字段是枚举类型,进行转换
if isinstance(value, str) and hasattr(field_type, "__members__"): # 它是一个 Enum
if isinstance(value, str) and hasattr(
field_type, "__members__"
): # 它是一个 Enum
try:
value = field_type(value)
except ValueError: