ruff fix但指定了--unsafe-fixes

This commit is contained in:
minecraft1024a
2025-10-05 21:48:32 +08:00
parent 0b4e1f5b7b
commit 9d705463ce
76 changed files with 300 additions and 315 deletions

View File

@@ -835,8 +835,6 @@ class ComponentRegistry:
},
"enabled_components": len([c for c in self._components.values() if c.enabled]),
"enabled_plugins": len([p for p in self._plugins.values() if p.enabled]),
"enabled_components": len([c for c in self._components.values() if c.enabled]),
"enabled_plugins": len([p for p in self._plugins.values() if p.enabled]),
}
# === 组件移除相关 ===

View File

@@ -46,8 +46,8 @@ class EventManager:
def register_event(
self,
event_name: EventType | str,
allowed_subscribers: list[str] = None,
allowed_triggers: list[str] = None,
allowed_subscribers: list[str] | None = None,
allowed_triggers: list[str] | None = None,
) -> bool:
"""注册一个新的事件

View File

@@ -138,7 +138,7 @@ class ToolExecutor:
pending_step_two = getattr(self, "_pending_step_two_tools", {})
if pending_step_two:
# 添加第二步工具定义
for tool_name, step_two_def in pending_step_two.items():
for step_two_def in pending_step_two.values():
tool_definitions.append(step_two_def)
return tool_definitions
@@ -192,7 +192,7 @@ class ToolExecutor:
"timestamp": time.time(),
}
content = tool_info["content"]
if not isinstance(content, (str, list, tuple)):
if not isinstance(content, str | list | tuple):
tool_info["content"] = str(content)
tool_results.append(tool_info)