fix: Update type hints to use newer Python syntax

- Replace Dict, List, Optional with dict, list,  < /dev/null |  None syntax
- Fix abstract method implementation in message.py
- Improve type annotations and function return types
- Remove unreachable code in get_current_task_tool.py
- Refactor HTML elements to use style attributes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
晴猫
2025-05-01 06:55:05 +09:00
parent 3d001da30e
commit 263e8d196a
29 changed files with 125 additions and 143 deletions

View File

@@ -1,9 +1,9 @@
import json
from typing import Dict
import os
from typing import Any
def load_scenes() -> Dict:
def load_scenes() -> dict[str, Any]:
"""
从JSON文件加载场景数据
@@ -20,7 +20,7 @@ def load_scenes() -> Dict:
PERSONALITY_SCENES = load_scenes()
def get_scene_by_factor(factor: str) -> Dict:
def get_scene_by_factor(factor: str) -> dict | None:
"""
根据人格因子获取对应的情景测试
@@ -28,12 +28,12 @@ def get_scene_by_factor(factor: str) -> Dict:
factor (str): 人格因子名称
Returns:
Dict: 包含情景描述的字典
dict: 包含情景描述的字典
"""
return PERSONALITY_SCENES.get(factor, None)
return PERSONALITY_SCENES.get(factor,None)
def get_all_scenes() -> Dict:
def get_all_scenes() -> dict:
"""
获取所有情景测试